diff --git a/examples/ex_2ch/oas_response_decoders_gen.go b/examples/ex_2ch/oas_response_decoders_gen.go index 20bf960e4..10664a903 100644 --- a/examples/ex_2ch/oas_response_decoders_gen.go +++ b/examples/ex_2ch/oas_response_decoders_gen.go @@ -47,6 +47,15 @@ func decodeAPICaptcha2chcaptchaIDGetResponse(resp *http.Response) (res *Captcha, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -100,6 +109,15 @@ func decodeAPICaptchaAppIDPublicKeyGetResponse(resp *http.Response) (res *Captch } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -141,6 +159,15 @@ func decodeAPICaptchaInvisibleRecaptchaIDGetResponse(resp *http.Response) (res * } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -191,6 +218,15 @@ func decodeAPICaptchaRecaptchaIDGetResponse(resp *http.Response) (res *Captcha, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -241,6 +277,15 @@ func decodeAPIDislikeGetResponse(resp *http.Response) (res *Like, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -282,6 +327,15 @@ func decodeAPILikeGetResponse(resp *http.Response) (res *Like, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -323,6 +377,15 @@ func decodeAPIMobileV2AfterBoardThreadNumGetResponse(resp *http.Response) (res * } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -364,6 +427,15 @@ func decodeAPIMobileV2BoardsGetResponse(resp *http.Response) (res Boards, _ erro } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -405,6 +477,15 @@ func decodeAPIMobileV2InfoBoardThreadGetResponse(resp *http.Response) (res *Mobi } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -446,6 +527,15 @@ func decodeAPIMobileV2PostBoardNumGetResponse(resp *http.Response) (res *MobileP } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -487,6 +577,15 @@ func decodeUserPassloginPostResponse(resp *http.Response) (res *Passcode, _ erro } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -528,6 +627,15 @@ func decodeUserPostingPostResponse(resp *http.Response) (res UserPostingPostOK, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -569,6 +677,15 @@ func decodeUserReportPostResponse(resp *http.Response) (res *Report, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_ent/oas_response_decoders_gen.go b/examples/ex_ent/oas_response_decoders_gen.go index 042dd2517..f98b4f21b 100644 --- a/examples/ex_ent/oas_response_decoders_gen.go +++ b/examples/ex_ent/oas_response_decoders_gen.go @@ -859,6 +859,15 @@ func decodeListPetResponse(resp *http.Response) (res ListPetRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1005,6 +1014,15 @@ func decodeListPetCategoriesResponse(resp *http.Response) (res ListPetCategories } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1151,6 +1169,15 @@ func decodeListPetFriendsResponse(resp *http.Response) (res ListPetFriendsRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_firecracker/oas_response_decoders_gen.go b/examples/ex_firecracker/oas_response_decoders_gen.go index 9686b501b..9cdd7ba78 100644 --- a/examples/ex_firecracker/oas_response_decoders_gen.go +++ b/examples/ex_firecracker/oas_response_decoders_gen.go @@ -455,6 +455,15 @@ func decodeDescribeInstanceResponse(resp *http.Response) (res *InstanceInfo, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -538,6 +547,15 @@ func decodeGetExportVmConfigResponse(resp *http.Response) (res *FullVmConfigurat } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -621,6 +639,15 @@ func decodeGetMachineConfigurationResponse(resp *http.Response) (res *MachineCon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_github/oas_response_decoders_gen.go b/examples/ex_github/oas_response_decoders_gen.go index 36173082f..73808a751 100644 --- a/examples/ex_github/oas_response_decoders_gen.go +++ b/examples/ex_github/oas_response_decoders_gen.go @@ -4,6 +4,7 @@ package api import ( "bytes" + "fmt" "io" "mime" "net/http" @@ -364,6 +365,15 @@ func decodeActionsCreateRegistrationTokenForOrgResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -405,6 +415,15 @@ func decodeActionsCreateRegistrationTokenForRepoResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -446,6 +465,15 @@ func decodeActionsCreateRemoveTokenForOrgResponse(resp *http.Response) (res *Aut } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -487,6 +515,15 @@ func decodeActionsCreateRemoveTokenForRepoResponse(resp *http.Response) (res *Au } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -528,6 +565,15 @@ func decodeActionsCreateSelfHostedRunnerGroupForOrgResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1017,6 +1063,15 @@ func decodeActionsGetGithubActionsPermissionsOrganizationResponse(resp *http.Res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1058,6 +1113,15 @@ func decodeActionsGetGithubActionsPermissionsRepositoryResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1099,6 +1163,15 @@ func decodeActionsGetJobForWorkflowRunResponse(resp *http.Response) (res *Job, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1181,6 +1254,15 @@ func decodeActionsGetOrgSecretResponse(resp *http.Response) (res *OrganizationAc } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1312,6 +1394,32 @@ func decodeActionsGetReviewsForRunResponse(resp *http.Response) (res []Environme } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -1353,6 +1461,15 @@ func decodeActionsGetSelfHostedRunnerForOrgResponse(resp *http.Response) (res *R } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1394,6 +1511,15 @@ func decodeActionsGetSelfHostedRunnerForRepoResponse(resp *http.Response) (res * } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1435,6 +1561,15 @@ func decodeActionsGetSelfHostedRunnerGroupForOrgResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1558,6 +1693,15 @@ func decodeActionsListArtifactsForRepoResponse(resp *http.Response) (res *Action } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActionsListArtifactsForRepoOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -1639,6 +1783,15 @@ func decodeActionsListEnvironmentSecretsResponse(resp *http.Response) (res *Acti } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActionsListEnvironmentSecretsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -1720,6 +1873,15 @@ func decodeActionsListJobsForWorkflowRunResponse(resp *http.Response) (res *Acti } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActionsListJobsForWorkflowRunOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -1801,6 +1963,15 @@ func decodeActionsListOrgSecretsResponse(resp *http.Response) (res *ActionsListO } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActionsListOrgSecretsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -1882,6 +2053,15 @@ func decodeActionsListRepoAccessToSelfHostedRunnerGroupInOrgResponse(resp *http. } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1923,6 +2103,15 @@ func decodeActionsListRepoSecretsResponse(resp *http.Response) (res *ActionsList } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActionsListRepoSecretsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -2004,6 +2193,15 @@ func decodeActionsListRepoWorkflowsResponse(resp *http.Response) (res *ActionsLi } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActionsListRepoWorkflowsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -2093,6 +2291,15 @@ func decodeActionsListRunnerApplicationsForOrgResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -2142,6 +2349,15 @@ func decodeActionsListRunnerApplicationsForRepoResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -2183,6 +2399,15 @@ func decodeActionsListSelectedReposForOrgSecretResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2224,6 +2449,15 @@ func decodeActionsListSelectedRepositoriesEnabledGithubActionsOrganizationRespon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2265,6 +2499,15 @@ func decodeActionsListSelfHostedRunnerGroupsForOrgResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2306,6 +2549,15 @@ func decodeActionsListSelfHostedRunnersForOrgResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActionsListSelfHostedRunnersForOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -2387,6 +2639,15 @@ func decodeActionsListSelfHostedRunnersForRepoResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActionsListSelfHostedRunnersForRepoOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -2468,6 +2729,15 @@ func decodeActionsListSelfHostedRunnersInGroupForOrgResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActionsListSelfHostedRunnersInGroupForOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -2549,6 +2819,15 @@ func decodeActionsListWorkflowRunArtifactsResponse(resp *http.Response) (res *Ac } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActionsListWorkflowRunArtifactsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -2630,6 +2909,15 @@ func decodeActionsListWorkflowRunsForRepoResponse(resp *http.Response) (res *Act } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActionsListWorkflowRunsForRepoOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -2831,6 +3119,32 @@ func decodeActionsReviewPendingDeploymentsForRunResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -2944,6 +3258,15 @@ func decodeActionsUpdateSelfHostedRunnerGroupForOrgResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3549,6 +3872,32 @@ func decodeActivityListEventsForAuthenticatedUserResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -3598,6 +3947,15 @@ func decodeActivityListNotificationsForAuthenticatedUserResponse(resp *http.Resp } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActivityListNotificationsForAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -3746,6 +4104,15 @@ func decodeActivityListNotificationsForAuthenticatedUserResponse(resp *http.Resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3795,6 +4162,32 @@ func decodeActivityListOrgEventsForAuthenticatedUserResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -3836,6 +4229,15 @@ func decodeActivityListPublicEventsResponse(resp *http.Response) (res ActivityLi } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3950,6 +4352,15 @@ func decodeActivityListPublicEventsForRepoNetworkResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4107,6 +4518,32 @@ func decodeActivityListPublicEventsForUserResponse(resp *http.Response) (res []E } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -4156,6 +4593,32 @@ func decodeActivityListPublicOrgEventsResponse(resp *http.Response) (res []Event } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -4205,6 +4668,32 @@ func decodeActivityListReceivedEventsForUserResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -4254,6 +4743,32 @@ func decodeActivityListReceivedPublicEventsForUserResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -4303,6 +4818,32 @@ func decodeActivityListRepoEventsResponse(resp *http.Response) (res []Event, _ e } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -4352,6 +4893,15 @@ func decodeActivityListRepoNotificationsForAuthenticatedUserResponse(resp *http. } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActivityListRepoNotificationsForAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -4441,6 +4991,15 @@ func decodeActivityListReposStarredByAuthenticatedUserResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActivityListReposStarredByAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -4603,6 +5162,15 @@ func decodeActivityListReposWatchedByUserResponse(resp *http.Response) (res *Act } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActivityListReposWatchedByUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -4692,6 +5260,15 @@ func decodeActivityListWatchedReposForAuthenticatedUserResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActivityListWatchedReposForAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -4854,6 +5431,15 @@ func decodeActivityListWatchersForRepoResponse(resp *http.Response) (res *Activi } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ActivityListWatchersForRepoOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -5614,6 +6200,15 @@ func decodeAppsCheckTokenResponse(resp *http.Response) (res AppsCheckTokenRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5684,6 +6279,15 @@ func decodeAppsCheckTokenResponse(resp *http.Response) (res AppsCheckTokenRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5725,6 +6329,15 @@ func decodeAppsCreateContentAttachmentResponse(resp *http.Response) (res AppsCre } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5903,6 +6516,15 @@ func decodeAppsCreateContentAttachmentResponse(resp *http.Response) (res AppsCre } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5944,6 +6566,15 @@ func decodeAppsCreateFromManifestResponse(resp *http.Response) (res AppsCreateFr } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6055,6 +6686,15 @@ func decodeAppsCreateInstallationAccessTokenResponse(resp *http.Response) (res A } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6230,6 +6870,15 @@ func decodeAppsCreateInstallationAccessTokenResponse(resp *http.Response) (res A } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6274,6 +6923,15 @@ func decodeAppsDeleteAuthorizationResponse(resp *http.Response) (res AppsDeleteA } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6362,6 +7020,15 @@ func decodeAppsDeleteTokenResponse(resp *http.Response) (res AppsDeleteTokenRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6403,6 +7070,15 @@ func decodeAppsGetAuthenticatedResponse(resp *http.Response) (res *Integration, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6444,6 +7120,15 @@ func decodeAppsGetBySlugResponse(resp *http.Response) (res AppsGetBySlugRes, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6590,6 +7275,15 @@ func decodeAppsGetSubscriptionPlanForAccountResponse(resp *http.Response) (res A } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6701,6 +7395,15 @@ func decodeAppsGetSubscriptionPlanForAccountStubbedResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6780,6 +7483,15 @@ func decodeAppsGetWebhookConfigForAppResponse(resp *http.Response) (res *Webhook } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6821,6 +7533,15 @@ func decodeAppsGetWebhookDeliveryResponse(resp *http.Response) (res AppsGetWebho } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6891,6 +7612,15 @@ func decodeAppsGetWebhookDeliveryResponse(resp *http.Response) (res AppsGetWebho } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6940,6 +7670,32 @@ func decodeAppsListAccountsForPlanResponse(resp *http.Response) (res AppsListAcc } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper AppsListAccountsForPlanOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -7085,6 +7841,15 @@ func decodeAppsListAccountsForPlanResponse(resp *http.Response) (res AppsListAcc } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7134,6 +7899,32 @@ func decodeAppsListAccountsForPlanStubbedResponse(resp *http.Response) (res Apps } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper AppsListAccountsForPlanStubbedOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -7250,6 +8041,15 @@ func decodeAppsListInstallationReposForAuthenticatedUserResponse(resp *http.Resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper AppsListInstallationReposForAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -7412,6 +8212,32 @@ func decodeAppsListPlansResponse(resp *http.Response) (res AppsListPlansRes, _ e } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper AppsListPlansOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -7571,6 +8397,32 @@ func decodeAppsListPlansStubbedResponse(resp *http.Response) (res AppsListPlansS } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper AppsListPlansStubbedOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -7687,6 +8539,15 @@ func decodeAppsListReposAccessibleToInstallationResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper AppsListReposAccessibleToInstallationOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -7849,6 +8710,32 @@ func decodeAppsListSubscriptionsForAuthenticatedUserResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper AppsListSubscriptionsForAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -8011,6 +8898,32 @@ func decodeAppsListSubscriptionsForAuthenticatedUserStubbedResponse(resp *http.R } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper AppsListSubscriptionsForAuthenticatedUserStubbedOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -8130,6 +9043,15 @@ func decodeAppsListWebhookDeliveriesResponse(resp *http.Response) (res AppsListW } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8200,6 +9122,15 @@ func decodeAppsListWebhookDeliveriesResponse(resp *http.Response) (res AppsListW } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8311,6 +9242,15 @@ func decodeAppsRedeliverWebhookDeliveryResponse(resp *http.Response) (res AppsRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8434,6 +9374,15 @@ func decodeAppsResetTokenResponse(resp *http.Response) (res AppsResetTokenRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8469,6 +9418,15 @@ func decodeAppsResetTokenResponse(resp *http.Response) (res AppsResetTokenRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8519,6 +9477,15 @@ func decodeAppsScopeTokenResponse(resp *http.Response) (res AppsScopeTokenRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8659,6 +9626,15 @@ func decodeAppsScopeTokenResponse(resp *http.Response) (res AppsScopeTokenRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8788,6 +9764,15 @@ func decodeAppsUpdateWebhookConfigForAppResponse(resp *http.Response) (res *Webh } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9198,6 +10183,15 @@ func decodeChecksCreateSuiteResponse(resp *http.Response) (res ChecksCreateSuite } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9233,6 +10227,15 @@ func decodeChecksCreateSuiteResponse(resp *http.Response) (res ChecksCreateSuite } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9274,6 +10277,15 @@ func decodeChecksGetResponse(resp *http.Response) (res *CheckRun, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9315,6 +10327,15 @@ func decodeChecksGetSuiteResponse(resp *http.Response) (res *CheckSuite, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9364,6 +10385,15 @@ func decodeChecksListAnnotationsResponse(resp *http.Response) (res *ChecksListAn } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ChecksListAnnotationsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -9445,6 +10475,15 @@ func decodeChecksListForRefResponse(resp *http.Response) (res *ChecksListForRefO } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ChecksListForRefOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -9526,6 +10565,15 @@ func decodeChecksListForSuiteResponse(resp *http.Response) (res *ChecksListForSu } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ChecksListForSuiteOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -9607,6 +10655,15 @@ func decodeChecksListSuitesForRefResponse(resp *http.Response) (res *ChecksListS } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ChecksListSuitesForRefOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -9951,6 +11008,15 @@ func decodeCodeScanningGetAlertResponse(resp *http.Response) (res CodeScanningGe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10097,6 +11163,15 @@ func decodeCodeScanningGetAnalysisResponse(resp *http.Response) (res CodeScannin } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil case ct == "application/json+sarif": reader := resp.Body @@ -10252,6 +11327,15 @@ func decodeCodeScanningGetSarifResponse(resp *http.Response) (res CodeScanningGe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10366,6 +11450,15 @@ func decodeCodeScanningListAlertInstancesResponse(resp *http.Response) (res Code } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10512,6 +11605,15 @@ func decodeCodeScanningListAlertsForRepoResponse(resp *http.Response) (res CodeS } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10658,6 +11760,15 @@ func decodeCodeScanningListRecentAnalysesResponse(resp *http.Response) (res Code } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10804,6 +11915,15 @@ func decodeCodeScanningUpdateAlertResponse(resp *http.Response) (res CodeScannin } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11102,6 +12222,15 @@ func decodeCodesOfConductGetAllCodesOfConductResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11287,6 +12416,15 @@ func decodeEnterpriseAdminCreateRegistrationTokenForEnterpriseResponse(resp *htt } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11328,6 +12466,15 @@ func decodeEnterpriseAdminCreateRemoveTokenForEnterpriseResponse(resp *http.Resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11369,6 +12516,15 @@ func decodeEnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseResponse(resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11513,6 +12669,15 @@ func decodeEnterpriseAdminGetAuditLogResponse(resp *http.Response) (res []AuditL } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -11554,6 +12719,15 @@ func decodeEnterpriseAdminGetGithubActionsPermissionsEnterpriseResponse(resp *ht } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11595,6 +12769,15 @@ func decodeEnterpriseAdminGetProvisioningInformationForEnterpriseGroupResponse(r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11636,6 +12819,15 @@ func decodeEnterpriseAdminGetProvisioningInformationForEnterpriseUserResponse(re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11677,6 +12869,15 @@ func decodeEnterpriseAdminGetSelfHostedRunnerForEnterpriseResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11718,6 +12919,15 @@ func decodeEnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseResponse(resp *ht } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11759,6 +12969,15 @@ func decodeEnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseRespon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11800,6 +13019,15 @@ func decodeEnterpriseAdminListProvisionedGroupsEnterpriseResponse(resp *http.Res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11841,6 +13069,15 @@ func decodeEnterpriseAdminListProvisionedIdentitiesEnterpriseResponse(resp *http } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11890,6 +13127,15 @@ func decodeEnterpriseAdminListRunnerApplicationsForEnterpriseResponse(resp *http } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -11931,6 +13177,15 @@ func decodeEnterpriseAdminListSelectedOrganizationsEnabledGithubActionsEnterpris } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11972,6 +13227,15 @@ func decodeEnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseResponse(resp * } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12013,6 +13277,15 @@ func decodeEnterpriseAdminListSelfHostedRunnersForEnterpriseResponse(resp *http. } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper EnterpriseAdminListSelfHostedRunnersForEnterpriseOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -12094,6 +13367,15 @@ func decodeEnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseResponse(resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -12175,6 +13457,15 @@ func decodeEnterpriseAdminProvisionAndInviteEnterpriseGroupResponse(resp *http.R } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12216,6 +13507,15 @@ func decodeEnterpriseAdminProvisionAndInviteEnterpriseUserResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12293,6 +13593,15 @@ func decodeEnterpriseAdminSetInformationForProvisionedEnterpriseGroupResponse(re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12334,6 +13643,15 @@ func decodeEnterpriseAdminSetInformationForProvisionedEnterpriseUserResponse(res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12402,6 +13720,15 @@ func decodeEnterpriseAdminUpdateAttributeForEnterpriseGroupResponse(resp *http.R } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12443,6 +13770,15 @@ func decodeEnterpriseAdminUpdateAttributeForEnterpriseUserResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12484,6 +13820,15 @@ func decodeEnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseResponse(resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12607,6 +13952,15 @@ func decodeGistsCreateResponse(resp *http.Response) (res GistsCreateRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GistSimpleHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -12755,6 +14109,15 @@ func decodeGistsCreateResponse(resp *http.Response) (res GistsCreateRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12796,6 +14159,15 @@ func decodeGistsCreateCommentResponse(resp *http.Response) (res GistsCreateComme } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GistCommentHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -13262,6 +14634,15 @@ func decodeGistsForkResponse(resp *http.Response) (res GistsForkRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -13303,6 +14684,15 @@ func decodeGistsGetResponse(resp *http.Response) (res GistsGetRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -13417,6 +14807,15 @@ func decodeGistsGetCommentResponse(resp *http.Response) (res GistsGetCommentRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -13531,6 +14930,15 @@ func decodeGistsGetRevisionResponse(resp *http.Response) (res GistsGetRevisionRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -13636,6 +15044,15 @@ func decodeGistsGetRevisionResponse(resp *http.Response) (res GistsGetRevisionRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -13685,6 +15102,15 @@ func decodeGistsListResponse(resp *http.Response) (res GistsListRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GistsListOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -13812,6 +15238,32 @@ func decodeGistsListCommentsResponse(resp *http.Response) (res GistsListComments } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GistsListCommentsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -13974,6 +15426,15 @@ func decodeGistsListCommitsResponse(resp *http.Response) (res GistsListCommitsRe } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GistsListCommitsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -14136,6 +15597,15 @@ func decodeGistsListForUserResponse(resp *http.Response) (res GistsListForUserRe } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GistsListForUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -14211,6 +15681,15 @@ func decodeGistsListForUserResponse(resp *http.Response) (res GistsListForUserRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -14260,6 +15739,32 @@ func decodeGistsListForksResponse(resp *http.Response) (res GistsListForksRes, _ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GistsListForksOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -14422,6 +15927,15 @@ func decodeGistsListPublicResponse(resp *http.Response) (res GistsListPublicRes, } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GistsListPublicOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -14535,6 +16049,15 @@ func decodeGistsListPublicResponse(resp *http.Response) (res GistsListPublicRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -14584,6 +16107,15 @@ func decodeGistsListStarredResponse(resp *http.Response) (res GistsListStarredRe } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GistsListStarredOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -14902,6 +16434,15 @@ func decodeGistsUpdateCommentResponse(resp *http.Response) (res GistsUpdateComme } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -15158,6 +16699,15 @@ func decodeGitCreateBlobResponse(resp *http.Response) (res GitCreateBlobRes, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -15199,6 +16749,15 @@ func decodeGitCreateCommitResponse(resp *http.Response) (res GitCreateCommitRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GitCommitHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -15309,6 +16868,15 @@ func decodeGitCreateCommitResponse(resp *http.Response) (res GitCreateCommitRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -15350,6 +16918,15 @@ func decodeGitCreateRefResponse(resp *http.Response) (res GitCreateRefRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GitRefHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -15425,6 +17002,15 @@ func decodeGitCreateRefResponse(resp *http.Response) (res GitCreateRefRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -15541,6 +17127,15 @@ func decodeGitCreateTagResponse(resp *http.Response) (res GitCreateTagRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -15582,6 +17177,15 @@ func decodeGitCreateTreeResponse(resp *http.Response) (res GitCreateTreeRes, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GitTreeHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -15727,6 +17331,15 @@ func decodeGitCreateTreeResponse(resp *http.Response) (res GitCreateTreeRes, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -15771,6 +17384,15 @@ func decodeGitDeleteRefResponse(resp *http.Response) (res GitDeleteRefRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -15917,6 +17539,15 @@ func decodeGitGetBlobResponse(resp *http.Response) (res GitGetBlobRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -15958,6 +17589,15 @@ func decodeGitGetCommitResponse(resp *http.Response) (res GitGetCommitRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16034,6 +17674,15 @@ func decodeGitGetRefResponse(resp *http.Response) (res GitGetRefRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16186,6 +17835,15 @@ func decodeGitGetTreeResponse(resp *http.Response) (res GitGetTreeRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16256,6 +17914,15 @@ func decodeGitGetTreeResponse(resp *http.Response) (res GitGetTreeRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16305,6 +17972,32 @@ func decodeGitListMatchingRefsResponse(resp *http.Response) (res *GitListMatchin } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper GitListMatchingRefsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -16386,6 +18079,15 @@ func decodeGitUpdateRefResponse(resp *http.Response) (res GitUpdateRefRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16421,6 +18123,15 @@ func decodeGitUpdateRefResponse(resp *http.Response) (res GitUpdateRefRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16462,6 +18173,15 @@ func decodeGitignoreGetAllTemplatesResponse(resp *http.Response) (res GitignoreG } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16580,6 +18300,15 @@ func decodeInteractionsSetRestrictionsForAuthenticatedUserResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16615,6 +18344,15 @@ func decodeInteractionsSetRestrictionsForAuthenticatedUserResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16656,6 +18394,15 @@ func decodeInteractionsSetRestrictionsForOrgResponse(resp *http.Response) (res I } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16691,6 +18438,15 @@ func decodeInteractionsSetRestrictionsForOrgResponse(resp *http.Response) (res I } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16732,6 +18488,15 @@ func decodeInteractionsSetRestrictionsForRepoResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16776,6 +18541,15 @@ func decodeIssuesAddAssigneesResponse(resp *http.Response) (res *IssueSimple, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -16861,6 +18635,15 @@ func decodeIssuesCreateResponse(resp *http.Response) (res IssuesCreateRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper IssueHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -17041,6 +18824,15 @@ func decodeIssuesCreateResponse(resp *http.Response) (res IssuesCreateRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -17117,6 +18909,15 @@ func decodeIssuesCreateCommentResponse(resp *http.Response) (res IssuesCreateCom } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper IssueCommentHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -17297,6 +19098,15 @@ func decodeIssuesCreateCommentResponse(resp *http.Response) (res IssuesCreateCom } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -17448,6 +19258,15 @@ func decodeIssuesCreateLabelResponse(resp *http.Response) (res IssuesCreateLabel } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -17489,6 +19308,15 @@ func decodeIssuesCreateMilestoneResponse(resp *http.Response) (res IssuesCreateM } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper MilestoneHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -17599,6 +19427,15 @@ func decodeIssuesCreateMilestoneResponse(resp *http.Response) (res IssuesCreateM } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -17702,6 +19539,15 @@ func decodeIssuesGetResponse(resp *http.Response) (res IssuesGetRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -17851,6 +19697,15 @@ func decodeIssuesGetCommentResponse(resp *http.Response) (res IssuesGetCommentRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -17927,6 +19782,15 @@ func decodeIssuesGetEventResponse(resp *http.Response) (res IssuesGetEventRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -18149,6 +20013,15 @@ func decodeIssuesGetMilestoneResponse(resp *http.Response) (res IssuesGetMilesto } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -18233,6 +20106,32 @@ func decodeIssuesListResponse(resp *http.Response) (res IssuesListRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper IssuesListOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -18346,6 +20245,15 @@ func decodeIssuesListResponse(resp *http.Response) (res IssuesListRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -18395,6 +20303,15 @@ func decodeIssuesListAssigneesResponse(resp *http.Response) (res IssuesListAssig } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper IssuesListAssigneesOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -18519,6 +20436,32 @@ func decodeIssuesListCommentsResponse(resp *http.Response) (res IssuesListCommen } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper IssuesListCommentsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -18678,6 +20621,32 @@ func decodeIssuesListCommentsForRepoResponse(resp *http.Response) (res IssuesLis } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper IssuesListCommentsForRepoOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -18788,6 +20757,15 @@ func decodeIssuesListCommentsForRepoResponse(resp *http.Response) (res IssuesLis } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -18837,6 +20815,32 @@ func decodeIssuesListEventsForRepoResponse(resp *http.Response) (res IssuesListE } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper IssuesListEventsForRepoOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -18912,6 +20916,15 @@ func decodeIssuesListEventsForRepoResponse(resp *http.Response) (res IssuesListE } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -18961,7 +20974,186 @@ func decodeIssuesListForAuthenticatedUserResponse(resp *http.Response) (res Issu } return res, err } - var wrapper IssuesListForAuthenticatedUserOKHeaders + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + var wrapper IssuesListForAuthenticatedUserOKHeaders + wrapper.Response = response + h := uri.NewHeaderDecoder(resp.Header) + // Parse "Link" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "Link", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotLinkVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotLinkVal = c + return nil + }(); err != nil { + return err + } + wrapper.Link.SetTo(wrapperDotLinkVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse Link header") + } + } + return &wrapper, nil + default: + return res, validate.InvalidContentType(ct) + } + case 304: + // Code 304. + return &NotModified{}, nil + case 404: + // Code 404. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response BasicError + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + return res, validate.UnexpectedStatusCode(resp.StatusCode) +} + +func decodeIssuesListForOrgResponse(resp *http.Response) (res IssuesListForOrgRes, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response []Issue + if err := func() error { + response = make([]Issue, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem Issue + if err := elem.Decode(d); err != nil { + return err + } + response = append(response, elem) + return nil + }); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + var wrapper IssuesListForOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) // Parse "Link" header. @@ -19005,9 +21197,6 @@ func decodeIssuesListForAuthenticatedUserResponse(resp *http.Response) (res Issu default: return res, validate.InvalidContentType(ct) } - case 304: - // Code 304. - return &NotModified{}, nil case 404: // Code 404. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) @@ -19047,7 +21236,7 @@ func decodeIssuesListForAuthenticatedUserResponse(resp *http.Response) (res Issu return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeIssuesListForOrgResponse(resp *http.Response) (res IssuesListForOrgRes, _ error) { +func decodeIssuesListForRepoResponse(resp *http.Response) (res IssuesListForRepoRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -19063,11 +21252,11 @@ func decodeIssuesListForOrgResponse(resp *http.Response) (res IssuesListForOrgRe } d := jx.DecodeBytes(buf) - var response []Issue + var response []IssueSimple if err := func() error { - response = make([]Issue, 0) + response = make([]IssueSimple, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem Issue + var elem IssueSimple if err := elem.Decode(d); err != nil { return err } @@ -19088,7 +21277,33 @@ func decodeIssuesListForOrgResponse(resp *http.Response) (res IssuesListForOrgRe } return res, err } - var wrapper IssuesListForOrgOKHeaders + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + var wrapper IssuesListForRepoOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) // Parse "Link" header. @@ -19132,8 +21347,8 @@ func decodeIssuesListForOrgResponse(resp *http.Response) (res IssuesListForOrgRe default: return res, validate.InvalidContentType(ct) } - case 404: - // Code 404. + case 301: + // Code 301. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -19146,7 +21361,7 @@ func decodeIssuesListForOrgResponse(resp *http.Response) (res IssuesListForOrgRe } d := jx.DecodeBytes(buf) - var response BasicError + var response IssuesListForRepoMovedPermanently if err := func() error { if err := response.Decode(d); err != nil { return err @@ -19167,14 +21382,8 @@ func decodeIssuesListForOrgResponse(resp *http.Response) (res IssuesListForOrgRe default: return res, validate.InvalidContentType(ct) } - } - return res, validate.UnexpectedStatusCode(resp.StatusCode) -} - -func decodeIssuesListForRepoResponse(resp *http.Response) (res IssuesListForRepoRes, _ error) { - switch resp.StatusCode { - case 200: - // Code 200. + case 404: + // Code 404. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -19187,17 +21396,9 @@ func decodeIssuesListForRepoResponse(resp *http.Response) (res IssuesListForRepo } d := jx.DecodeBytes(buf) - var response []IssueSimple + var response IssuesListForRepoNotFound if err := func() error { - response = make([]IssueSimple, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem IssueSimple - if err := elem.Decode(d); err != nil { - return err - } - response = append(response, elem) - return nil - }); err != nil { + if err := response.Decode(d); err != nil { return err } if err := d.Skip(); err != io.EOF { @@ -19212,52 +21413,12 @@ func decodeIssuesListForRepoResponse(resp *http.Response) (res IssuesListForRepo } return res, err } - var wrapper IssuesListForRepoOKHeaders - wrapper.Response = response - h := uri.NewHeaderDecoder(resp.Header) - // Parse "Link" header. - { - cfg := uri.HeaderParameterDecodingConfig{ - Name: "Link", - Explode: false, - } - if err := func() error { - if err := h.HasParam(cfg); err == nil { - if err := h.DecodeParam(cfg, func(d uri.Decoder) error { - var wrapperDotLinkVal string - if err := func() error { - val, err := d.DecodeValue() - if err != nil { - return err - } - - c, err := conv.ToString(val) - if err != nil { - return err - } - - wrapperDotLinkVal = c - return nil - }(); err != nil { - return err - } - wrapper.Link.SetTo(wrapperDotLinkVal) - return nil - }); err != nil { - return err - } - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "parse Link header") - } - } - return &wrapper, nil + return &response, nil default: return res, validate.InvalidContentType(ct) } - case 301: - // Code 301. + case 422: + // Code 422. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -19270,7 +21431,7 @@ func decodeIssuesListForRepoResponse(resp *http.Response) (res IssuesListForRepo } d := jx.DecodeBytes(buf) - var response IssuesListForRepoMovedPermanently + var response ValidationError if err := func() error { if err := response.Decode(d); err != nil { return err @@ -19287,47 +21448,27 @@ func decodeIssuesListForRepoResponse(resp *http.Response) (res IssuesListForRepo } return res, err } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - case 404: - // Code 404. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response IssuesListForRepoNotFound + // Validate response. if err := func() error { - if err := response.Decode(d); err != nil { + if err := response.Validate(); err != nil { return err } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } return nil }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err + return res, errors.Wrap(err, "validate") } return &response, nil default: return res, validate.InvalidContentType(ct) } - case 422: - // Code 422. + } + return res, validate.UnexpectedStatusCode(resp.StatusCode) +} + +func decodeIssuesListLabelsForMilestoneResponse(resp *http.Response) (res *IssuesListLabelsForMilestoneOKHeaders, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -19340,9 +21481,17 @@ func decodeIssuesListForRepoResponse(resp *http.Response) (res IssuesListForRepo } d := jx.DecodeBytes(buf) - var response ValidationError + var response []Label if err := func() error { - if err := response.Decode(d); err != nil { + response = make([]Label, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem Label + if err := elem.Decode(d); err != nil { + return err + } + response = append(response, elem) + return nil + }); err != nil { return err } if err := d.Skip(); err != io.EOF { @@ -19357,7 +21506,56 @@ func decodeIssuesListForRepoResponse(resp *http.Response) (res IssuesListForRepo } return res, err } - return &response, nil + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + var wrapper IssuesListLabelsForMilestoneOKHeaders + wrapper.Response = response + h := uri.NewHeaderDecoder(resp.Header) + // Parse "Link" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "Link", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotLinkVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotLinkVal = c + return nil + }(); err != nil { + return err + } + wrapper.Link.SetTo(wrapperDotLinkVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse Link header") + } + } + return &wrapper, nil default: return res, validate.InvalidContentType(ct) } @@ -19365,7 +21563,7 @@ func decodeIssuesListForRepoResponse(resp *http.Response) (res IssuesListForRepo return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeIssuesListLabelsForMilestoneResponse(resp *http.Response) (res *IssuesListLabelsForMilestoneOKHeaders, _ error) { +func decodeIssuesListLabelsForRepoResponse(resp *http.Response) (res IssuesListLabelsForRepoRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -19406,7 +21604,16 @@ func decodeIssuesListLabelsForMilestoneResponse(resp *http.Response) (res *Issue } return res, err } - var wrapper IssuesListLabelsForMilestoneOKHeaders + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + var wrapper IssuesListLabelsForRepoOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) // Parse "Link" header. @@ -19450,11 +21657,46 @@ func decodeIssuesListLabelsForMilestoneResponse(resp *http.Response) (res *Issue default: return res, validate.InvalidContentType(ct) } + case 404: + // Code 404. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response BasicError + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } } return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeIssuesListLabelsForRepoResponse(resp *http.Response) (res IssuesListLabelsForRepoRes, _ error) { +func decodeIssuesListLabelsOnIssueResponse(resp *http.Response) (res IssuesListLabelsOnIssueRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -19495,129 +21737,14 @@ func decodeIssuesListLabelsForRepoResponse(resp *http.Response) (res IssuesListL } return res, err } - var wrapper IssuesListLabelsForRepoOKHeaders - wrapper.Response = response - h := uri.NewHeaderDecoder(resp.Header) - // Parse "Link" header. - { - cfg := uri.HeaderParameterDecodingConfig{ - Name: "Link", - Explode: false, - } - if err := func() error { - if err := h.HasParam(cfg); err == nil { - if err := h.DecodeParam(cfg, func(d uri.Decoder) error { - var wrapperDotLinkVal string - if err := func() error { - val, err := d.DecodeValue() - if err != nil { - return err - } - - c, err := conv.ToString(val) - if err != nil { - return err - } - - wrapperDotLinkVal = c - return nil - }(); err != nil { - return err - } - wrapper.Link.SetTo(wrapperDotLinkVal) - return nil - }); err != nil { - return err - } - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "parse Link header") - } - } - return &wrapper, nil - default: - return res, validate.InvalidContentType(ct) - } - case 404: - // Code 404. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response BasicError + // Validate response. if err := func() error { - if err := response.Decode(d); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") + if response == nil { + return errors.New("nil is invalid value") } return nil }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err - } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - } - return res, validate.UnexpectedStatusCode(resp.StatusCode) -} - -func decodeIssuesListLabelsOnIssueResponse(resp *http.Response) (res IssuesListLabelsOnIssueRes, _ error) { - switch resp.StatusCode { - case 200: - // Code 200. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response []Label - if err := func() error { - response = make([]Label, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem Label - if err := elem.Decode(d); err != nil { - return err - } - response = append(response, elem) - return nil - }); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } - return nil - }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err + return res, errors.Wrap(err, "validate") } var wrapper IssuesListLabelsOnIssueOKHeaders wrapper.Response = response @@ -19743,6 +21870,32 @@ func decodeIssuesListMilestonesResponse(resp *http.Response) (res IssuesListMile } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper IssuesListMilestonesOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -19967,6 +22120,15 @@ func decodeIssuesLockResponse(resp *http.Response) (res IssuesLockRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -20052,6 +22214,15 @@ func decodeIssuesRemoveAssigneesResponse(resp *http.Response) (res *IssueSimple, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -20093,6 +22264,15 @@ func decodeIssuesRemoveLabelResponse(resp *http.Response) (res IssuesRemoveLabel } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -20283,6 +22463,15 @@ func decodeIssuesUpdateResponse(resp *http.Response) (res IssuesUpdateRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -20458,6 +22647,15 @@ func decodeIssuesUpdateResponse(resp *http.Response) (res IssuesUpdateRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -20534,6 +22732,15 @@ func decodeIssuesUpdateCommentResponse(resp *http.Response) (res IssuesUpdateCom } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -20569,6 +22776,15 @@ func decodeIssuesUpdateCommentResponse(resp *http.Response) (res IssuesUpdateCom } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -20651,6 +22867,15 @@ func decodeIssuesUpdateMilestoneResponse(resp *http.Response) (res *Milestone, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -20692,6 +22917,15 @@ func decodeLicensesGetResponse(resp *http.Response) (res LicensesGetRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -20806,6 +23040,15 @@ func decodeLicensesGetAllCommonlyUsedResponse(resp *http.Response) (res Licenses } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -21495,6 +23738,15 @@ func decodeMigrationsGetCommitAuthorsResponse(resp *http.Response) (res Migratio } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -21571,6 +23823,15 @@ func decodeMigrationsGetImportStatusResponse(resp *http.Response) (res Migration } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -21655,6 +23916,15 @@ func decodeMigrationsGetLargeFilesResponse(resp *http.Response) (res []PorterLar } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -21696,6 +23966,15 @@ func decodeMigrationsGetStatusForAuthenticatedUserResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -21845,6 +24124,15 @@ func decodeMigrationsGetStatusForOrgResponse(resp *http.Response) (res Migration } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -21929,6 +24217,32 @@ func decodeMigrationsListForAuthenticatedUserResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper MigrationsListForAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -22091,6 +24405,32 @@ func decodeMigrationsListForOrgResponse(resp *http.Response) (res *MigrationsLis } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper MigrationsListForOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -22180,6 +24520,15 @@ func decodeMigrationsListReposForOrgResponse(resp *http.Response) (res Migration } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper MigrationsListReposForOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -22304,6 +24653,15 @@ func decodeMigrationsListReposForUserResponse(resp *http.Response) (res Migratio } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper MigrationsListReposForUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -22490,6 +24848,15 @@ func decodeMigrationsMapCommitAuthorResponse(resp *http.Response) (res Migration } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -22531,6 +24898,15 @@ func decodeMigrationsSetLfsPreferenceResponse(resp *http.Response) (res Migratio } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -22566,6 +24942,15 @@ func decodeMigrationsSetLfsPreferenceResponse(resp *http.Response) (res Migratio } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -22607,6 +24992,15 @@ func decodeMigrationsStartForAuthenticatedUserResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -22715,6 +25109,15 @@ func decodeMigrationsStartForAuthenticatedUserResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -22756,6 +25159,15 @@ func decodeMigrationsStartForOrgResponse(resp *http.Response) (res MigrationsSta } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -22826,6 +25238,15 @@ func decodeMigrationsStartForOrgResponse(resp *http.Response) (res MigrationsSta } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -22867,6 +25288,15 @@ func decodeMigrationsStartImportResponse(resp *http.Response) (res MigrationsSta } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ImportHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -22977,6 +25407,15 @@ func decodeMigrationsStartImportResponse(resp *http.Response) (res MigrationsSta } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -23179,6 +25618,15 @@ func decodeMigrationsUpdateImportResponse(resp *http.Response) (res *Import, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -23220,6 +25668,15 @@ func decodeOAuthAuthorizationsCreateAuthorizationResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper AuthorizationHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -23403,6 +25860,15 @@ func decodeOAuthAuthorizationsCreateAuthorizationResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -23608,6 +26074,15 @@ func decodeOAuthAuthorizationsGetAuthorizationResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -23722,6 +26197,15 @@ func decodeOAuthAuthorizationsGetGrantResponse(resp *http.Response) (res OAuthAu } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -23836,6 +26320,15 @@ func decodeOAuthAuthorizationsGetOrCreateAuthorizationForAppResponse(resp *http. } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OAuthAuthorizationsGetOrCreateAuthorizationForAppOK wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -23911,6 +26404,15 @@ func decodeOAuthAuthorizationsGetOrCreateAuthorizationForAppResponse(resp *http. } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OAuthAuthorizationsGetOrCreateAuthorizationForAppCreated wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -24059,6 +26561,15 @@ func decodeOAuthAuthorizationsGetOrCreateAuthorizationForAppResponse(resp *http. } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -24100,6 +26611,15 @@ func decodeOAuthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintRespon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OAuthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintOK wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -24175,6 +26695,15 @@ func decodeOAuthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintRespon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OAuthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintCreated wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -24250,6 +26779,15 @@ func decodeOAuthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintRespon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -24299,6 +26837,32 @@ func decodeOAuthAuthorizationsListAuthorizationsResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OAuthAuthorizationsListAuthorizationsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -24496,6 +27060,32 @@ func decodeOAuthAuthorizationsListGrantsResponse(resp *http.Response) (res OAuth } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OAuthAuthorizationsListGrantsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -24685,6 +27275,15 @@ func decodeOAuthAuthorizationsUpdateAuthorizationResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -24720,6 +27319,15 @@ func decodeOAuthAuthorizationsUpdateAuthorizationResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -24764,6 +27372,15 @@ func decodeOrgsBlockUserResponse(resp *http.Response) (res OrgsBlockUserRes, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -24843,6 +27460,15 @@ func decodeOrgsCancelInvitationResponse(resp *http.Response) (res OrgsCancelInvi } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -25146,6 +27772,15 @@ func decodeOrgsCreateInvitationResponse(resp *http.Response) (res OrgsCreateInvi } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -25187,6 +27822,15 @@ func decodeOrgsCreateWebhookResponse(resp *http.Response) (res OrgsCreateWebhook } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OrgHookHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -25297,6 +27941,15 @@ func decodeOrgsCreateWebhookResponse(resp *http.Response) (res OrgsCreateWebhook } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -25349,7 +28002,92 @@ func decodeOrgsDeleteWebhookResponse(resp *http.Response) (res OrgsDeleteWebhook return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeOrgsGetResponse(resp *http.Response) (res OrgsGetRes, _ error) { +func decodeOrgsGetResponse(resp *http.Response) (res OrgsGetRes, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response OrganizationFull + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + case 404: + // Code 404. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response BasicError + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + return res, validate.UnexpectedStatusCode(resp.StatusCode) +} + +func decodeOrgsGetAuditLogResponse(resp *http.Response) (res []AuditLogEvent, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -25365,7 +28103,65 @@ func decodeOrgsGetResponse(resp *http.Response) (res OrgsGetRes, _ error) { } d := jx.DecodeBytes(buf) - var response OrganizationFull + var response []AuditLogEvent + if err := func() error { + response = make([]AuditLogEvent, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem AuditLogEvent + if err := elem.Decode(d); err != nil { + return err + } + response = append(response, elem) + return nil + }); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + return res, validate.UnexpectedStatusCode(resp.StatusCode) +} + +func decodeOrgsGetMembershipForAuthenticatedUserResponse(resp *http.Response) (res OrgsGetMembershipForAuthenticatedUserRes, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response OrgMembership if err := func() error { if err := response.Decode(d); err != nil { return err @@ -25382,12 +28178,21 @@ func decodeOrgsGetResponse(resp *http.Response) (res OrgsGetRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) } - case 404: - // Code 404. + case 403: + // Code 403. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -25400,7 +28205,7 @@ func decodeOrgsGetResponse(resp *http.Response) (res OrgsGetRes, _ error) { } d := jx.DecodeBytes(buf) - var response BasicError + var response OrgsGetMembershipForAuthenticatedUserForbidden if err := func() error { if err := response.Decode(d); err != nil { return err @@ -25421,14 +28226,8 @@ func decodeOrgsGetResponse(resp *http.Response) (res OrgsGetRes, _ error) { default: return res, validate.InvalidContentType(ct) } - } - return res, validate.UnexpectedStatusCode(resp.StatusCode) -} - -func decodeOrgsGetAuditLogResponse(resp *http.Response) (res []AuditLogEvent, _ error) { - switch resp.StatusCode { - case 200: - // Code 200. + case 404: + // Code 404. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -25441,17 +28240,9 @@ func decodeOrgsGetAuditLogResponse(resp *http.Response) (res []AuditLogEvent, _ } d := jx.DecodeBytes(buf) - var response []AuditLogEvent + var response OrgsGetMembershipForAuthenticatedUserNotFound if err := func() error { - response = make([]AuditLogEvent, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem AuditLogEvent - if err := elem.Decode(d); err != nil { - return err - } - response = append(response, elem) - return nil - }); err != nil { + if err := response.Decode(d); err != nil { return err } if err := d.Skip(); err != io.EOF { @@ -25466,7 +28257,7 @@ func decodeOrgsGetAuditLogResponse(resp *http.Response) (res []AuditLogEvent, _ } return res, err } - return response, nil + return &response, nil default: return res, validate.InvalidContentType(ct) } @@ -25474,7 +28265,7 @@ func decodeOrgsGetAuditLogResponse(resp *http.Response) (res []AuditLogEvent, _ return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeOrgsGetMembershipForAuthenticatedUserResponse(resp *http.Response) (res OrgsGetMembershipForAuthenticatedUserRes, _ error) { +func decodeOrgsGetMembershipForUserResponse(resp *http.Response) (res OrgsGetMembershipForUserRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -25507,6 +28298,15 @@ func decodeOrgsGetMembershipForAuthenticatedUserResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -25525,7 +28325,7 @@ func decodeOrgsGetMembershipForAuthenticatedUserResponse(resp *http.Response) (r } d := jx.DecodeBytes(buf) - var response OrgsGetMembershipForAuthenticatedUserForbidden + var response OrgsGetMembershipForUserForbidden if err := func() error { if err := response.Decode(d); err != nil { return err @@ -25560,7 +28360,7 @@ func decodeOrgsGetMembershipForAuthenticatedUserResponse(resp *http.Response) (r } d := jx.DecodeBytes(buf) - var response OrgsGetMembershipForAuthenticatedUserNotFound + var response OrgsGetMembershipForUserNotFound if err := func() error { if err := response.Decode(d); err != nil { return err @@ -25585,7 +28385,7 @@ func decodeOrgsGetMembershipForAuthenticatedUserResponse(resp *http.Response) (r return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeOrgsGetMembershipForUserResponse(resp *http.Response) (res OrgsGetMembershipForUserRes, _ error) { +func decodeOrgsGetWebhookResponse(resp *http.Response) (res OrgsGetWebhookRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -25601,7 +28401,7 @@ func decodeOrgsGetMembershipForUserResponse(resp *http.Response) (res OrgsGetMem } d := jx.DecodeBytes(buf) - var response OrgMembership + var response OrgHook if err := func() error { if err := response.Decode(d); err != nil { return err @@ -25618,12 +28418,21 @@ func decodeOrgsGetMembershipForUserResponse(resp *http.Response) (res OrgsGetMem } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) } - case 403: - // Code 403. + case 404: + // Code 404. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -25636,7 +28445,7 @@ func decodeOrgsGetMembershipForUserResponse(resp *http.Response) (res OrgsGetMem } d := jx.DecodeBytes(buf) - var response OrgsGetMembershipForUserForbidden + var response BasicError if err := func() error { if err := response.Decode(d); err != nil { return err @@ -25657,8 +28466,14 @@ func decodeOrgsGetMembershipForUserResponse(resp *http.Response) (res OrgsGetMem default: return res, validate.InvalidContentType(ct) } - case 404: - // Code 404. + } + return res, validate.UnexpectedStatusCode(resp.StatusCode) +} + +func decodeOrgsGetWebhookConfigForOrgResponse(resp *http.Response) (res *WebhookConfig, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -25671,7 +28486,7 @@ func decodeOrgsGetMembershipForUserResponse(resp *http.Response) (res OrgsGetMem } d := jx.DecodeBytes(buf) - var response OrgsGetMembershipForUserNotFound + var response WebhookConfig if err := func() error { if err := response.Decode(d); err != nil { return err @@ -25688,6 +28503,15 @@ func decodeOrgsGetMembershipForUserResponse(resp *http.Response) (res OrgsGetMem } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -25696,7 +28520,7 @@ func decodeOrgsGetMembershipForUserResponse(resp *http.Response) (res OrgsGetMem return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeOrgsGetWebhookResponse(resp *http.Response) (res OrgsGetWebhookRes, _ error) { +func decodeOrgsGetWebhookDeliveryResponse(resp *http.Response) (res OrgsGetWebhookDeliveryRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -25712,7 +28536,7 @@ func decodeOrgsGetWebhookResponse(resp *http.Response) (res OrgsGetWebhookRes, _ } d := jx.DecodeBytes(buf) - var response OrgHook + var response HookDelivery if err := func() error { if err := response.Decode(d); err != nil { return err @@ -25729,12 +28553,21 @@ func decodeOrgsGetWebhookResponse(resp *http.Response) (res OrgsGetWebhookRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) } - case 404: - // Code 404. + case 400: + // Code 400. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -25768,14 +28601,8 @@ func decodeOrgsGetWebhookResponse(resp *http.Response) (res OrgsGetWebhookRes, _ default: return res, validate.InvalidContentType(ct) } - } - return res, validate.UnexpectedStatusCode(resp.StatusCode) -} - -func decodeOrgsGetWebhookConfigForOrgResponse(resp *http.Response) (res *WebhookConfig, _ error) { - switch resp.StatusCode { - case 200: - // Code 200. + case 422: + // Code 422. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -25788,7 +28615,7 @@ func decodeOrgsGetWebhookConfigForOrgResponse(resp *http.Response) (res *Webhook } d := jx.DecodeBytes(buf) - var response WebhookConfig + var response ValidationError if err := func() error { if err := response.Decode(d); err != nil { return err @@ -25805,6 +28632,15 @@ func decodeOrgsGetWebhookConfigForOrgResponse(resp *http.Response) (res *Webhook } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -25813,7 +28649,7 @@ func decodeOrgsGetWebhookConfigForOrgResponse(resp *http.Response) (res *Webhook return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeOrgsGetWebhookDeliveryResponse(resp *http.Response) (res OrgsGetWebhookDeliveryRes, _ error) { +func decodeOrgsListResponse(resp *http.Response) (res OrgsListRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -25829,9 +28665,17 @@ func decodeOrgsGetWebhookDeliveryResponse(resp *http.Response) (res OrgsGetWebho } d := jx.DecodeBytes(buf) - var response HookDelivery + var response []OrganizationSimple if err := func() error { - if err := response.Decode(d); err != nil { + response = make([]OrganizationSimple, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem OrganizationSimple + if err := elem.Decode(d); err != nil { + return err + } + response = append(response, elem) + return nil + }); err != nil { return err } if err := d.Skip(); err != io.EOF { @@ -25846,12 +28690,70 @@ func decodeOrgsGetWebhookDeliveryResponse(resp *http.Response) (res OrgsGetWebho } return res, err } - return &response, nil + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + var wrapper OrgsListOKHeaders + wrapper.Response = response + h := uri.NewHeaderDecoder(resp.Header) + // Parse "Link" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "Link", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotLinkVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotLinkVal = c + return nil + }(); err != nil { + return err + } + wrapper.Link.SetTo(wrapperDotLinkVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse Link header") + } + } + return &wrapper, nil default: return res, validate.InvalidContentType(ct) } - case 400: - // Code 400. + case 304: + // Code 304. + return &NotModified{}, nil + } + return res, validate.UnexpectedStatusCode(resp.StatusCode) +} + +func decodeOrgsListBlockedUsersResponse(resp *http.Response) (res OrgsListBlockedUsersRes, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -25864,7 +28766,7 @@ func decodeOrgsGetWebhookDeliveryResponse(resp *http.Response) (res OrgsGetWebho } d := jx.DecodeBytes(buf) - var response BasicError + var response OrgsListBlockedUsersOKApplicationJSON if err := func() error { if err := response.Decode(d); err != nil { return err @@ -25881,12 +28783,21 @@ func decodeOrgsGetWebhookDeliveryResponse(resp *http.Response) (res OrgsGetWebho } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) } - case 422: - // Code 422. + case 415: + // Code 415. ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) if err != nil { return res, errors.Wrap(err, "parse media type") @@ -25899,7 +28810,7 @@ func decodeOrgsGetWebhookDeliveryResponse(resp *http.Response) (res OrgsGetWebho } d := jx.DecodeBytes(buf) - var response ValidationError + var response PreviewHeaderMissing if err := func() error { if err := response.Decode(d); err != nil { return err @@ -25924,7 +28835,7 @@ func decodeOrgsGetWebhookDeliveryResponse(resp *http.Response) (res OrgsGetWebho return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeOrgsListResponse(resp *http.Response) (res OrgsListRes, _ error) { +func decodeOrgsListFailedInvitationsResponse(resp *http.Response) (res OrgsListFailedInvitationsRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -25940,11 +28851,11 @@ func decodeOrgsListResponse(resp *http.Response) (res OrgsListRes, _ error) { } d := jx.DecodeBytes(buf) - var response []OrganizationSimple + var response []OrganizationInvitation if err := func() error { - response = make([]OrganizationSimple, 0) + response = make([]OrganizationInvitation, 0) if err := d.Arr(func(d *jx.Decoder) error { - var elem OrganizationSimple + var elem OrganizationInvitation if err := elem.Decode(d); err != nil { return err } @@ -25965,173 +28876,14 @@ func decodeOrgsListResponse(resp *http.Response) (res OrgsListRes, _ error) { } return res, err } - var wrapper OrgsListOKHeaders - wrapper.Response = response - h := uri.NewHeaderDecoder(resp.Header) - // Parse "Link" header. - { - cfg := uri.HeaderParameterDecodingConfig{ - Name: "Link", - Explode: false, - } - if err := func() error { - if err := h.HasParam(cfg); err == nil { - if err := h.DecodeParam(cfg, func(d uri.Decoder) error { - var wrapperDotLinkVal string - if err := func() error { - val, err := d.DecodeValue() - if err != nil { - return err - } - - c, err := conv.ToString(val) - if err != nil { - return err - } - - wrapperDotLinkVal = c - return nil - }(); err != nil { - return err - } - wrapper.Link.SetTo(wrapperDotLinkVal) - return nil - }); err != nil { - return err - } - } - return nil - }(); err != nil { - return res, errors.Wrap(err, "parse Link header") - } - } - return &wrapper, nil - default: - return res, validate.InvalidContentType(ct) - } - case 304: - // Code 304. - return &NotModified{}, nil - } - return res, validate.UnexpectedStatusCode(resp.StatusCode) -} - -func decodeOrgsListBlockedUsersResponse(resp *http.Response) (res OrgsListBlockedUsersRes, _ error) { - switch resp.StatusCode { - case 200: - // Code 200. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response OrgsListBlockedUsersOKApplicationJSON - if err := func() error { - if err := response.Decode(d); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } - return nil - }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err - } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - case 415: - // Code 415. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response PreviewHeaderMissing + // Validate response. if err := func() error { - if err := response.Decode(d); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") + if response == nil { + return errors.New("nil is invalid value") } return nil }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err - } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - } - return res, validate.UnexpectedStatusCode(resp.StatusCode) -} - -func decodeOrgsListFailedInvitationsResponse(resp *http.Response) (res OrgsListFailedInvitationsRes, _ error) { - switch resp.StatusCode { - case 200: - // Code 200. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response []OrganizationInvitation - if err := func() error { - response = make([]OrganizationInvitation, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem OrganizationInvitation - if err := elem.Decode(d); err != nil { - return err - } - response = append(response, elem) - return nil - }); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } - return nil - }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err + return res, errors.Wrap(err, "validate") } var wrapper OrgsListFailedInvitationsOKHeaders wrapper.Response = response @@ -26257,6 +29009,15 @@ func decodeOrgsListForAuthenticatedUserResponse(resp *http.Response) (res OrgsLi } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OrgsListForAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -26419,6 +29180,15 @@ func decodeOrgsListForUserResponse(resp *http.Response) (res *OrgsListForUserOKH } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OrgsListForUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -26508,6 +29278,15 @@ func decodeOrgsListInvitationTeamsResponse(resp *http.Response) (res OrgsListInv } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OrgsListInvitationTeamsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -26632,6 +29411,15 @@ func decodeOrgsListMembersResponse(resp *http.Response) (res OrgsListMembersRes, } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OrgsListMembersOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -26749,6 +29537,15 @@ func decodeOrgsListMembersResponse(resp *http.Response) (res OrgsListMembersRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -26798,6 +29595,32 @@ func decodeOrgsListMembershipsForAuthenticatedUserResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OrgsListMembershipsForAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -26946,6 +29769,15 @@ func decodeOrgsListMembershipsForAuthenticatedUserResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -26995,6 +29827,15 @@ func decodeOrgsListOutsideCollaboratorsResponse(resp *http.Response) (res *OrgsL } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OrgsListOutsideCollaboratorsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -27084,6 +29925,15 @@ func decodeOrgsListPendingInvitationsResponse(resp *http.Response) (res OrgsList } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OrgsListPendingInvitationsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -27208,6 +30058,15 @@ func decodeOrgsListPublicMembersResponse(resp *http.Response) (res *OrgsListPubl } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OrgsListPublicMembersOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -27297,6 +30156,15 @@ func decodeOrgsListSamlSSOAuthorizationsResponse(resp *http.Response) (res []Cre } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -27338,6 +30206,15 @@ func decodeOrgsListWebhookDeliveriesResponse(resp *http.Response) (res OrgsListW } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -27408,6 +30285,15 @@ func decodeOrgsListWebhookDeliveriesResponse(resp *http.Response) (res OrgsListW } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -27457,6 +30343,32 @@ func decodeOrgsListWebhooksResponse(resp *http.Response) (res OrgsListWebhooksRe } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper OrgsListWebhooksOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -27687,6 +30599,15 @@ func decodeOrgsRedeliverWebhookDeliveryResponse(resp *http.Response) (res OrgsRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -27948,6 +30869,15 @@ func decodeOrgsSetMembershipForUserResponse(resp *http.Response) (res OrgsSetMem } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -28018,6 +30948,15 @@ func decodeOrgsSetMembershipForUserResponse(resp *http.Response) (res OrgsSetMem } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -28112,6 +31051,15 @@ func decodeOrgsUpdateMembershipForAuthenticatedUserResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -28217,6 +31165,15 @@ func decodeOrgsUpdateMembershipForAuthenticatedUserResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -28258,6 +31215,15 @@ func decodeOrgsUpdateWebhookResponse(resp *http.Response) (res OrgsUpdateWebhook } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -28328,6 +31294,15 @@ func decodeOrgsUpdateWebhookResponse(resp *http.Response) (res OrgsUpdateWebhook } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -28369,6 +31344,15 @@ func decodeOrgsUpdateWebhookConfigForOrgResponse(resp *http.Response) (res *Webh } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -29094,6 +32078,15 @@ func decodePackagesGetAllPackageVersionsForPackageOwnedByAuthenticatedUserRespon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -29240,6 +32233,15 @@ func decodePackagesGetAllPackageVersionsForPackageOwnedByOrgResponse(resp *http. } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -29386,6 +32388,15 @@ func decodePackagesGetAllPackageVersionsForPackageOwnedByUserResponse(resp *http } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -29532,6 +32543,15 @@ func decodePackagesGetPackageForAuthenticatedUserResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -29573,6 +32593,15 @@ func decodePackagesGetPackageForOrganizationResponse(resp *http.Response) (res * } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -29614,6 +32643,15 @@ func decodePackagesGetPackageForUserResponse(resp *http.Response) (res *Package, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -29655,6 +32693,15 @@ func decodePackagesGetPackageVersionForAuthenticatedUserResponse(resp *http.Resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -29696,6 +32743,15 @@ func decodePackagesGetPackageVersionForOrganizationResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -29737,6 +32793,15 @@ func decodePackagesGetPackageVersionForUserResponse(resp *http.Response) (res *P } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -29786,6 +32851,32 @@ func decodePackagesListPackagesForAuthenticatedUserResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29827,6 +32918,15 @@ func decodePackagesListPackagesForOrganizationResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -29938,6 +33038,15 @@ func decodePackagesListPackagesForUserResponse(resp *http.Response) (res Package } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -30844,6 +33953,15 @@ func decodeProjectsAddCollaboratorResponse(resp *http.Response) (res ProjectsAdd } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -31034,6 +34152,15 @@ func decodeProjectsCreateForAuthenticatedUserResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -31218,6 +34345,15 @@ func decodeProjectsCreateForOrgResponse(resp *http.Response) (res ProjectsCreate } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -31434,6 +34570,15 @@ func decodeProjectsCreateForRepoResponse(resp *http.Response) (res ProjectsCreat } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -32001,6 +35146,15 @@ func decodeProjectsGetResponse(resp *http.Response) (res ProjectsGetRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -32556,6 +35710,15 @@ func decodeProjectsGetPermissionForUserResponse(resp *http.Response) (res Projec } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -32605,6 +35768,15 @@ func decodeProjectsListCardsResponse(resp *http.Response) (res ProjectsListCards } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ProjectsListCardsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -32767,6 +35939,15 @@ func decodeProjectsListCollaboratorsResponse(resp *http.Response) (res ProjectsL } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ProjectsListCollaboratorsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -32950,6 +36131,15 @@ func decodeProjectsListCollaboratorsResponse(resp *http.Response) (res ProjectsL } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -32999,6 +36189,15 @@ func decodeProjectsListColumnsResponse(resp *http.Response) (res ProjectsListCol } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ProjectsListColumnsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -33161,6 +36360,32 @@ func decodeProjectsListForOrgResponse(resp *http.Response) (res ProjectsListForO } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ProjectsListForOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -33285,6 +36510,32 @@ func decodeProjectsListForRepoResponse(resp *http.Response) (res ProjectsListFor } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ProjectsListForRepoOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -33549,6 +36800,32 @@ func decodeProjectsListForUserResponse(resp *http.Response) (res ProjectsListFor } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ProjectsListForUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -33624,6 +36901,15 @@ func decodeProjectsListForUserResponse(resp *http.Response) (res ProjectsListFor } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -33773,6 +37059,15 @@ func decodeProjectsMoveCardResponse(resp *http.Response) (res ProjectsMoveCardRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -34109,6 +37404,15 @@ func decodeProjectsRemoveCollaboratorResponse(resp *http.Response) (res Projects } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -34150,6 +37454,15 @@ func decodeProjectsUpdateResponse(resp *http.Response) (res ProjectsUpdateRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -34647,6 +37960,15 @@ func decodePullsCreateResponse(resp *http.Response) (res PullsCreateRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PullRequestHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -34757,6 +38079,15 @@ func decodePullsCreateResponse(resp *http.Response) (res PullsCreateRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -34798,6 +38129,15 @@ func decodePullsCreateReplyForReviewCommentResponse(resp *http.Response) (res Pu } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PullRequestReviewCommentHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -34914,6 +38254,15 @@ func decodePullsCreateReviewResponse(resp *http.Response) (res PullsCreateReview } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -35025,6 +38374,15 @@ func decodePullsCreateReviewCommentResponse(resp *http.Response) (res PullsCreat } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PullRequestReviewCommentHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -35135,6 +38493,15 @@ func decodePullsCreateReviewCommentResponse(resp *http.Response) (res PullsCreat } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -35176,6 +38543,15 @@ func decodePullsDeletePendingReviewResponse(resp *http.Response) (res PullsDelet } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -35331,6 +38707,15 @@ func decodePullsDismissReviewResponse(resp *http.Response) (res PullsDismissRevi } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -35442,6 +38827,15 @@ func decodePullsGetResponse(resp *http.Response) (res PullsGetRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -35556,6 +38950,15 @@ func decodePullsGetReviewResponse(resp *http.Response) (res PullsGetReviewRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -35632,6 +39035,15 @@ func decodePullsGetReviewCommentResponse(resp *http.Response) (res PullsGetRevie } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -35716,6 +39128,32 @@ func decodePullsListResponse(resp *http.Response) (res PullsListRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PullsListOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -35794,6 +39232,15 @@ func decodePullsListResponse(resp *http.Response) (res PullsListRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -35843,6 +39290,32 @@ func decodePullsListCommentsForReviewResponse(resp *http.Response) (res PullsLis } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PullsListCommentsForReviewOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -35967,6 +39440,32 @@ func decodePullsListCommitsResponse(resp *http.Response) (res *PullsListCommitsO } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PullsListCommitsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -36056,6 +39555,32 @@ func decodePullsListFilesResponse(resp *http.Response) (res PullsListFilesRes, _ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PullsListFilesOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -36131,6 +39656,15 @@ func decodePullsListFilesResponse(resp *http.Response) (res PullsListFilesRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -36207,6 +39741,15 @@ func decodePullsListRequestedReviewersResponse(resp *http.Response) (res *PullRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PullRequestReviewRequestHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -36296,6 +39839,32 @@ func decodePullsListReviewCommentsResponse(resp *http.Response) (res *PullsListR } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PullsListReviewCommentsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -36385,6 +39954,32 @@ func decodePullsListReviewCommentsForRepoResponse(resp *http.Response) (res *Pul } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PullsListReviewCommentsForRepoOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -36474,6 +40069,32 @@ func decodePullsListReviewsResponse(resp *http.Response) (res *PullsListReviewsO } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PullsListReviewsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -36730,6 +40351,15 @@ func decodePullsMergeResponse(resp *http.Response) (res PullsMergeRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -36771,6 +40401,15 @@ func decodePullsRemoveRequestedReviewersResponse(resp *http.Response) (res Pulls } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -36806,6 +40445,15 @@ func decodePullsRemoveRequestedReviewersResponse(resp *http.Response) (res Pulls } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -36847,6 +40495,15 @@ func decodePullsSubmitReviewResponse(resp *http.Response) (res PullsSubmitReview } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -36993,6 +40650,15 @@ func decodePullsUpdateResponse(resp *http.Response) (res PullsUpdateRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37063,6 +40729,15 @@ func decodePullsUpdateResponse(resp *http.Response) (res PullsUpdateRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37174,6 +40849,15 @@ func decodePullsUpdateBranchResponse(resp *http.Response) (res PullsUpdateBranch } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37215,6 +40899,15 @@ func decodePullsUpdateReviewResponse(resp *http.Response) (res PullsUpdateReview } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37291,6 +40984,15 @@ func decodePullsUpdateReviewCommentResponse(resp *http.Response) (res *PullReque } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37525,6 +41227,15 @@ func decodeReactionsCreateForCommitCommentResponse(resp *http.Response) (res Rea } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37560,6 +41271,15 @@ func decodeReactionsCreateForCommitCommentResponse(resp *http.Response) (res Rea } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37630,6 +41350,15 @@ func decodeReactionsCreateForCommitCommentResponse(resp *http.Response) (res Rea } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37671,6 +41400,15 @@ func decodeReactionsCreateForIssueResponse(resp *http.Response) (res ReactionsCr } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37706,6 +41444,15 @@ func decodeReactionsCreateForIssueResponse(resp *http.Response) (res ReactionsCr } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37776,6 +41523,15 @@ func decodeReactionsCreateForIssueResponse(resp *http.Response) (res ReactionsCr } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37817,6 +41573,15 @@ func decodeReactionsCreateForIssueCommentResponse(resp *http.Response) (res Reac } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37852,6 +41617,15 @@ func decodeReactionsCreateForIssueCommentResponse(resp *http.Response) (res Reac } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37922,6 +41696,15 @@ func decodeReactionsCreateForIssueCommentResponse(resp *http.Response) (res Reac } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37963,6 +41746,15 @@ func decodeReactionsCreateForPullRequestReviewCommentResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -37998,6 +41790,15 @@ func decodeReactionsCreateForPullRequestReviewCommentResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -38068,6 +41869,15 @@ func decodeReactionsCreateForPullRequestReviewCommentResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -38109,6 +41919,15 @@ func decodeReactionsCreateForReleaseResponse(resp *http.Response) (res Reactions } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -38144,6 +41963,15 @@ func decodeReactionsCreateForReleaseResponse(resp *http.Response) (res Reactions } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -38214,6 +42042,15 @@ func decodeReactionsCreateForReleaseResponse(resp *http.Response) (res Reactions } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -38255,6 +42092,15 @@ func decodeReactionsCreateForTeamDiscussionCommentInOrgResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -38290,6 +42136,15 @@ func decodeReactionsCreateForTeamDiscussionCommentInOrgResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -38331,6 +42186,15 @@ func decodeReactionsCreateForTeamDiscussionCommentLegacyResponse(resp *http.Resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -38372,6 +42236,15 @@ func decodeReactionsCreateForTeamDiscussionInOrgResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -38407,6 +42280,15 @@ func decodeReactionsCreateForTeamDiscussionInOrgResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -38448,6 +42330,15 @@ func decodeReactionsCreateForTeamDiscussionLegacyResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -38703,6 +42594,32 @@ func decodeReactionsListForCommitCommentResponse(resp *http.Response) (res React } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReactionsListForCommitCommentOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -38862,6 +42779,32 @@ func decodeReactionsListForIssueResponse(resp *http.Response) (res ReactionsList } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReactionsListForIssueOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -39015,7 +42958,192 @@ func decodeReactionsListForIssueResponse(resp *http.Response) (res ReactionsList return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeReactionsListForIssueCommentResponse(resp *http.Response) (res ReactionsListForIssueCommentRes, _ error) { +func decodeReactionsListForIssueCommentResponse(resp *http.Response) (res ReactionsListForIssueCommentRes, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response []Reaction + if err := func() error { + response = make([]Reaction, 0) + if err := d.Arr(func(d *jx.Decoder) error { + var elem Reaction + if err := elem.Decode(d); err != nil { + return err + } + response = append(response, elem) + return nil + }); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + var wrapper ReactionsListForIssueCommentOKHeaders + wrapper.Response = response + h := uri.NewHeaderDecoder(resp.Header) + // Parse "Link" header. + { + cfg := uri.HeaderParameterDecodingConfig{ + Name: "Link", + Explode: false, + } + if err := func() error { + if err := h.HasParam(cfg); err == nil { + if err := h.DecodeParam(cfg, func(d uri.Decoder) error { + var wrapperDotLinkVal string + if err := func() error { + val, err := d.DecodeValue() + if err != nil { + return err + } + + c, err := conv.ToString(val) + if err != nil { + return err + } + + wrapperDotLinkVal = c + return nil + }(); err != nil { + return err + } + wrapper.Link.SetTo(wrapperDotLinkVal) + return nil + }); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "parse Link header") + } + } + return &wrapper, nil + default: + return res, validate.InvalidContentType(ct) + } + case 404: + // Code 404. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response BasicError + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + case 415: + // Code 415. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response PreviewHeaderMissing + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + return res, validate.UnexpectedStatusCode(resp.StatusCode) +} + +func decodeReactionsListForPullRequestReviewCommentResponse(resp *http.Response) (res ReactionsListForPullRequestReviewCommentRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -39056,164 +43184,31 @@ func decodeReactionsListForIssueCommentResponse(resp *http.Response) (res Reacti } return res, err } - var wrapper ReactionsListForIssueCommentOKHeaders - wrapper.Response = response - h := uri.NewHeaderDecoder(resp.Header) - // Parse "Link" header. - { - cfg := uri.HeaderParameterDecodingConfig{ - Name: "Link", - Explode: false, + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") } - if err := func() error { - if err := h.HasParam(cfg); err == nil { - if err := h.DecodeParam(cfg, func(d uri.Decoder) error { - var wrapperDotLinkVal string - if err := func() error { - val, err := d.DecodeValue() - if err != nil { - return err - } - - c, err := conv.ToString(val) - if err != nil { - return err - } - - wrapperDotLinkVal = c - return nil - }(); err != nil { - return err - } - wrapper.Link.SetTo(wrapperDotLinkVal) - return nil - }); err != nil { + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { return err } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) } - return nil - }(); err != nil { - return res, errors.Wrap(err, "parse Link header") - } - } - return &wrapper, nil - default: - return res, validate.InvalidContentType(ct) - } - case 404: - // Code 404. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response BasicError - if err := func() error { - if err := response.Decode(d); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } - return nil - }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err - } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - case 415: - // Code 415. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response PreviewHeaderMissing - if err := func() error { - if err := response.Decode(d); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } - return nil - }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err - } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - } - return res, validate.UnexpectedStatusCode(resp.StatusCode) -} - -func decodeReactionsListForPullRequestReviewCommentResponse(resp *http.Response) (res ReactionsListForPullRequestReviewCommentRes, _ error) { - switch resp.StatusCode { - case 200: - // Code 200. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response []Reaction - if err := func() error { - response = make([]Reaction, 0) - if err := d.Arr(func(d *jx.Decoder) error { - var elem Reaction - if err := elem.Decode(d); err != nil { - return err - } - response = append(response, elem) - return nil - }); err != nil { - return err } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") + if len(failures) > 0 { + return &validate.Error{Fields: failures} } return nil }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err + return res, errors.Wrap(err, "validate") } var wrapper ReactionsListForPullRequestReviewCommentOKHeaders wrapper.Response = response @@ -39374,6 +43369,32 @@ func decodeReactionsListForTeamDiscussionCommentInOrgResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReactionsListForTeamDiscussionCommentInOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -39463,6 +43484,32 @@ func decodeReactionsListForTeamDiscussionCommentLegacyResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReactionsListForTeamDiscussionCommentLegacyOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -39552,6 +43599,32 @@ func decodeReactionsListForTeamDiscussionInOrgResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReactionsListForTeamDiscussionInOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -39641,6 +43714,32 @@ func decodeReactionsListForTeamDiscussionLegacyResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReactionsListForTeamDiscussionLegacyOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -39839,6 +43938,15 @@ func decodeReposAddAppAccessRestrictionsResponse(resp *http.Response) (res Repos } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -39874,6 +43982,15 @@ func decodeReposAddAppAccessRestrictionsResponse(resp *http.Response) (res Repos } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -39915,6 +44032,15 @@ func decodeReposAddCollaboratorResponse(resp *http.Response) (res ReposAddCollab } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -39988,6 +44114,15 @@ func decodeReposAddCollaboratorResponse(resp *http.Response) (res ReposAddCollab } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -40029,6 +44164,15 @@ func decodeReposAddStatusCheckContextsResponse(resp *http.Response) (res ReposAd } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -40134,6 +44278,15 @@ func decodeReposAddStatusCheckContextsResponse(resp *http.Response) (res ReposAd } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -40175,6 +44328,15 @@ func decodeReposAddTeamAccessRestrictionsResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -40210,6 +44372,15 @@ func decodeReposAddTeamAccessRestrictionsResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -40251,6 +44422,15 @@ func decodeReposAddUserAccessRestrictionsResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -40286,6 +44466,15 @@ func decodeReposAddUserAccessRestrictionsResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -40351,6 +44540,15 @@ func decodeReposCompareCommitsResponse(resp *http.Response) (res ReposCompareCom } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -40537,6 +44735,15 @@ func decodeReposCreateAutolinkResponse(resp *http.Response) (res ReposCreateAuto } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -40578,6 +44785,15 @@ func decodeReposCreateCommitCommentResponse(resp *http.Response) (res ReposCreat } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper CommitCommentHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -40688,6 +44904,15 @@ func decodeReposCreateCommitCommentResponse(resp *http.Response) (res ReposCreat } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -40961,6 +45186,15 @@ func decodeReposCreateDeployKeyResponse(resp *http.Response) (res ReposCreateDep } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -41002,6 +45236,15 @@ func decodeReposCreateDeploymentResponse(resp *http.Response) (res ReposCreateDe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -41075,6 +45318,15 @@ func decodeReposCreateDeploymentResponse(resp *http.Response) (res ReposCreateDe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -41116,6 +45368,15 @@ func decodeReposCreateDeploymentStatusResponse(resp *http.Response) (res ReposCr } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper DeploymentStatusHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -41191,6 +45452,15 @@ func decodeReposCreateDeploymentStatusResponse(resp *http.Response) (res ReposCr } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -41235,6 +45505,15 @@ func decodeReposCreateDispatchEventResponse(resp *http.Response) (res ReposCreat } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -41494,6 +45773,15 @@ func decodeReposCreateForAuthenticatedUserResponse(resp *http.Response) (res Rep } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -41535,6 +45823,15 @@ func decodeReposCreateForkResponse(resp *http.Response) (res ReposCreateForkRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -41675,6 +45972,15 @@ func decodeReposCreateForkResponse(resp *http.Response) (res ReposCreateForkRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -41826,6 +46132,15 @@ func decodeReposCreateInOrgResponse(resp *http.Response) (res ReposCreateInOrgRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -42007,6 +46322,15 @@ func decodeReposCreateOrUpdateFileContentsResponse(resp *http.Response) (res Rep } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -42048,6 +46372,15 @@ func decodeReposCreatePagesSiteResponse(resp *http.Response) (res ReposCreatePag } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -42153,6 +46486,15 @@ func decodeReposCreatePagesSiteResponse(resp *http.Response) (res ReposCreatePag } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -42194,6 +46536,15 @@ func decodeReposCreateReleaseResponse(resp *http.Response) (res ReposCreateRelea } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReleaseHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -42304,6 +46655,15 @@ func decodeReposCreateReleaseResponse(resp *http.Response) (res ReposCreateRelea } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -42426,6 +46786,15 @@ func decodeReposCreateWebhookResponse(resp *http.Response) (res ReposCreateWebho } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper HookHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -42571,6 +46940,15 @@ func decodeReposCreateWebhookResponse(resp *http.Response) (res ReposCreateWebho } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -43274,6 +47652,15 @@ func decodeReposDeleteFileResponse(resp *http.Response) (res ReposDeleteFileRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -43432,6 +47819,15 @@ func decodeReposDeletePagesSiteResponse(resp *http.Response) (res ReposDeletePag } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -43764,6 +48160,15 @@ func decodeReposGetResponse(resp *http.Response) (res ReposGetRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -43910,6 +48315,15 @@ func decodeReposGetAccessRestrictionsResponse(resp *http.Response) (res ReposGet } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -44027,6 +48441,15 @@ func decodeReposGetAllStatusCheckContextsResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -44103,6 +48526,15 @@ func decodeReposGetAllTopicsResponse(resp *http.Response) (res ReposGetAllTopics } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -44214,6 +48646,15 @@ func decodeReposGetAppsWithAccessToProtectedBranchResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -44366,6 +48807,15 @@ func decodeReposGetBranchResponse(resp *http.Response) (res ReposGetBranchRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -44512,6 +48962,15 @@ func decodeReposGetBranchProtectionResponse(resp *http.Response) (res ReposGetBr } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -44555,7 +49014,92 @@ func decodeReposGetBranchProtectionResponse(resp *http.Response) (res ReposGetBr return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeReposGetClonesResponse(resp *http.Response) (res ReposGetClonesRes, _ error) { +func decodeReposGetClonesResponse(resp *http.Response) (res ReposGetClonesRes, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response CloneTraffic + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + case 403: + // Code 403. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response BasicError + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + return res, validate.UnexpectedStatusCode(resp.StatusCode) +} + +func decodeReposGetCodeFrequencyStatsResponse(resp *http.Response) (res ReposGetCodeFrequencyStatsRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -44571,7 +49115,7 @@ func decodeReposGetClonesResponse(resp *http.Response) (res ReposGetClonesRes, _ } d := jx.DecodeBytes(buf) - var response CloneTraffic + var response ReposGetCodeFrequencyStatsOKApplicationJSON if err := func() error { if err := response.Decode(d); err != nil { return err @@ -44588,81 +49132,14 @@ func decodeReposGetClonesResponse(resp *http.Response) (res ReposGetClonesRes, _ } return res, err } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - case 403: - // Code 403. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response BasicError + // Validate response. if err := func() error { - if err := response.Decode(d); err != nil { + if err := response.Validate(); err != nil { return err } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } return nil }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err - } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - } - return res, validate.UnexpectedStatusCode(resp.StatusCode) -} - -func decodeReposGetCodeFrequencyStatsResponse(resp *http.Response) (res ReposGetCodeFrequencyStatsRes, _ error) { - switch resp.StatusCode { - case 200: - // Code 200. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response ReposGetCodeFrequencyStatsOKApplicationJSON - if err := func() error { - if err := response.Decode(d); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } - return nil - }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err + return res, errors.Wrap(err, "validate") } return &response, nil default: @@ -44819,6 +49296,15 @@ func decodeReposGetCombinedStatusForRefResponse(resp *http.Response) (res ReposG } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -44895,6 +49381,15 @@ func decodeReposGetCommitResponse(resp *http.Response) (res ReposGetCommitRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -44965,6 +49460,15 @@ func decodeReposGetCommitResponse(resp *http.Response) (res ReposGetCommitRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -45041,6 +49545,15 @@ func decodeReposGetCommitActivityStatsResponse(resp *http.Response) (res ReposGe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -45120,6 +49633,15 @@ func decodeReposGetCommitCommentResponse(resp *http.Response) (res ReposGetCommi } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -45313,6 +49835,15 @@ func decodeReposGetContributorsStatsResponse(resp *http.Response) (res ReposGetC } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -45468,6 +49999,15 @@ func decodeReposGetDeploymentResponse(resp *http.Response) (res ReposGetDeployme } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -45544,6 +50084,15 @@ func decodeReposGetDeploymentStatusResponse(resp *http.Response) (res ReposGetDe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -45696,6 +50245,15 @@ func decodeReposGetLatestReleaseResponse(resp *http.Response) (res *Release, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -45737,6 +50295,15 @@ func decodeReposGetPagesResponse(resp *http.Response) (res ReposGetPagesRes, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -45971,6 +50538,15 @@ func decodeReposGetParticipationStatsResponse(resp *http.Response) (res ReposGet } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -46047,6 +50623,15 @@ func decodeReposGetPullRequestReviewProtectionResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -46088,6 +50673,15 @@ func decodeReposGetPunchCardStatsResponse(resp *http.Response) (res ReposGetPunc } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -46202,6 +50796,15 @@ func decodeReposGetReadmeResponse(resp *http.Response) (res ReposGetReadmeRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -46313,6 +50916,15 @@ func decodeReposGetReadmeInDirectoryResponse(resp *http.Response) (res ReposGetR } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -46354,6 +50966,15 @@ func decodeReposGetReleaseResponse(resp *http.Response) (res ReposGetReleaseRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -46430,6 +51051,15 @@ func decodeReposGetReleaseAssetResponse(resp *http.Response) (res ReposGetReleas } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -46511,7 +51141,92 @@ func decodeReposGetReleaseAssetResponse(resp *http.Response) (res ReposGetReleas return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeReposGetReleaseByTagResponse(resp *http.Response) (res ReposGetReleaseByTagRes, _ error) { +func decodeReposGetReleaseByTagResponse(resp *http.Response) (res ReposGetReleaseByTagRes, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response Release + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + case 404: + // Code 404. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response BasicError + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + return res, validate.UnexpectedStatusCode(resp.StatusCode) +} + +func decodeReposGetStatusChecksProtectionResponse(resp *http.Response) (res ReposGetStatusChecksProtectionRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -46527,7 +51242,7 @@ func decodeReposGetReleaseByTagResponse(resp *http.Response) (res ReposGetReleas } d := jx.DecodeBytes(buf) - var response Release + var response StatusCheckPolicy if err := func() error { if err := response.Decode(d); err != nil { return err @@ -46544,81 +51259,14 @@ func decodeReposGetReleaseByTagResponse(resp *http.Response) (res ReposGetReleas } return res, err } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - case 404: - // Code 404. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response BasicError + // Validate response. if err := func() error { - if err := response.Decode(d); err != nil { + if err := response.Validate(); err != nil { return err } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } return nil }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err - } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - } - return res, validate.UnexpectedStatusCode(resp.StatusCode) -} - -func decodeReposGetStatusChecksProtectionResponse(resp *http.Response) (res ReposGetStatusChecksProtectionRes, _ error) { - switch resp.StatusCode { - case 200: - // Code 200. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response StatusCheckPolicy - if err := func() error { - if err := response.Decode(d); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } - return nil - }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err + return res, errors.Wrap(err, "validate") } return &response, nil default: @@ -46696,6 +51344,15 @@ func decodeReposGetTeamsWithAccessToProtectedBranchResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -46772,6 +51429,15 @@ func decodeReposGetTopPathsResponse(resp *http.Response) (res ReposGetTopPathsRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -46848,6 +51514,15 @@ func decodeReposGetTopReferrersResponse(resp *http.Response) (res ReposGetTopRef } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -46924,6 +51599,15 @@ func decodeReposGetUsersWithAccessToProtectedBranchResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -47000,6 +51684,15 @@ func decodeReposGetViewsResponse(resp *http.Response) (res ReposGetViewsRes, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -47076,6 +51769,15 @@ func decodeReposGetWebhookResponse(resp *http.Response) (res ReposGetWebhookRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -47152,6 +51854,15 @@ func decodeReposGetWebhookConfigForRepoResponse(resp *http.Response) (res *Webho } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -47193,6 +51904,15 @@ func decodeReposGetWebhookDeliveryResponse(resp *http.Response) (res ReposGetWeb } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -47263,6 +51983,15 @@ func decodeReposGetWebhookDeliveryResponse(resp *http.Response) (res ReposGetWeb } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -47312,6 +52041,15 @@ func decodeReposListAutolinksResponse(resp *http.Response) (res []Autolink, _ er } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -47361,6 +52099,32 @@ func decodeReposListBranchesResponse(resp *http.Response) (res ReposListBranches } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListBranchesOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -47477,6 +52241,15 @@ func decodeReposListBranchesForHeadCommitResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -47512,6 +52285,15 @@ func decodeReposListBranchesForHeadCommitResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -47561,6 +52343,15 @@ func decodeReposListCollaboratorsResponse(resp *http.Response) (res ReposListCol } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListCollaboratorsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -47685,6 +52476,32 @@ func decodeReposListCommentsForCommitResponse(resp *http.Response) (res *ReposLi } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListCommentsForCommitOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -47774,6 +52591,32 @@ func decodeReposListCommitCommentsForRepoResponse(resp *http.Response) (res *Rep } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListCommitCommentsForRepoOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -47863,6 +52706,15 @@ func decodeReposListCommitStatusesForRefResponse(resp *http.Response) (res Repos } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListCommitStatusesForRefOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -47987,6 +52839,32 @@ func decodeReposListCommitsResponse(resp *http.Response) (res ReposListCommitsRe } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListCommitsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -48216,6 +53094,15 @@ func decodeReposListContributorsResponse(resp *http.Response) (res ReposListCont } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListContributorsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -48378,6 +53265,15 @@ func decodeReposListDeployKeysResponse(resp *http.Response) (res *ReposListDeplo } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListDeployKeysOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -48467,6 +53363,32 @@ func decodeReposListDeploymentStatusesResponse(resp *http.Response) (res ReposLi } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListDeploymentStatusesOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -48591,6 +53513,32 @@ func decodeReposListDeploymentsResponse(resp *http.Response) (res *ReposListDepl } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListDeploymentsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -48672,6 +53620,15 @@ func decodeReposListForAuthenticatedUserResponse(resp *http.Response) (res Repos } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -48780,6 +53737,15 @@ func decodeReposListForAuthenticatedUserResponse(resp *http.Response) (res Repos } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -48829,6 +53795,15 @@ func decodeReposListForOrgResponse(resp *http.Response) (res *ReposListForOrgOKH } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListForOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -48918,6 +53893,15 @@ func decodeReposListForUserResponse(resp *http.Response) (res *ReposListForUserO } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListForUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -49007,6 +53991,15 @@ func decodeReposListForksResponse(resp *http.Response) (res ReposListForksRes, _ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListForksOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -49131,6 +54124,32 @@ func decodeReposListInvitationsResponse(resp *http.Response) (res *ReposListInvi } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListInvitationsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -49220,6 +54239,32 @@ func decodeReposListInvitationsForAuthenticatedUserResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListInvitationsForAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -49458,6 +54503,15 @@ func decodeReposListPagesBuildsResponse(resp *http.Response) (res *ReposListPage } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListPagesBuildsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -49547,6 +54601,15 @@ func decodeReposListPublicResponse(resp *http.Response) (res ReposListPublicRes, } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListPublicOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -49625,6 +54688,15 @@ func decodeReposListPublicResponse(resp *http.Response) (res ReposListPublicRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -49674,6 +54746,32 @@ func decodeReposListPullRequestsAssociatedWithCommitResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListPullRequestsAssociatedWithCommitOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -49763,6 +54861,32 @@ func decodeReposListReleaseAssetsResponse(resp *http.Response) (res *ReposListRe } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListReleaseAssetsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -49852,6 +54976,32 @@ func decodeReposListReleasesResponse(resp *http.Response) (res ReposListReleases } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListReleasesOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -49976,6 +55126,15 @@ func decodeReposListTagsResponse(resp *http.Response) (res *ReposListTagsOKHeade } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListTagsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -50065,6 +55224,15 @@ func decodeReposListTeamsResponse(resp *http.Response) (res *ReposListTeamsOKHea } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListTeamsOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -50146,6 +55314,15 @@ func decodeReposListWebhookDeliveriesResponse(resp *http.Response) (res ReposLis } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50216,6 +55393,15 @@ func decodeReposListWebhookDeliveriesResponse(resp *http.Response) (res ReposLis } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50265,6 +55451,32 @@ func decodeReposListWebhooksResponse(resp *http.Response) (res ReposListWebhooks } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper ReposListWebhooksOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -50381,6 +55593,15 @@ func decodeReposMergeResponse(resp *http.Response) (res ReposMergeRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50460,6 +55681,15 @@ func decodeReposMergeResponse(resp *http.Response) (res ReposMergeRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50501,6 +55731,15 @@ func decodeReposMergeUpstreamResponse(resp *http.Response) (res ReposMergeUpstre } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50662,6 +55901,15 @@ func decodeReposRedeliverWebhookDeliveryResponse(resp *http.Response) (res Repos } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50703,6 +55951,15 @@ func decodeReposRemoveAppAccessRestrictionsResponse(resp *http.Response) (res Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50738,6 +55995,15 @@ func decodeReposRemoveAppAccessRestrictionsResponse(resp *http.Response) (res Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50788,6 +56054,15 @@ func decodeReposRemoveStatusCheckContextsResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50858,6 +56133,15 @@ func decodeReposRemoveStatusCheckContextsResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50908,6 +56192,15 @@ func decodeReposRemoveTeamAccessRestrictionsResponse(resp *http.Response) (res R } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50943,6 +56236,15 @@ func decodeReposRemoveTeamAccessRestrictionsResponse(resp *http.Response) (res R } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -50984,6 +56286,15 @@ func decodeReposRemoveUserAccessRestrictionsResponse(resp *http.Response) (res R } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51019,6 +56330,15 @@ func decodeReposRemoveUserAccessRestrictionsResponse(resp *http.Response) (res R } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51060,6 +56380,15 @@ func decodeReposRenameBranchResponse(resp *http.Response) (res ReposRenameBranch } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51165,6 +56494,15 @@ func decodeReposRenameBranchResponse(resp *http.Response) (res ReposRenameBranch } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51206,6 +56544,15 @@ func decodeReposReplaceAllTopicsResponse(resp *http.Response) (res ReposReplaceA } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51434,6 +56781,15 @@ func decodeReposSetAppAccessRestrictionsResponse(resp *http.Response) (res Repos } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51469,6 +56825,15 @@ func decodeReposSetAppAccessRestrictionsResponse(resp *http.Response) (res Repos } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51510,6 +56875,15 @@ func decodeReposSetStatusCheckContextsResponse(resp *http.Response) (res ReposSe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51580,6 +56954,15 @@ func decodeReposSetStatusCheckContextsResponse(resp *http.Response) (res ReposSe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51621,6 +57004,15 @@ func decodeReposSetTeamAccessRestrictionsResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51656,6 +57048,15 @@ func decodeReposSetTeamAccessRestrictionsResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51697,6 +57098,15 @@ func decodeReposSetUserAccessRestrictionsResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51732,6 +57142,15 @@ func decodeReposSetUserAccessRestrictionsResponse(resp *http.Response) (res Repo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51858,6 +57277,15 @@ func decodeReposUpdateResponse(resp *http.Response) (res ReposUpdateRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -51998,6 +57426,15 @@ func decodeReposUpdateResponse(resp *http.Response) (res ReposUpdateRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52039,6 +57476,15 @@ func decodeReposUpdateBranchProtectionResponse(resp *http.Response) (res ReposUp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52185,6 +57631,15 @@ func decodeReposUpdateCommitCommentResponse(resp *http.Response) (res ReposUpdat } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52261,6 +57716,15 @@ func decodeReposUpdateInvitationResponse(resp *http.Response) (res *RepositoryIn } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52302,6 +57766,15 @@ func decodeReposUpdatePullRequestReviewProtectionResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52337,6 +57810,15 @@ func decodeReposUpdatePullRequestReviewProtectionResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52378,6 +57860,15 @@ func decodeReposUpdateReleaseResponse(resp *http.Response) (res ReposUpdateRelea } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52454,6 +57945,15 @@ func decodeReposUpdateReleaseAssetResponse(resp *http.Response) (res *ReleaseAss } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52495,6 +57995,15 @@ func decodeReposUpdateStatusCheckProtectionResponse(resp *http.Response) (res Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52565,6 +58074,15 @@ func decodeReposUpdateStatusCheckProtectionResponse(resp *http.Response) (res Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52606,6 +58124,15 @@ func decodeReposUpdateWebhookResponse(resp *http.Response) (res ReposUpdateWebho } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52676,6 +58203,15 @@ func decodeReposUpdateWebhookResponse(resp *http.Response) (res ReposUpdateWebho } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52717,6 +58253,15 @@ func decodeReposUpdateWebhookConfigForRepoResponse(resp *http.Response) (res *We } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52758,6 +58303,15 @@ func decodeReposUploadReleaseAssetResponse(resp *http.Response) (res *ReleaseAss } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52881,6 +58435,15 @@ func decodeSearchCodeResponse(resp *http.Response) (res SearchCodeRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -52954,6 +58517,15 @@ func decodeSearchCodeResponse(resp *http.Response) (res SearchCodeRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -53030,6 +58602,15 @@ func decodeSearchCommitsResponse(resp *http.Response) (res SearchCommitsRes, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -53109,6 +58690,15 @@ func decodeSearchIssuesAndPullRequestsResponse(resp *http.Response) (res SearchI } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -53182,6 +58772,15 @@ func decodeSearchIssuesAndPullRequestsResponse(resp *http.Response) (res SearchI } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -53258,6 +58857,15 @@ func decodeSearchLabelsResponse(resp *http.Response) (res SearchLabelsRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -53366,6 +58974,15 @@ func decodeSearchLabelsResponse(resp *http.Response) (res SearchLabelsRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -53407,6 +59024,15 @@ func decodeSearchReposResponse(resp *http.Response) (res SearchReposRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -53445,6 +59071,15 @@ func decodeSearchReposResponse(resp *http.Response) (res SearchReposRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -53521,6 +59156,15 @@ func decodeSearchTopicsResponse(resp *http.Response) (res SearchTopicsRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -53567,7 +59211,139 @@ func decodeSearchTopicsResponse(resp *http.Response) (res SearchTopicsRes, _ err return res, validate.UnexpectedStatusCode(resp.StatusCode) } -func decodeSearchUsersResponse(resp *http.Response) (res SearchUsersRes, _ error) { +func decodeSearchUsersResponse(resp *http.Response) (res SearchUsersRes, _ error) { + switch resp.StatusCode { + case 200: + // Code 200. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response SearchUsersOK + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + case 304: + // Code 304. + return &NotModified{}, nil + case 422: + // Code 422. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ValidationError + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + case 503: + // Code 503. + ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) + if err != nil { + return res, errors.Wrap(err, "parse media type") + } + switch { + case ct == "application/json": + buf, err := io.ReadAll(resp.Body) + if err != nil { + return res, err + } + d := jx.DecodeBytes(buf) + + var response ServiceUnavailable + if err := func() error { + if err := response.Decode(d); err != nil { + return err + } + if err := d.Skip(); err != io.EOF { + return errors.New("unexpected trailing data") + } + return nil + }(); err != nil { + err = &ogenerrors.DecodeBodyError{ + ContentType: ct, + Body: buf, + Err: err, + } + return res, err + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } + } + return res, validate.UnexpectedStatusCode(resp.StatusCode) +} + +func decodeSecretScanningGetAlertResponse(resp *http.Response) (res SecretScanningGetAlertRes, _ error) { switch resp.StatusCode { case 200: // Code 200. @@ -53583,80 +59359,7 @@ func decodeSearchUsersResponse(resp *http.Response) (res SearchUsersRes, _ error } d := jx.DecodeBytes(buf) - var response SearchUsersOK - if err := func() error { - if err := response.Decode(d); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } - return nil - }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err - } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - case 304: - // Code 304. - return &NotModified{}, nil - case 422: - // Code 422. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response ValidationError - if err := func() error { - if err := response.Decode(d); err != nil { - return err - } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } - return nil - }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err - } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - case 503: - // Code 503. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response ServiceUnavailable + var response SecretScanningAlert if err := func() error { if err := response.Decode(d); err != nil { return err @@ -53673,46 +59376,14 @@ func decodeSearchUsersResponse(resp *http.Response) (res SearchUsersRes, _ error } return res, err } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } - } - return res, validate.UnexpectedStatusCode(resp.StatusCode) -} - -func decodeSecretScanningGetAlertResponse(resp *http.Response) (res SecretScanningGetAlertRes, _ error) { - switch resp.StatusCode { - case 200: - // Code 200. - ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type")) - if err != nil { - return res, errors.Wrap(err, "parse media type") - } - switch { - case ct == "application/json": - buf, err := io.ReadAll(resp.Body) - if err != nil { - return res, err - } - d := jx.DecodeBytes(buf) - - var response SecretScanningAlert + // Validate response. if err := func() error { - if err := response.Decode(d); err != nil { + if err := response.Validate(); err != nil { return err } - if err := d.Skip(); err != io.EOF { - return errors.New("unexpected trailing data") - } return nil }(); err != nil { - err = &ogenerrors.DecodeBodyError{ - ContentType: ct, - Body: buf, - Err: err, - } - return res, err + return res, errors.Wrap(err, "validate") } return &response, nil default: @@ -53801,6 +59472,32 @@ func decodeSecretScanningListAlertsForOrgResponse(resp *http.Response) (res Secr } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper SecretScanningListAlertsForOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -53952,6 +59649,15 @@ func decodeSecretScanningListAlertsForRepoResponse(resp *http.Response) (res Sec } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -54031,6 +59737,15 @@ func decodeSecretScanningUpdateAlertResponse(resp *http.Response) (res SecretSca } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -54163,6 +59878,15 @@ func decodeTeamsAddOrUpdateMembershipForUserInOrgResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -54210,6 +59934,15 @@ func decodeTeamsAddOrUpdateMembershipForUserLegacyResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -54409,6 +60142,15 @@ func decodeTeamsAddOrUpdateProjectPermissionsLegacyResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -54497,6 +60239,15 @@ func decodeTeamsAddOrUpdateRepoPermissionsLegacyResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -54720,6 +60471,15 @@ func decodeTeamsCreateResponse(resp *http.Response) (res TeamsCreateRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -54790,6 +60550,15 @@ func decodeTeamsCreateResponse(resp *http.Response) (res TeamsCreateRes, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -55106,6 +60875,15 @@ func decodeTeamsCreateOrUpdateIdpGroupConnectionsLegacyResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -55230,6 +61008,15 @@ func decodeTeamsDeleteLegacyResponse(resp *http.Response) (res TeamsDeleteLegacy } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -55271,6 +61058,15 @@ func decodeTeamsGetByNameResponse(resp *http.Response) (res TeamsGetByNameRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -55511,6 +61307,15 @@ func decodeTeamsGetLegacyResponse(resp *http.Response) (res TeamsGetLegacyRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -55599,6 +61404,15 @@ func decodeTeamsGetMembershipForUserInOrgResponse(resp *http.Response) (res Team } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -55643,6 +61457,15 @@ func decodeTeamsGetMembershipForUserLegacyResponse(resp *http.Response) (res Tea } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -55727,6 +61550,15 @@ func decodeTeamsListResponse(resp *http.Response) (res TeamsListRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -55851,6 +61683,15 @@ func decodeTeamsListChildInOrgResponse(resp *http.Response) (res *TeamsListChild } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListChildInOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -55940,6 +61781,15 @@ func decodeTeamsListChildLegacyResponse(resp *http.Response) (res TeamsListChild } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListChildLegacyOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -56085,6 +61935,15 @@ func decodeTeamsListChildLegacyResponse(resp *http.Response) (res TeamsListChild } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -56134,6 +61993,15 @@ func decodeTeamsListDiscussionCommentsInOrgResponse(resp *http.Response) (res *T } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListDiscussionCommentsInOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -56223,6 +62091,15 @@ func decodeTeamsListDiscussionCommentsLegacyResponse(resp *http.Response) (res * } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListDiscussionCommentsLegacyOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -56312,6 +62189,15 @@ func decodeTeamsListDiscussionsInOrgResponse(resp *http.Response) (res *TeamsLis } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListDiscussionsInOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -56401,6 +62287,15 @@ func decodeTeamsListDiscussionsLegacyResponse(resp *http.Response) (res *TeamsLi } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListDiscussionsLegacyOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -56490,6 +62385,32 @@ func decodeTeamsListForAuthenticatedUserResponse(resp *http.Response) (res Teams } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListForAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -56885,6 +62806,15 @@ func decodeTeamsListMembersInOrgResponse(resp *http.Response) (res *TeamsListMem } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListMembersInOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -56974,6 +62904,15 @@ func decodeTeamsListMembersLegacyResponse(resp *http.Response) (res TeamsListMem } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListMembersLegacyOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -57098,6 +63037,15 @@ func decodeTeamsListPendingInvitationsInOrgResponse(resp *http.Response) (res *T } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListPendingInvitationsInOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -57187,6 +63135,15 @@ func decodeTeamsListPendingInvitationsLegacyResponse(resp *http.Response) (res * } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListPendingInvitationsLegacyOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -57276,6 +63233,15 @@ func decodeTeamsListProjectsInOrgResponse(resp *http.Response) (res *TeamsListPr } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListProjectsInOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -57365,6 +63331,15 @@ func decodeTeamsListProjectsLegacyResponse(resp *http.Response) (res TeamsListPr } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListProjectsLegacyOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -57489,6 +63464,15 @@ func decodeTeamsListReposInOrgResponse(resp *http.Response) (res *TeamsListRepos } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListReposInOrgOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -57578,6 +63562,15 @@ func decodeTeamsListReposLegacyResponse(resp *http.Response) (res TeamsListRepos } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper TeamsListReposLegacyOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -57812,6 +63805,15 @@ func decodeTeamsRemoveProjectLegacyResponse(resp *http.Response) (res TeamsRemov } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -58035,6 +64037,15 @@ func decodeTeamsUpdateInOrgResponse(resp *http.Response) (res *TeamFull, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -58076,6 +64087,15 @@ func decodeTeamsUpdateLegacyResponse(resp *http.Response) (res TeamsUpdateLegacy } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -58111,6 +64131,15 @@ func decodeTeamsUpdateLegacyResponse(resp *http.Response) (res TeamsUpdateLegacy } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -58216,6 +64245,15 @@ func decodeTeamsUpdateLegacyResponse(resp *http.Response) (res TeamsUpdateLegacy } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -58257,6 +64295,15 @@ func decodeUsersAddEmailForAuthenticatedResponse(resp *http.Response) (res Users } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -58400,6 +64447,15 @@ func decodeUsersAddEmailForAuthenticatedResponse(resp *http.Response) (res Users } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -58552,6 +64608,15 @@ func decodeUsersBlockResponse(resp *http.Response) (res UsersBlockRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -58839,6 +64904,15 @@ func decodeUsersCreateGpgKeyForAuthenticatedResponse(resp *http.Response) (res U } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -58982,6 +65056,15 @@ func decodeUsersCreateGpgKeyForAuthenticatedResponse(resp *http.Response) (res U } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -59166,6 +65249,15 @@ func decodeUsersCreatePublicSSHKeyForAuthenticatedResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -59318,6 +65410,15 @@ func decodeUsersDeleteEmailForAuthenticatedResponse(resp *http.Response) (res Us } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -59470,6 +65571,15 @@ func decodeUsersDeleteGpgKeyForAuthenticatedResponse(resp *http.Response) (res U } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -59745,6 +65855,15 @@ func decodeUsersGetAuthenticatedResponse(resp *http.Response) (res UsersGetAuthe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -59859,6 +65978,15 @@ func decodeUsersGetByUsernameResponse(resp *http.Response) (res UsersGetByUserna } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -59970,6 +66098,15 @@ func decodeUsersGetContextForUserResponse(resp *http.Response) (res UsersGetCont } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -60040,6 +66177,15 @@ func decodeUsersGetContextForUserResponse(resp *http.Response) (res UsersGetCont } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -60081,6 +66227,15 @@ func decodeUsersGetGpgKeyForAuthenticatedResponse(resp *http.Response) (res User } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -60387,6 +66542,15 @@ func decodeUsersListResponse(resp *http.Response) (res UsersListRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper UsersListOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -60471,6 +66635,15 @@ func decodeUsersListBlockedByAuthenticatedResponse(resp *http.Response) (res Use } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -60663,6 +66836,32 @@ func decodeUsersListEmailsForAuthenticatedResponse(resp *http.Response) (res Use } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper UsersListEmailsForAuthenticatedOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -60860,6 +67059,15 @@ func decodeUsersListFollowedByAuthenticatedResponse(resp *http.Response) (res Us } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper UsersListFollowedByAuthenticatedOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -61022,6 +67230,15 @@ func decodeUsersListFollowersForAuthenticatedUserResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper UsersListFollowersForAuthenticatedUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -61184,6 +67401,15 @@ func decodeUsersListFollowersForUserResponse(resp *http.Response) (res *UsersLis } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper UsersListFollowersForUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -61273,6 +67499,15 @@ func decodeUsersListFollowingForUserResponse(resp *http.Response) (res *UsersLis } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper UsersListFollowingForUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -61362,6 +67597,32 @@ func decodeUsersListGpgKeysForAuthenticatedResponse(resp *http.Response) (res Us } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper UsersListGpgKeysForAuthenticatedOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -61559,6 +67820,32 @@ func decodeUsersListGpgKeysForUserResponse(resp *http.Response) (res *UsersListG } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper UsersListGpgKeysForUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -61648,6 +67935,32 @@ func decodeUsersListPublicEmailsForAuthenticatedResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := elem.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper UsersListPublicEmailsForAuthenticatedOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -61845,6 +68158,15 @@ func decodeUsersListPublicKeysForUserResponse(resp *http.Response) (res *UsersLi } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper UsersListPublicKeysForUserOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -61934,6 +68256,15 @@ func decodeUsersListPublicSSHKeysForAuthenticatedResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper UsersListPublicSSHKeysForAuthenticatedOKHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) @@ -62123,6 +68454,15 @@ func decodeUsersSetPrimaryEmailVisibilityForAuthenticatedResponse(resp *http.Res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -62266,6 +68606,15 @@ func decodeUsersSetPrimaryEmailVisibilityForAuthenticatedResponse(resp *http.Res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -62541,6 +68890,15 @@ func decodeUsersUpdateAuthenticatedResponse(resp *http.Response) (res UsersUpdat } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -62684,6 +69042,15 @@ func decodeUsersUpdateAuthenticatedResponse(resp *http.Response) (res UsersUpdat } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_gotd/oas_response_decoders_gen.go b/examples/ex_gotd/oas_response_decoders_gen.go index 18f01119b..494805223 100644 --- a/examples/ex_gotd/oas_response_decoders_gen.go +++ b/examples/ex_gotd/oas_response_decoders_gen.go @@ -960,6 +960,15 @@ func decodeCreateChatInviteLinkResponse(resp *http.Response) (res *ResultChatInv } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1707,6 +1716,15 @@ func decodeEditChatInviteLinkResponse(resp *http.Response) (res *ResultChatInvit } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1790,6 +1808,15 @@ func decodeEditMessageCaptionResponse(resp *http.Response) (res *ResultMessageOr } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1873,6 +1900,15 @@ func decodeEditMessageLiveLocationResponse(resp *http.Response) (res *ResultMess } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1956,6 +1992,15 @@ func decodeEditMessageMediaResponse(resp *http.Response) (res *ResultMessageOrBo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2039,6 +2084,15 @@ func decodeEditMessageReplyMarkupResponse(resp *http.Response) (res *ResultMessa } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2122,6 +2176,15 @@ func decodeEditMessageTextResponse(resp *http.Response) (res *ResultMessageOrBoo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2288,6 +2351,15 @@ func decodeForwardMessageResponse(resp *http.Response) (res *ResultMessage, _ er } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2371,6 +2443,15 @@ func decodeGetChatResponse(resp *http.Response) (res *ResultChat, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3035,6 +3116,15 @@ func decodeGetMyCommandsResponse(resp *http.Response) (res *ResultArrayOfBotComm } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3201,6 +3291,15 @@ func decodeGetStickerSetResponse(resp *http.Response) (res *ResultStickerSet, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3284,6 +3383,15 @@ func decodeGetUpdatesResponse(resp *http.Response) (res *ResultArrayOfUpdate, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3367,6 +3475,15 @@ func decodeGetUserProfilePhotosResponse(resp *http.Response) (res *ResultUserPro } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3948,6 +4065,15 @@ func decodeRevokeChatInviteLinkResponse(resp *http.Response) (res *ResultChatInv } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4031,6 +4157,15 @@ func decodeSendAnimationResponse(resp *http.Response) (res *ResultMessage, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4114,6 +4249,15 @@ func decodeSendAudioResponse(resp *http.Response) (res *ResultMessage, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4280,6 +4424,15 @@ func decodeSendContactResponse(resp *http.Response) (res *ResultMessage, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4363,6 +4516,15 @@ func decodeSendDiceResponse(resp *http.Response) (res *ResultMessage, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4446,6 +4608,15 @@ func decodeSendDocumentResponse(resp *http.Response) (res *ResultMessage, _ erro } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4529,6 +4700,15 @@ func decodeSendGameResponse(resp *http.Response) (res *ResultMessage, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4612,6 +4792,15 @@ func decodeSendInvoiceResponse(resp *http.Response) (res *ResultMessage, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4695,6 +4884,15 @@ func decodeSendLocationResponse(resp *http.Response) (res *ResultMessage, _ erro } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4778,6 +4976,15 @@ func decodeSendMediaGroupResponse(resp *http.Response) (res *ResultArrayOfMessag } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4861,6 +5068,15 @@ func decodeSendMessageResponse(resp *http.Response) (res *ResultMessage, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4944,6 +5160,15 @@ func decodeSendPhotoResponse(resp *http.Response) (res *ResultMessage, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5027,6 +5252,15 @@ func decodeSendPollResponse(resp *http.Response) (res *ResultMessage, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5110,6 +5344,15 @@ func decodeSendStickerResponse(resp *http.Response) (res *ResultMessage, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5193,6 +5436,15 @@ func decodeSendVenueResponse(resp *http.Response) (res *ResultMessage, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5276,6 +5528,15 @@ func decodeSendVideoResponse(resp *http.Response) (res *ResultMessage, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5359,6 +5620,15 @@ func decodeSendVideoNoteResponse(resp *http.Response) (res *ResultMessage, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5442,6 +5712,15 @@ func decodeSendVoiceResponse(resp *http.Response) (res *ResultMessage, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6687,6 +6966,15 @@ func decodeStopMessageLiveLocationResponse(resp *http.Response) (res *ResultMess } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6770,6 +7058,15 @@ func decodeStopPollResponse(resp *http.Response) (res *ResultPoll, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_k8s/oas_response_decoders_gen.go b/examples/ex_k8s/oas_response_decoders_gen.go index c23e749a1..ba8285364 100644 --- a/examples/ex_k8s/oas_response_decoders_gen.go +++ b/examples/ex_k8s/oas_response_decoders_gen.go @@ -1393,6 +1393,15 @@ func decodeGetAPIVersionsResponse(resp *http.Response) (res GetAPIVersionsRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1437,6 +1446,15 @@ func decodeGetAdmissionregistrationAPIGroupResponse(resp *http.Response) (res Ge } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1481,6 +1499,15 @@ func decodeGetAdmissionregistrationV1APIResourcesResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1525,6 +1552,15 @@ func decodeGetApiextensionsAPIGroupResponse(resp *http.Response) (res GetApiexte } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1569,6 +1605,15 @@ func decodeGetApiextensionsV1APIResourcesResponse(resp *http.Response) (res GetA } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1613,6 +1658,15 @@ func decodeGetApiregistrationAPIGroupResponse(resp *http.Response) (res GetApire } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1657,6 +1711,15 @@ func decodeGetApiregistrationV1APIResourcesResponse(resp *http.Response) (res Ge } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1701,6 +1764,15 @@ func decodeGetAppsAPIGroupResponse(resp *http.Response) (res GetAppsAPIGroupRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1745,6 +1817,15 @@ func decodeGetAppsV1APIResourcesResponse(resp *http.Response) (res GetAppsV1APIR } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1789,6 +1870,15 @@ func decodeGetAuthenticationAPIGroupResponse(resp *http.Response) (res GetAuthen } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1833,6 +1923,15 @@ func decodeGetAuthenticationV1APIResourcesResponse(resp *http.Response) (res Get } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1877,6 +1976,15 @@ func decodeGetAuthorizationAPIGroupResponse(resp *http.Response) (res GetAuthori } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1921,6 +2029,15 @@ func decodeGetAuthorizationV1APIResourcesResponse(resp *http.Response) (res GetA } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1965,6 +2082,15 @@ func decodeGetAutoscalingAPIGroupResponse(resp *http.Response) (res GetAutoscali } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2009,6 +2135,15 @@ func decodeGetAutoscalingV1APIResourcesResponse(resp *http.Response) (res GetAut } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2053,6 +2188,15 @@ func decodeGetAutoscalingV2beta1APIResourcesResponse(resp *http.Response) (res G } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2097,6 +2241,15 @@ func decodeGetAutoscalingV2beta2APIResourcesResponse(resp *http.Response) (res G } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2141,6 +2294,15 @@ func decodeGetBatchAPIGroupResponse(resp *http.Response) (res GetBatchAPIGroupRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2185,6 +2347,15 @@ func decodeGetBatchV1APIResourcesResponse(resp *http.Response) (res GetBatchV1AP } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2229,6 +2400,15 @@ func decodeGetBatchV1beta1APIResourcesResponse(resp *http.Response) (res GetBatc } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2273,6 +2453,15 @@ func decodeGetCertificatesAPIGroupResponse(resp *http.Response) (res GetCertific } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2317,6 +2506,15 @@ func decodeGetCertificatesV1APIResourcesResponse(resp *http.Response) (res GetCe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2405,6 +2603,15 @@ func decodeGetCoordinationAPIGroupResponse(resp *http.Response) (res GetCoordina } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2449,6 +2656,15 @@ func decodeGetCoordinationV1APIResourcesResponse(resp *http.Response) (res GetCo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2493,6 +2709,15 @@ func decodeGetCoreAPIVersionsResponse(resp *http.Response) (res GetCoreAPIVersio } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2537,6 +2762,15 @@ func decodeGetCoreV1APIResourcesResponse(resp *http.Response) (res GetCoreV1APIR } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2581,6 +2815,15 @@ func decodeGetDiscoveryAPIGroupResponse(resp *http.Response) (res GetDiscoveryAP } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2625,6 +2868,15 @@ func decodeGetDiscoveryV1APIResourcesResponse(resp *http.Response) (res GetDisco } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2669,6 +2921,15 @@ func decodeGetDiscoveryV1beta1APIResourcesResponse(resp *http.Response) (res Get } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2713,6 +2974,15 @@ func decodeGetEventsAPIGroupResponse(resp *http.Response) (res GetEventsAPIGroup } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2757,6 +3027,15 @@ func decodeGetEventsV1APIResourcesResponse(resp *http.Response) (res GetEventsV1 } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2801,6 +3080,15 @@ func decodeGetEventsV1beta1APIResourcesResponse(resp *http.Response) (res GetEve } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2845,6 +3133,15 @@ func decodeGetFlowcontrolApiserverAPIGroupResponse(resp *http.Response) (res Get } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2889,6 +3186,15 @@ func decodeGetFlowcontrolApiserverV1beta1APIResourcesResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2933,6 +3239,15 @@ func decodeGetFlowcontrolApiserverV1beta2APIResourcesResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2977,6 +3292,15 @@ func decodeGetInternalApiserverAPIGroupResponse(resp *http.Response) (res GetInt } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3021,6 +3345,15 @@ func decodeGetInternalApiserverV1alpha1APIResourcesResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3065,6 +3398,15 @@ func decodeGetNetworkingAPIGroupResponse(resp *http.Response) (res GetNetworking } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3109,6 +3451,15 @@ func decodeGetNetworkingV1APIResourcesResponse(resp *http.Response) (res GetNetw } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3153,6 +3504,15 @@ func decodeGetNodeAPIGroupResponse(resp *http.Response) (res GetNodeAPIGroupRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3197,6 +3557,15 @@ func decodeGetNodeV1APIResourcesResponse(resp *http.Response) (res GetNodeV1APIR } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3241,6 +3610,15 @@ func decodeGetNodeV1alpha1APIResourcesResponse(resp *http.Response) (res GetNode } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3285,10 +3663,19 @@ func decodeGetNodeV1beta1APIResourcesResponse(resp *http.Response) (res GetNodeV } return res, err } - return &response, nil - default: - return res, validate.InvalidContentType(ct) - } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } + return &response, nil + default: + return res, validate.InvalidContentType(ct) + } case 401: // Code 401. return &GetNodeV1beta1APIResourcesUnauthorized{}, nil @@ -3329,6 +3716,15 @@ func decodeGetPolicyAPIGroupResponse(resp *http.Response) (res GetPolicyAPIGroup } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3373,6 +3769,15 @@ func decodeGetPolicyV1APIResourcesResponse(resp *http.Response) (res GetPolicyV1 } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3417,6 +3822,15 @@ func decodeGetPolicyV1beta1APIResourcesResponse(resp *http.Response) (res GetPol } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3461,6 +3875,15 @@ func decodeGetRbacAuthorizationAPIGroupResponse(resp *http.Response) (res GetRba } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3505,6 +3928,15 @@ func decodeGetRbacAuthorizationV1APIResourcesResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3549,6 +3981,15 @@ func decodeGetSchedulingAPIGroupResponse(resp *http.Response) (res GetScheduling } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3593,6 +4034,15 @@ func decodeGetSchedulingV1APIResourcesResponse(resp *http.Response) (res GetSche } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3709,6 +4159,15 @@ func decodeGetStorageAPIGroupResponse(resp *http.Response) (res GetStorageAPIGro } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3753,6 +4212,15 @@ func decodeGetStorageV1APIResourcesResponse(resp *http.Response) (res GetStorage } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3797,6 +4265,15 @@ func decodeGetStorageV1alpha1APIResourcesResponse(resp *http.Response) (res GetS } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3841,6 +4318,15 @@ func decodeGetStorageV1beta1APIResourcesResponse(resp *http.Response) (res GetSt } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3885,6 +4371,15 @@ func decodeListAdmissionregistrationV1MutatingWebhookConfigurationResponse(resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3929,6 +4424,15 @@ func decodeListAdmissionregistrationV1ValidatingWebhookConfigurationResponse(res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3973,6 +4477,15 @@ func decodeListApiextensionsV1CustomResourceDefinitionResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4017,6 +4530,15 @@ func decodeListApiregistrationV1APIServiceResponse(resp *http.Response) (res Lis } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4061,6 +4583,15 @@ func decodeListAppsV1ControllerRevisionForAllNamespacesResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4105,6 +4636,15 @@ func decodeListAppsV1DaemonSetForAllNamespacesResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4149,6 +4689,15 @@ func decodeListAppsV1DeploymentForAllNamespacesResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4193,6 +4742,15 @@ func decodeListAppsV1NamespacedControllerRevisionResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4237,6 +4795,15 @@ func decodeListAppsV1NamespacedDaemonSetResponse(resp *http.Response) (res ListA } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4281,6 +4848,15 @@ func decodeListAppsV1NamespacedDeploymentResponse(resp *http.Response) (res List } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4325,6 +4901,15 @@ func decodeListAppsV1NamespacedReplicaSetResponse(resp *http.Response) (res List } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4369,6 +4954,15 @@ func decodeListAppsV1NamespacedStatefulSetResponse(resp *http.Response) (res Lis } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4413,6 +5007,15 @@ func decodeListAppsV1ReplicaSetForAllNamespacesResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4457,6 +5060,15 @@ func decodeListAppsV1StatefulSetForAllNamespacesResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4501,6 +5113,15 @@ func decodeListAutoscalingV1HorizontalPodAutoscalerForAllNamespacesResponse(resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4545,6 +5166,15 @@ func decodeListAutoscalingV1NamespacedHorizontalPodAutoscalerResponse(resp *http } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4589,6 +5219,15 @@ func decodeListAutoscalingV2beta1HorizontalPodAutoscalerForAllNamespacesResponse } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4633,6 +5272,15 @@ func decodeListAutoscalingV2beta1NamespacedHorizontalPodAutoscalerResponse(resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4677,6 +5325,15 @@ func decodeListAutoscalingV2beta2HorizontalPodAutoscalerForAllNamespacesResponse } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4721,6 +5378,15 @@ func decodeListAutoscalingV2beta2NamespacedHorizontalPodAutoscalerResponse(resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4765,6 +5431,15 @@ func decodeListBatchV1CronJobForAllNamespacesResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4809,6 +5484,15 @@ func decodeListBatchV1JobForAllNamespacesResponse(resp *http.Response) (res List } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4853,6 +5537,15 @@ func decodeListBatchV1NamespacedCronJobResponse(resp *http.Response) (res ListBa } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4897,6 +5590,15 @@ func decodeListBatchV1NamespacedJobResponse(resp *http.Response) (res ListBatchV } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4941,6 +5643,15 @@ func decodeListBatchV1beta1CronJobForAllNamespacesResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4985,6 +5696,15 @@ func decodeListBatchV1beta1NamespacedCronJobResponse(resp *http.Response) (res L } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5029,6 +5749,15 @@ func decodeListCertificatesV1CertificateSigningRequestResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5073,6 +5802,15 @@ func decodeListCoordinationV1LeaseForAllNamespacesResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5117,6 +5855,15 @@ func decodeListCoordinationV1NamespacedLeaseResponse(resp *http.Response) (res L } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5161,6 +5908,15 @@ func decodeListCoreV1ComponentStatusResponse(resp *http.Response) (res ListCoreV } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5205,6 +5961,15 @@ func decodeListCoreV1ConfigMapForAllNamespacesResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5249,6 +6014,15 @@ func decodeListCoreV1EndpointsForAllNamespacesResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5293,6 +6067,15 @@ func decodeListCoreV1EventForAllNamespacesResponse(resp *http.Response) (res Lis } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5337,6 +6120,15 @@ func decodeListCoreV1LimitRangeForAllNamespacesResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5381,6 +6173,15 @@ func decodeListCoreV1NamespaceResponse(resp *http.Response) (res ListCoreV1Names } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5425,6 +6226,15 @@ func decodeListCoreV1NamespacedConfigMapResponse(resp *http.Response) (res ListC } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5469,6 +6279,15 @@ func decodeListCoreV1NamespacedEndpointsResponse(resp *http.Response) (res ListC } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5513,6 +6332,15 @@ func decodeListCoreV1NamespacedEventResponse(resp *http.Response) (res ListCoreV } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5557,6 +6385,15 @@ func decodeListCoreV1NamespacedLimitRangeResponse(resp *http.Response) (res List } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5601,6 +6438,15 @@ func decodeListCoreV1NamespacedPersistentVolumeClaimResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5645,6 +6491,15 @@ func decodeListCoreV1NamespacedPodResponse(resp *http.Response) (res ListCoreV1N } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5689,6 +6544,15 @@ func decodeListCoreV1NamespacedPodTemplateResponse(resp *http.Response) (res Lis } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5733,6 +6597,15 @@ func decodeListCoreV1NamespacedReplicationControllerResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5777,6 +6650,15 @@ func decodeListCoreV1NamespacedResourceQuotaResponse(resp *http.Response) (res L } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5821,6 +6703,15 @@ func decodeListCoreV1NamespacedSecretResponse(resp *http.Response) (res ListCore } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5865,6 +6756,15 @@ func decodeListCoreV1NamespacedServiceResponse(resp *http.Response) (res ListCor } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5909,6 +6809,15 @@ func decodeListCoreV1NamespacedServiceAccountResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5953,6 +6862,15 @@ func decodeListCoreV1NodeResponse(resp *http.Response) (res ListCoreV1NodeRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5997,6 +6915,15 @@ func decodeListCoreV1PersistentVolumeResponse(resp *http.Response) (res ListCore } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6041,6 +6968,15 @@ func decodeListCoreV1PersistentVolumeClaimForAllNamespacesResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6085,6 +7021,15 @@ func decodeListCoreV1PodForAllNamespacesResponse(resp *http.Response) (res ListC } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6129,6 +7074,15 @@ func decodeListCoreV1PodTemplateForAllNamespacesResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6173,6 +7127,15 @@ func decodeListCoreV1ReplicationControllerForAllNamespacesResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6217,6 +7180,15 @@ func decodeListCoreV1ResourceQuotaForAllNamespacesResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6261,6 +7233,15 @@ func decodeListCoreV1SecretForAllNamespacesResponse(resp *http.Response) (res Li } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6305,6 +7286,15 @@ func decodeListCoreV1ServiceAccountForAllNamespacesResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6349,6 +7339,15 @@ func decodeListCoreV1ServiceForAllNamespacesResponse(resp *http.Response) (res L } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6393,6 +7392,15 @@ func decodeListDiscoveryV1EndpointSliceForAllNamespacesResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6437,6 +7445,15 @@ func decodeListDiscoveryV1NamespacedEndpointSliceResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6481,6 +7498,15 @@ func decodeListDiscoveryV1beta1EndpointSliceForAllNamespacesResponse(resp *http. } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6525,6 +7551,15 @@ func decodeListDiscoveryV1beta1NamespacedEndpointSliceResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6569,6 +7604,15 @@ func decodeListEventsV1EventForAllNamespacesResponse(resp *http.Response) (res L } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6613,6 +7657,15 @@ func decodeListEventsV1NamespacedEventResponse(resp *http.Response) (res ListEve } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6657,6 +7710,15 @@ func decodeListEventsV1beta1EventForAllNamespacesResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6701,6 +7763,15 @@ func decodeListEventsV1beta1NamespacedEventResponse(resp *http.Response) (res Li } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6745,6 +7816,15 @@ func decodeListFlowcontrolApiserverV1beta1FlowSchemaResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6789,6 +7869,15 @@ func decodeListFlowcontrolApiserverV1beta1PriorityLevelConfigurationResponse(res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6833,6 +7922,15 @@ func decodeListFlowcontrolApiserverV1beta2FlowSchemaResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6877,6 +7975,15 @@ func decodeListFlowcontrolApiserverV1beta2PriorityLevelConfigurationResponse(res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6921,6 +8028,15 @@ func decodeListInternalApiserverV1alpha1StorageVersionResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6965,6 +8081,15 @@ func decodeListNetworkingV1IngressClassResponse(resp *http.Response) (res ListNe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7009,6 +8134,15 @@ func decodeListNetworkingV1IngressForAllNamespacesResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7053,6 +8187,15 @@ func decodeListNetworkingV1NamespacedIngressResponse(resp *http.Response) (res L } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7097,6 +8240,15 @@ func decodeListNetworkingV1NamespacedNetworkPolicyResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7141,6 +8293,15 @@ func decodeListNetworkingV1NetworkPolicyForAllNamespacesResponse(resp *http.Resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7185,6 +8346,15 @@ func decodeListNodeV1RuntimeClassResponse(resp *http.Response) (res ListNodeV1Ru } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7229,6 +8399,15 @@ func decodeListNodeV1alpha1RuntimeClassResponse(resp *http.Response) (res ListNo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7273,6 +8452,15 @@ func decodeListNodeV1beta1RuntimeClassResponse(resp *http.Response) (res ListNod } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7317,6 +8505,15 @@ func decodeListPolicyV1NamespacedPodDisruptionBudgetResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7361,6 +8558,15 @@ func decodeListPolicyV1PodDisruptionBudgetForAllNamespacesResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7405,6 +8611,15 @@ func decodeListPolicyV1beta1NamespacedPodDisruptionBudgetResponse(resp *http.Res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7449,6 +8664,15 @@ func decodeListPolicyV1beta1PodDisruptionBudgetForAllNamespacesResponse(resp *ht } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7493,6 +8717,15 @@ func decodeListPolicyV1beta1PodSecurityPolicyResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7537,6 +8770,15 @@ func decodeListRbacAuthorizationV1ClusterRoleResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7581,6 +8823,15 @@ func decodeListRbacAuthorizationV1ClusterRoleBindingResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7625,6 +8876,15 @@ func decodeListRbacAuthorizationV1NamespacedRoleResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7669,6 +8929,15 @@ func decodeListRbacAuthorizationV1NamespacedRoleBindingResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7713,6 +8982,15 @@ func decodeListRbacAuthorizationV1RoleBindingForAllNamespacesResponse(resp *http } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7757,6 +9035,15 @@ func decodeListRbacAuthorizationV1RoleForAllNamespacesResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7801,6 +9088,15 @@ func decodeListSchedulingV1PriorityClassResponse(resp *http.Response) (res ListS } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7845,6 +9141,15 @@ func decodeListStorageV1CSIDriverResponse(resp *http.Response) (res ListStorageV } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7889,6 +9194,15 @@ func decodeListStorageV1CSINodeResponse(resp *http.Response) (res ListStorageV1C } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7933,6 +9247,15 @@ func decodeListStorageV1StorageClassResponse(resp *http.Response) (res ListStora } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -7977,6 +9300,15 @@ func decodeListStorageV1VolumeAttachmentResponse(resp *http.Response) (res ListS } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8021,6 +9353,15 @@ func decodeListStorageV1alpha1CSIStorageCapacityForAllNamespacesResponse(resp *h } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8065,6 +9406,15 @@ func decodeListStorageV1alpha1NamespacedCSIStorageCapacityResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8109,6 +9459,15 @@ func decodeListStorageV1beta1CSIStorageCapacityForAllNamespacesResponse(resp *ht } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8153,6 +9512,15 @@ func decodeListStorageV1beta1NamespacedCSIStorageCapacityResponse(resp *http.Res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8215,6 +9583,15 @@ func decodeReadAdmissionregistrationV1MutatingWebhookConfigurationResponse(resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8259,6 +9636,15 @@ func decodeReadAdmissionregistrationV1ValidatingWebhookConfigurationResponse(res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8303,6 +9689,15 @@ func decodeReadApiextensionsV1CustomResourceDefinitionResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8347,6 +9742,15 @@ func decodeReadApiextensionsV1CustomResourceDefinitionStatusResponse(resp *http. } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8391,6 +9795,15 @@ func decodeReadApiregistrationV1APIServiceResponse(resp *http.Response) (res Rea } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8435,6 +9848,15 @@ func decodeReadApiregistrationV1APIServiceStatusResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8523,6 +9945,15 @@ func decodeReadAppsV1NamespacedDaemonSetResponse(resp *http.Response) (res ReadA } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8567,6 +9998,15 @@ func decodeReadAppsV1NamespacedDaemonSetStatusResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8611,6 +10051,15 @@ func decodeReadAppsV1NamespacedDeploymentResponse(resp *http.Response) (res Read } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8699,6 +10148,15 @@ func decodeReadAppsV1NamespacedDeploymentStatusResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8741,7 +10199,16 @@ func decodeReadAppsV1NamespacedReplicaSetResponse(resp *http.Response) (res Read Body: buf, Err: err, } - return res, err + return res, err + } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") } return &response, nil default: @@ -8831,6 +10298,15 @@ func decodeReadAppsV1NamespacedReplicaSetStatusResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8875,6 +10351,15 @@ func decodeReadAppsV1NamespacedStatefulSetResponse(resp *http.Response) (res Rea } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -8963,6 +10448,15 @@ func decodeReadAppsV1NamespacedStatefulSetStatusResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9095,6 +10589,15 @@ func decodeReadAutoscalingV2beta1NamespacedHorizontalPodAutoscalerResponse(resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9139,6 +10642,15 @@ func decodeReadAutoscalingV2beta1NamespacedHorizontalPodAutoscalerStatusResponse } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9183,6 +10695,15 @@ func decodeReadAutoscalingV2beta2NamespacedHorizontalPodAutoscalerResponse(resp } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9227,6 +10748,15 @@ func decodeReadAutoscalingV2beta2NamespacedHorizontalPodAutoscalerStatusResponse } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9271,6 +10801,15 @@ func decodeReadBatchV1NamespacedCronJobResponse(resp *http.Response) (res ReadBa } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9315,6 +10854,15 @@ func decodeReadBatchV1NamespacedCronJobStatusResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9359,6 +10907,15 @@ func decodeReadBatchV1NamespacedJobResponse(resp *http.Response) (res ReadBatchV } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9403,6 +10960,15 @@ func decodeReadBatchV1NamespacedJobStatusResponse(resp *http.Response) (res Read } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9447,6 +11013,15 @@ func decodeReadBatchV1beta1NamespacedCronJobResponse(resp *http.Response) (res R } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9491,6 +11066,15 @@ func decodeReadBatchV1beta1NamespacedCronJobStatusResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9535,6 +11119,15 @@ func decodeReadCertificatesV1CertificateSigningRequestResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9579,6 +11172,15 @@ func decodeReadCertificatesV1CertificateSigningRequestApprovalResponse(resp *htt } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9623,6 +11225,15 @@ func decodeReadCertificatesV1CertificateSigningRequestStatusResponse(resp *http. } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9843,6 +11454,15 @@ func decodeReadCoreV1NamespacedConfigMapResponse(resp *http.Response) (res ReadC } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -9975,6 +11595,15 @@ func decodeReadCoreV1NamespacedLimitRangeResponse(resp *http.Response) (res Read } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10107,6 +11736,15 @@ func decodeReadCoreV1NamespacedPodResponse(resp *http.Response) (res ReadCoreV1N } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10151,6 +11789,15 @@ func decodeReadCoreV1NamespacedPodEphemeralcontainersResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10266,6 +11913,15 @@ func decodeReadCoreV1NamespacedPodStatusResponse(resp *http.Response) (res ReadC } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10310,6 +11966,15 @@ func decodeReadCoreV1NamespacedPodTemplateResponse(resp *http.Response) (res Rea } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10354,6 +12019,15 @@ func decodeReadCoreV1NamespacedReplicationControllerResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10442,6 +12116,15 @@ func decodeReadCoreV1NamespacedReplicationControllerStatusResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10574,6 +12257,15 @@ func decodeReadCoreV1NamespacedSecretResponse(resp *http.Response) (res ReadCore } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10838,6 +12530,15 @@ func decodeReadCoreV1PersistentVolumeResponse(resp *http.Response) (res ReadCore } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10882,6 +12583,15 @@ func decodeReadCoreV1PersistentVolumeStatusResponse(resp *http.Response) (res Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10926,6 +12636,15 @@ func decodeReadDiscoveryV1NamespacedEndpointSliceResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -10970,6 +12689,15 @@ func decodeReadDiscoveryV1beta1NamespacedEndpointSliceResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11102,6 +12830,15 @@ func decodeReadFlowcontrolApiserverV1beta1FlowSchemaResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11146,6 +12883,15 @@ func decodeReadFlowcontrolApiserverV1beta1FlowSchemaStatusResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11278,6 +13024,15 @@ func decodeReadFlowcontrolApiserverV1beta2FlowSchemaResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11322,6 +13077,15 @@ func decodeReadFlowcontrolApiserverV1beta2FlowSchemaStatusResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11586,6 +13350,15 @@ func decodeReadNetworkingV1NamespacedIngressResponse(resp *http.Response) (res R } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -11630,6 +13403,15 @@ func decodeReadNetworkingV1NamespacedIngressStatusResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12026,6 +13808,15 @@ func decodeReadPolicyV1beta1PodSecurityPolicyResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12070,6 +13861,15 @@ func decodeReadRbacAuthorizationV1ClusterRoleResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12158,6 +13958,15 @@ func decodeReadRbacAuthorizationV1NamespacedRoleResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12334,6 +14143,15 @@ func decodeReadStorageV1CSINodeResponse(resp *http.Response) (res ReadStorageV1C } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12378,6 +14196,15 @@ func decodeReadStorageV1StorageClassResponse(resp *http.Response) (res ReadStora } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12422,6 +14249,15 @@ func decodeReadStorageV1VolumeAttachmentResponse(resp *http.Response) (res ReadS } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -12466,6 +14302,15 @@ func decodeReadStorageV1VolumeAttachmentStatusResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_manga/oas_response_decoders_gen.go b/examples/ex_manga/oas_response_decoders_gen.go index ef21478b5..bf16676e0 100644 --- a/examples/ex_manga/oas_response_decoders_gen.go +++ b/examples/ex_manga/oas_response_decoders_gen.go @@ -49,6 +49,15 @@ func decodeGetBookResponse(resp *http.Response) (res GetBookRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -177,6 +186,15 @@ func decodeSearchResponse(resp *http.Response) (res SearchRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -221,6 +239,15 @@ func decodeSearchByTagIDResponse(resp *http.Response) (res SearchByTagIDRes, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_oauth2/oas_response_decoders_gen.go b/examples/ex_oauth2/oas_response_decoders_gen.go index 6c13630b1..0ca1e938e 100644 --- a/examples/ex_oauth2/oas_response_decoders_gen.go +++ b/examples/ex_oauth2/oas_response_decoders_gen.go @@ -272,6 +272,15 @@ func decodeFindPetsResponse(resp *http.Response) (res []Pet, _ error) { } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_openai/oas_response_decoders_gen.go b/examples/ex_openai/oas_response_decoders_gen.go index ddf650fa6..9d5d9855b 100644 --- a/examples/ex_openai/oas_response_decoders_gen.go +++ b/examples/ex_openai/oas_response_decoders_gen.go @@ -129,6 +129,15 @@ func decodeCreateChatCompletionResponse(resp *http.Response) (res *CreateChatCom } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -211,6 +220,15 @@ func decodeCreateCompletionResponse(resp *http.Response) (res *CreateCompletionR } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -252,6 +270,15 @@ func decodeCreateEditResponse(resp *http.Response) (res *CreateEditResponse, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -293,6 +320,15 @@ func decodeCreateEmbeddingResponse(resp *http.Response) (res *CreateEmbeddingRes } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -539,6 +575,15 @@ func decodeCreateModerationResponse(resp *http.Response) (res *CreateModerationR } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -580,6 +625,15 @@ func decodeCreateSearchResponse(resp *http.Response) (res *CreateSearchResponse, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -828,6 +882,15 @@ func decodeListEnginesResponse(resp *http.Response) (res *ListEnginesResponse, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -869,6 +932,15 @@ func decodeListFilesResponse(resp *http.Response) (res *ListFilesResponse, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -910,6 +982,15 @@ func decodeListFineTuneEventsResponse(resp *http.Response) (res *ListFineTuneEve } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -951,6 +1032,15 @@ func decodeListFineTunesResponse(resp *http.Response) (res *ListFineTunesRespons } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -992,6 +1082,15 @@ func decodeListModelsResponse(resp *http.Response) (res *ListModelsResponse, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_petstore/oas_response_decoders_gen.go b/examples/ex_petstore/oas_response_decoders_gen.go index 78bcd4552..6a5e0cc8f 100644 --- a/examples/ex_petstore/oas_response_decoders_gen.go +++ b/examples/ex_petstore/oas_response_decoders_gen.go @@ -100,6 +100,15 @@ func decodeListPetsResponse(resp *http.Response) (res *PetsHeaders, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } var wrapper PetsHeaders wrapper.Response = response h := uri.NewHeaderDecoder(resp.Header) diff --git a/examples/ex_petstore_expanded/oas_response_decoders_gen.go b/examples/ex_petstore_expanded/oas_response_decoders_gen.go index 6c13630b1..0ca1e938e 100644 --- a/examples/ex_petstore_expanded/oas_response_decoders_gen.go +++ b/examples/ex_petstore_expanded/oas_response_decoders_gen.go @@ -272,6 +272,15 @@ func decodeFindPetsResponse(resp *http.Response) (res []Pet, _ error) { } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_telegram/oas_response_decoders_gen.go b/examples/ex_telegram/oas_response_decoders_gen.go index 2a01837b2..01c0081b9 100644 --- a/examples/ex_telegram/oas_response_decoders_gen.go +++ b/examples/ex_telegram/oas_response_decoders_gen.go @@ -877,6 +877,15 @@ func decodeCreateChatInviteLinkResponse(resp *http.Response) (res *ResultChatInv } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1624,6 +1633,15 @@ func decodeEditChatInviteLinkResponse(resp *http.Response) (res *ResultChatInvit } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2205,6 +2223,15 @@ func decodeForwardMessageResponse(resp *http.Response) (res *ResultMessage, _ er } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2288,6 +2315,15 @@ func decodeGetChatResponse(resp *http.Response) (res *ResultChat, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -2869,6 +2905,15 @@ func decodeGetMyCommandsResponse(resp *http.Response) (res *ResultArrayOfBotComm } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3035,6 +3080,15 @@ func decodeGetUpdatesResponse(resp *http.Response) (res *ResultArrayOfUpdate, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3118,6 +3172,15 @@ func decodeGetUserProfilePhotosResponse(resp *http.Response) (res *ResultUserPro } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3699,6 +3762,15 @@ func decodeRevokeChatInviteLinkResponse(resp *http.Response) (res *ResultChatInv } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3782,6 +3854,15 @@ func decodeSendAnimationResponse(resp *http.Response) (res *ResultMessage, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -3865,6 +3946,15 @@ func decodeSendAudioResponse(resp *http.Response) (res *ResultMessage, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4031,6 +4121,15 @@ func decodeSendContactResponse(resp *http.Response) (res *ResultMessage, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4114,6 +4213,15 @@ func decodeSendDiceResponse(resp *http.Response) (res *ResultMessage, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4197,6 +4305,15 @@ func decodeSendDocumentResponse(resp *http.Response) (res *ResultMessage, _ erro } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4280,6 +4397,15 @@ func decodeSendGameResponse(resp *http.Response) (res *ResultMessage, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4363,6 +4489,15 @@ func decodeSendInvoiceResponse(resp *http.Response) (res *ResultMessage, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4446,6 +4581,15 @@ func decodeSendLocationResponse(resp *http.Response) (res *ResultMessage, _ erro } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4529,6 +4673,15 @@ func decodeSendMediaGroupResponse(resp *http.Response) (res *ResultArrayOfMessag } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4612,6 +4765,15 @@ func decodeSendMessageResponse(resp *http.Response) (res *ResultMessage, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4695,6 +4857,15 @@ func decodeSendPhotoResponse(resp *http.Response) (res *ResultMessage, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4778,6 +4949,15 @@ func decodeSendPollResponse(resp *http.Response) (res *ResultMessage, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4861,6 +5041,15 @@ func decodeSendStickerResponse(resp *http.Response) (res *ResultMessage, _ error } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -4944,6 +5133,15 @@ func decodeSendVenueResponse(resp *http.Response) (res *ResultMessage, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5027,6 +5225,15 @@ func decodeSendVideoResponse(resp *http.Response) (res *ResultMessage, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5110,6 +5317,15 @@ func decodeSendVideoNoteResponse(resp *http.Response) (res *ResultMessage, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -5193,6 +5409,15 @@ func decodeSendVoiceResponse(resp *http.Response) (res *ResultMessage, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -6355,6 +6580,15 @@ func decodeStopPollResponse(resp *http.Response) (res *ResultPoll, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_test_format/oas_response_decoders_gen.go b/examples/ex_test_format/oas_response_decoders_gen.go index 916b3acf5..28455d34e 100644 --- a/examples/ex_test_format/oas_response_decoders_gen.go +++ b/examples/ex_test_format/oas_response_decoders_gen.go @@ -3,6 +3,7 @@ package api import ( + "fmt" "io" "mime" "net/http" @@ -27495,6 +27496,15 @@ func decodeTestResponseBooleanArrayResponse(resp *http.Response) (res []bool, _ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -27554,6 +27564,32 @@ func decodeTestResponseBooleanArrayArrayResponse(resp *http.Response) (res [][]b } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -27644,6 +27680,15 @@ func decodeTestResponseBooleanNullableArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -27701,6 +27746,32 @@ func decodeTestResponseBooleanNullableArrayArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -27783,6 +27854,15 @@ func decodeTestResponseFormatTestResponse(resp *http.Response) (res *TestRespons } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -27877,6 +27957,15 @@ func decodeTestResponseIntegerArrayResponse(resp *http.Response) (res []int, _ e } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -27936,6 +28025,32 @@ func decodeTestResponseIntegerArrayArrayResponse(resp *http.Response) (res [][]i } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28030,6 +28145,15 @@ func decodeTestResponseIntegerInt16ArrayResponse(resp *http.Response) (res []int } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28089,6 +28213,32 @@ func decodeTestResponseIntegerInt16ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28179,6 +28329,15 @@ func decodeTestResponseIntegerInt16NullableArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28236,6 +28395,32 @@ func decodeTestResponseIntegerInt16NullableArrayArrayResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28330,6 +28515,15 @@ func decodeTestResponseIntegerInt32ArrayResponse(resp *http.Response) (res []int } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28389,6 +28583,32 @@ func decodeTestResponseIntegerInt32ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28479,6 +28699,15 @@ func decodeTestResponseIntegerInt32NullableArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28536,6 +28765,32 @@ func decodeTestResponseIntegerInt32NullableArrayArrayResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28630,6 +28885,15 @@ func decodeTestResponseIntegerInt64ArrayResponse(resp *http.Response) (res []int } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28689,6 +28953,32 @@ func decodeTestResponseIntegerInt64ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28779,6 +29069,15 @@ func decodeTestResponseIntegerInt64NullableArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28836,6 +29135,32 @@ func decodeTestResponseIntegerInt64NullableArrayArrayResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28930,6 +29255,15 @@ func decodeTestResponseIntegerInt8ArrayResponse(resp *http.Response) (res []int8 } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -28989,6 +29323,32 @@ func decodeTestResponseIntegerInt8ArrayArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29079,6 +29439,15 @@ func decodeTestResponseIntegerInt8NullableArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29136,6 +29505,32 @@ func decodeTestResponseIntegerInt8NullableArrayArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29226,6 +29621,15 @@ func decodeTestResponseIntegerNullableArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29283,6 +29687,32 @@ func decodeTestResponseIntegerNullableArrayArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29420,6 +29850,15 @@ func decodeTestResponseIntegerUint16ArrayResponse(resp *http.Response) (res []ui } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29479,6 +29918,32 @@ func decodeTestResponseIntegerUint16ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29569,6 +30034,15 @@ func decodeTestResponseIntegerUint16NullableArrayResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29626,6 +30100,32 @@ func decodeTestResponseIntegerUint16NullableArrayArrayResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29720,6 +30220,15 @@ func decodeTestResponseIntegerUint32ArrayResponse(resp *http.Response) (res []ui } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29779,6 +30288,32 @@ func decodeTestResponseIntegerUint32ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29869,6 +30404,15 @@ func decodeTestResponseIntegerUint32NullableArrayResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -29926,6 +30470,32 @@ func decodeTestResponseIntegerUint32NullableArrayArrayResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30020,6 +30590,15 @@ func decodeTestResponseIntegerUint64ArrayResponse(resp *http.Response) (res []ui } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30079,6 +30658,32 @@ func decodeTestResponseIntegerUint64ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30169,6 +30774,15 @@ func decodeTestResponseIntegerUint64NullableArrayResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30226,6 +30840,32 @@ func decodeTestResponseIntegerUint64NullableArrayArrayResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30320,6 +30960,15 @@ func decodeTestResponseIntegerUint8ArrayResponse(resp *http.Response) (res []uin } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30379,6 +31028,32 @@ func decodeTestResponseIntegerUint8ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30469,6 +31144,15 @@ func decodeTestResponseIntegerUint8NullableArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30526,6 +31210,32 @@ func decodeTestResponseIntegerUint8NullableArrayArrayResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30577,6 +31287,15 @@ func decodeTestResponseIntegerUintArrayResponse(resp *http.Response) (res []uint } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30636,6 +31355,32 @@ func decodeTestResponseIntegerUintArrayArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30726,6 +31471,15 @@ func decodeTestResponseIntegerUintNullableArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30783,6 +31537,32 @@ func decodeTestResponseIntegerUintNullableArrayArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30877,6 +31657,15 @@ func decodeTestResponseIntegerUnixArrayResponse(resp *http.Response) (res []time } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -30936,6 +31725,32 @@ func decodeTestResponseIntegerUnixArrayArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31030,6 +31845,15 @@ func decodeTestResponseIntegerUnixMicroArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31089,6 +31913,32 @@ func decodeTestResponseIntegerUnixMicroArrayArrayResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31179,6 +32029,15 @@ func decodeTestResponseIntegerUnixMicroNullableArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31236,6 +32095,32 @@ func decodeTestResponseIntegerUnixMicroNullableArrayArrayResponse(resp *http.Res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31330,6 +32215,15 @@ func decodeTestResponseIntegerUnixMilliArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31389,6 +32283,32 @@ func decodeTestResponseIntegerUnixMilliArrayArrayResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31479,6 +32399,15 @@ func decodeTestResponseIntegerUnixMilliNullableArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31536,6 +32465,32 @@ func decodeTestResponseIntegerUnixMilliNullableArrayArrayResponse(resp *http.Res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31630,6 +32585,15 @@ func decodeTestResponseIntegerUnixNanoArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31689,6 +32653,32 @@ func decodeTestResponseIntegerUnixNanoArrayArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31779,6 +32769,15 @@ func decodeTestResponseIntegerUnixNanoNullableArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31836,6 +32835,32 @@ func decodeTestResponseIntegerUnixNanoNullableArrayArrayResponse(resp *http.Resp } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31926,6 +32951,15 @@ func decodeTestResponseIntegerUnixNullableArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -31983,6 +33017,32 @@ func decodeTestResponseIntegerUnixNullableArrayArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32077,6 +33137,15 @@ func decodeTestResponseIntegerUnixSecondsArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32136,6 +33205,32 @@ func decodeTestResponseIntegerUnixSecondsArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32226,6 +33321,15 @@ func decodeTestResponseIntegerUnixSecondsNullableArrayResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32283,6 +33387,32 @@ func decodeTestResponseIntegerUnixSecondsNullableArrayArrayResponse(resp *http.R } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32373,6 +33503,15 @@ func decodeTestResponseNullArrayResponse(resp *http.Response) (res []struct{}, _ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32430,6 +33569,32 @@ func decodeTestResponseNullArrayArrayResponse(resp *http.Response) (res [][]stru } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32520,6 +33685,15 @@ func decodeTestResponseNullNullableArrayResponse(resp *http.Response) (res []str } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32577,6 +33751,32 @@ func decodeTestResponseNullNullableArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32620,6 +33820,15 @@ func decodeTestResponseNumberResponse(resp *http.Response) (res float64, _ error } return res, err } + // Validate response. + if err := func() error { + if err := (validate.Float{}).Validate(float64(response)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32671,6 +33880,32 @@ func decodeTestResponseNumberArrayResponse(resp *http.Response) (res []float64, } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := (validate.Float{}).Validate(float64(elem)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32730,6 +33965,49 @@ func decodeTestResponseNumberArrayArrayResponse(resp *http.Response) (res [][]fl } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if err := (validate.Float{}).Validate(float64(elem)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32773,6 +34051,15 @@ func decodeTestResponseNumberDoubleResponse(resp *http.Response) (res float64, _ } return res, err } + // Validate response. + if err := func() error { + if err := (validate.Float{}).Validate(float64(response)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32824,6 +34111,32 @@ func decodeTestResponseNumberDoubleArrayResponse(resp *http.Response) (res []flo } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := (validate.Float{}).Validate(float64(elem)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32883,6 +34196,49 @@ func decodeTestResponseNumberDoubleArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if err := (validate.Float{}).Validate(float64(elem)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32924,6 +34280,22 @@ func decodeTestResponseNumberDoubleNullableResponse(resp *http.Response) (res Ni } return res, err } + // Validate response. + if err := func() error { + if value, ok := response.Get(); ok { + if err := func() error { + if err := (validate.Float{}).Validate(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -32973,6 +34345,39 @@ func decodeTestResponseNumberDoubleNullableArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.Float{}).Validate(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33030,6 +34435,56 @@ func decodeTestResponseNumberDoubleNullableArrayArrayResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.Float{}).Validate(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33073,6 +34528,15 @@ func decodeTestResponseNumberFloatResponse(resp *http.Response) (res float32, _ } return res, err } + // Validate response. + if err := func() error { + if err := (validate.Float{}).Validate(float64(response)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33124,6 +34588,32 @@ func decodeTestResponseNumberFloatArrayResponse(resp *http.Response) (res []floa } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := (validate.Float{}).Validate(float64(elem)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33183,6 +34673,49 @@ func decodeTestResponseNumberFloatArrayArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if err := (validate.Float{}).Validate(float64(elem)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33224,6 +34757,22 @@ func decodeTestResponseNumberFloatNullableResponse(resp *http.Response) (res Nil } return res, err } + // Validate response. + if err := func() error { + if value, ok := response.Get(); ok { + if err := func() error { + if err := (validate.Float{}).Validate(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33273,6 +34822,39 @@ func decodeTestResponseNumberFloatNullableArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.Float{}).Validate(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33330,6 +34912,56 @@ func decodeTestResponseNumberFloatNullableArrayArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.Float{}).Validate(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33424,6 +35056,15 @@ func decodeTestResponseNumberInt32ArrayResponse(resp *http.Response) (res []int3 } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33483,6 +35124,32 @@ func decodeTestResponseNumberInt32ArrayArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33573,6 +35240,15 @@ func decodeTestResponseNumberInt32NullableArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33630,6 +35306,32 @@ func decodeTestResponseNumberInt32NullableArrayArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33724,6 +35426,15 @@ func decodeTestResponseNumberInt64ArrayResponse(resp *http.Response) (res []int6 } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33783,6 +35494,32 @@ func decodeTestResponseNumberInt64ArrayArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33873,6 +35610,15 @@ func decodeTestResponseNumberInt64NullableArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33930,6 +35676,32 @@ func decodeTestResponseNumberInt64NullableArrayArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -33971,6 +35743,22 @@ func decodeTestResponseNumberNullableResponse(resp *http.Response) (res NilFloat } return res, err } + // Validate response. + if err := func() error { + if value, ok := response.Get(); ok { + if err := func() error { + if err := (validate.Float{}).Validate(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34020,6 +35808,39 @@ func decodeTestResponseNumberNullableArrayResponse(resp *http.Response) (res []N } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.Float{}).Validate(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34077,6 +35898,56 @@ func decodeTestResponseNumberNullableArrayArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.Float{}).Validate(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34171,6 +36042,15 @@ func decodeTestResponseStringArrayResponse(resp *http.Response) (res []string, _ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34230,6 +36110,32 @@ func decodeTestResponseStringArrayArrayResponse(resp *http.Response) (res [][]st } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34324,6 +36230,15 @@ func decodeTestResponseStringBase64ArrayResponse(resp *http.Response) (res [][]b } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34383,6 +36298,32 @@ func decodeTestResponseStringBase64ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34477,6 +36418,15 @@ func decodeTestResponseStringBase64NullableArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34536,6 +36486,32 @@ func decodeTestResponseStringBase64NullableArrayArrayResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34630,6 +36606,15 @@ func decodeTestResponseStringBinaryArrayResponse(resp *http.Response) (res []str } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34689,6 +36674,32 @@ func decodeTestResponseStringBinaryArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34779,6 +36790,15 @@ func decodeTestResponseStringBinaryNullableArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34836,6 +36856,32 @@ func decodeTestResponseStringBinaryNullableArrayArrayResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34930,6 +36976,15 @@ func decodeTestResponseStringByteArrayResponse(resp *http.Response) (res [][]byt } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -34989,6 +37044,32 @@ func decodeTestResponseStringByteArrayArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35083,6 +37164,15 @@ func decodeTestResponseStringByteNullableArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35142,6 +37232,32 @@ func decodeTestResponseStringByteNullableArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35236,6 +37352,15 @@ func decodeTestResponseStringDateArrayResponse(resp *http.Response) (res []time. } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35295,6 +37420,32 @@ func decodeTestResponseStringDateArrayArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35385,6 +37536,15 @@ func decodeTestResponseStringDateNullableArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35442,6 +37602,32 @@ func decodeTestResponseStringDateNullableArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35536,6 +37722,15 @@ func decodeTestResponseStringDateTimeArrayResponse(resp *http.Response) (res []t } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35595,6 +37790,32 @@ func decodeTestResponseStringDateTimeArrayArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35685,6 +37906,15 @@ func decodeTestResponseStringDateTimeNullableArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35742,6 +37972,32 @@ func decodeTestResponseStringDateTimeNullableArrayArrayResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35836,6 +38092,15 @@ func decodeTestResponseStringDurationArrayResponse(resp *http.Response) (res []t } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35895,6 +38160,32 @@ func decodeTestResponseStringDurationArrayArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -35985,6 +38276,15 @@ func decodeTestResponseStringDurationNullableArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36042,6 +38342,32 @@ func decodeTestResponseStringDurationNullableArrayArrayResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36085,6 +38411,23 @@ func decodeTestResponseStringEmailResponse(resp *http.Response) (res string, _ e } return res, err } + // Validate response. + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: true, + Hostname: false, + Regex: nil, + }).Validate(string(response)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36136,6 +38479,40 @@ func decodeTestResponseStringEmailArrayResponse(resp *http.Response) (res []stri } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: true, + Hostname: false, + Regex: nil, + }).Validate(string(elem)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36195,6 +38572,57 @@ func decodeTestResponseStringEmailArrayArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: true, + Hostname: false, + Regex: nil, + }).Validate(string(elem)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36236,6 +38664,30 @@ func decodeTestResponseStringEmailNullableResponse(resp *http.Response) (res Nil } return res, err } + // Validate response. + if err := func() error { + if value, ok := response.Get(); ok { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: true, + Hostname: false, + Regex: nil, + }).Validate(string(value)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36285,6 +38737,47 @@ func decodeTestResponseStringEmailNullableArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: true, + Hostname: false, + Regex: nil, + }).Validate(string(value)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36342,6 +38835,64 @@ func decodeTestResponseStringEmailNullableArrayArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: true, + Hostname: false, + Regex: nil, + }).Validate(string(value)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36385,6 +38936,15 @@ func decodeTestResponseStringFloat32Response(resp *http.Response) (res float32, } return res, err } + // Validate response. + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(response)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36436,6 +38996,32 @@ func decodeTestResponseStringFloat32ArrayResponse(resp *http.Response) (res []fl } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(elem)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36495,6 +39081,49 @@ func decodeTestResponseStringFloat32ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(elem)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36536,6 +39165,22 @@ func decodeTestResponseStringFloat32NullableResponse(resp *http.Response) (res N } return res, err } + // Validate response. + if err := func() error { + if value, ok := response.Get(); ok { + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36585,6 +39230,39 @@ func decodeTestResponseStringFloat32NullableArrayResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36642,6 +39320,56 @@ func decodeTestResponseStringFloat32NullableArrayArrayResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36685,6 +39413,15 @@ func decodeTestResponseStringFloat64Response(resp *http.Response) (res float64, } return res, err } + // Validate response. + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(response)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36736,6 +39473,32 @@ func decodeTestResponseStringFloat64ArrayResponse(resp *http.Response) (res []fl } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(elem)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36795,6 +39558,49 @@ func decodeTestResponseStringFloat64ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(elem)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36836,6 +39642,22 @@ func decodeTestResponseStringFloat64NullableResponse(resp *http.Response) (res N } return res, err } + // Validate response. + if err := func() error { + if value, ok := response.Get(); ok { + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36885,6 +39707,39 @@ func decodeTestResponseStringFloat64NullableArrayResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36942,6 +39797,56 @@ func decodeTestResponseStringFloat64NullableArrayArrayResponse(resp *http.Respon } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.Float{}).ValidateStringified(float64(value)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -36985,6 +39890,23 @@ func decodeTestResponseStringHostnameResponse(resp *http.Response) (res string, } return res, err } + // Validate response. + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: true, + Regex: nil, + }).Validate(string(response)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37036,6 +39958,40 @@ func decodeTestResponseStringHostnameArrayResponse(resp *http.Response) (res []s } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: true, + Regex: nil, + }).Validate(string(elem)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37095,6 +40051,57 @@ func decodeTestResponseStringHostnameArrayArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: true, + Regex: nil, + }).Validate(string(elem)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37136,6 +40143,30 @@ func decodeTestResponseStringHostnameNullableResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if value, ok := response.Get(); ok { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: true, + Regex: nil, + }).Validate(string(value)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37185,6 +40216,47 @@ func decodeTestResponseStringHostnameNullableArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: true, + Regex: nil, + }).Validate(string(value)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37242,6 +40314,64 @@ func decodeTestResponseStringHostnameNullableArrayArrayResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range elem { + if err := func() error { + if value, ok := elem.Get(); ok { + if err := func() error { + if err := (validate.String{ + MinLength: 0, + MinLengthSet: false, + MaxLength: 0, + MaxLengthSet: false, + Email: false, + Hostname: true, + Regex: nil, + }).Validate(string(value)); err != nil { + return errors.Wrap(err, "string") + } + return nil + }(); err != nil { + return err + } + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37336,6 +40466,15 @@ func decodeTestResponseStringIPArrayResponse(resp *http.Response) (res []netip.A } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37395,6 +40534,32 @@ func decodeTestResponseStringIPArrayArrayResponse(resp *http.Response) (res [][] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37485,6 +40650,15 @@ func decodeTestResponseStringIPNullableArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37542,6 +40716,32 @@ func decodeTestResponseStringIPNullableArrayArrayResponse(resp *http.Response) ( } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37679,6 +40879,15 @@ func decodeTestResponseStringInt16ArrayResponse(resp *http.Response) (res []int1 } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37738,6 +40947,32 @@ func decodeTestResponseStringInt16ArrayArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37828,6 +41063,15 @@ func decodeTestResponseStringInt16NullableArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37885,6 +41129,32 @@ func decodeTestResponseStringInt16NullableArrayArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -37979,6 +41249,15 @@ func decodeTestResponseStringInt32ArrayResponse(resp *http.Response) (res []int3 } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38038,6 +41317,32 @@ func decodeTestResponseStringInt32ArrayArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38128,6 +41433,15 @@ func decodeTestResponseStringInt32NullableArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38185,6 +41499,32 @@ func decodeTestResponseStringInt32NullableArrayArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38279,6 +41619,15 @@ func decodeTestResponseStringInt64ArrayResponse(resp *http.Response) (res []int6 } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38338,6 +41687,32 @@ func decodeTestResponseStringInt64ArrayArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38428,6 +41803,15 @@ func decodeTestResponseStringInt64NullableArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38485,6 +41869,32 @@ func decodeTestResponseStringInt64NullableArrayArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38579,6 +41989,15 @@ func decodeTestResponseStringInt8ArrayResponse(resp *http.Response) (res []int8, } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38638,6 +42057,32 @@ func decodeTestResponseStringInt8ArrayArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38728,6 +42173,15 @@ func decodeTestResponseStringInt8NullableArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38785,6 +42239,32 @@ func decodeTestResponseStringInt8NullableArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38836,6 +42316,15 @@ func decodeTestResponseStringIntArrayResponse(resp *http.Response) (res []int, _ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38895,6 +42384,32 @@ func decodeTestResponseStringIntArrayArrayResponse(resp *http.Response) (res [][ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -38985,6 +42500,15 @@ func decodeTestResponseStringIntNullableArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39042,6 +42566,32 @@ func decodeTestResponseStringIntNullableArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39136,6 +42686,15 @@ func decodeTestResponseStringIpv4ArrayResponse(resp *http.Response) (res []netip } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39195,6 +42754,32 @@ func decodeTestResponseStringIpv4ArrayArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39285,6 +42870,15 @@ func decodeTestResponseStringIpv4NullableArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39342,6 +42936,32 @@ func decodeTestResponseStringIpv4NullableArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39436,6 +43056,15 @@ func decodeTestResponseStringIpv6ArrayResponse(resp *http.Response) (res []netip } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39495,6 +43124,32 @@ func decodeTestResponseStringIpv6ArrayArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39585,6 +43240,15 @@ func decodeTestResponseStringIpv6NullableArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39642,6 +43306,32 @@ func decodeTestResponseStringIpv6NullableArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39732,6 +43422,15 @@ func decodeTestResponseStringNullableArrayResponse(resp *http.Response) (res []N } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39789,6 +43488,32 @@ func decodeTestResponseStringNullableArrayArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39883,6 +43608,15 @@ func decodeTestResponseStringPasswordArrayResponse(resp *http.Response) (res []s } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -39942,6 +43676,32 @@ func decodeTestResponseStringPasswordArrayArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40032,6 +43792,15 @@ func decodeTestResponseStringPasswordNullableArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40089,6 +43858,32 @@ func decodeTestResponseStringPasswordNullableArrayArrayResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40183,6 +43978,15 @@ func decodeTestResponseStringTimeArrayResponse(resp *http.Response) (res []time. } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40242,6 +44046,32 @@ func decodeTestResponseStringTimeArrayArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40332,6 +44162,15 @@ func decodeTestResponseStringTimeNullableArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40389,6 +44228,32 @@ func decodeTestResponseStringTimeNullableArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40483,6 +44348,15 @@ func decodeTestResponseStringURIArrayResponse(resp *http.Response) (res []url.UR } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40542,6 +44416,32 @@ func decodeTestResponseStringURIArrayArrayResponse(resp *http.Response) (res [][ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40632,6 +44532,15 @@ func decodeTestResponseStringURINullableArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40689,6 +44598,32 @@ func decodeTestResponseStringURINullableArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40783,6 +44718,15 @@ func decodeTestResponseStringUUIDArrayResponse(resp *http.Response) (res []uuid. } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40842,6 +44786,32 @@ func decodeTestResponseStringUUIDArrayArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40932,6 +44902,15 @@ func decodeTestResponseStringUUIDNullableArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -40989,6 +44968,32 @@ func decodeTestResponseStringUUIDNullableArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41126,6 +45131,15 @@ func decodeTestResponseStringUint16ArrayResponse(resp *http.Response) (res []uin } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41185,6 +45199,32 @@ func decodeTestResponseStringUint16ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41275,6 +45315,15 @@ func decodeTestResponseStringUint16NullableArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41332,6 +45381,32 @@ func decodeTestResponseStringUint16NullableArrayArrayResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41426,6 +45501,15 @@ func decodeTestResponseStringUint32ArrayResponse(resp *http.Response) (res []uin } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41485,6 +45569,32 @@ func decodeTestResponseStringUint32ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41575,6 +45685,15 @@ func decodeTestResponseStringUint32NullableArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41632,6 +45751,32 @@ func decodeTestResponseStringUint32NullableArrayArrayResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41726,6 +45871,15 @@ func decodeTestResponseStringUint64ArrayResponse(resp *http.Response) (res []uin } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41785,6 +45939,32 @@ func decodeTestResponseStringUint64ArrayArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41875,6 +46055,15 @@ func decodeTestResponseStringUint64NullableArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -41932,6 +46121,32 @@ func decodeTestResponseStringUint64NullableArrayArrayResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42026,6 +46241,15 @@ func decodeTestResponseStringUint8ArrayResponse(resp *http.Response) (res []uint } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42085,6 +46309,32 @@ func decodeTestResponseStringUint8ArrayArrayResponse(resp *http.Response) (res [ } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42175,6 +46425,15 @@ func decodeTestResponseStringUint8NullableArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42232,6 +46491,32 @@ func decodeTestResponseStringUint8NullableArrayArrayResponse(resp *http.Response } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42283,6 +46568,15 @@ func decodeTestResponseStringUintArrayResponse(resp *http.Response) (res []uint, } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42342,6 +46636,32 @@ func decodeTestResponseStringUintArrayArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42432,6 +46752,15 @@ func decodeTestResponseStringUintNullableArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42489,6 +46818,32 @@ func decodeTestResponseStringUintNullableArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42583,6 +46938,15 @@ func decodeTestResponseStringUnixArrayResponse(resp *http.Response) (res []time. } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42642,6 +47006,32 @@ func decodeTestResponseStringUnixArrayArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42736,6 +47126,15 @@ func decodeTestResponseStringUnixMicroArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42795,6 +47194,32 @@ func decodeTestResponseStringUnixMicroArrayArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42885,6 +47310,15 @@ func decodeTestResponseStringUnixMicroNullableArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -42942,6 +47376,32 @@ func decodeTestResponseStringUnixMicroNullableArrayArrayResponse(resp *http.Resp } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43036,6 +47496,15 @@ func decodeTestResponseStringUnixMilliArrayResponse(resp *http.Response) (res [] } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43095,6 +47564,32 @@ func decodeTestResponseStringUnixMilliArrayArrayResponse(resp *http.Response) (r } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43185,6 +47680,15 @@ func decodeTestResponseStringUnixMilliNullableArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43242,6 +47746,32 @@ func decodeTestResponseStringUnixMilliNullableArrayArrayResponse(resp *http.Resp } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43336,6 +47866,15 @@ func decodeTestResponseStringUnixNanoArrayResponse(resp *http.Response) (res []t } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43395,6 +47934,32 @@ func decodeTestResponseStringUnixNanoArrayArrayResponse(resp *http.Response) (re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43485,6 +48050,15 @@ func decodeTestResponseStringUnixNanoNullableArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43542,6 +48116,32 @@ func decodeTestResponseStringUnixNanoNullableArrayArrayResponse(resp *http.Respo } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43632,6 +48232,15 @@ func decodeTestResponseStringUnixNullableArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43689,6 +48298,32 @@ func decodeTestResponseStringUnixNullableArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43783,6 +48418,15 @@ func decodeTestResponseStringUnixSecondsArrayResponse(resp *http.Response) (res } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43842,6 +48486,32 @@ func decodeTestResponseStringUnixSecondsArrayArrayResponse(resp *http.Response) } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43932,6 +48602,15 @@ func decodeTestResponseStringUnixSecondsNullableArrayResponse(resp *http.Respons } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -43989,6 +48668,32 @@ func decodeTestResponseStringUnixSecondsNullableArrayArrayResponse(resp *http.Re } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + var failures []validate.FieldError + for i, elem := range response { + if err := func() error { + if elem == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: fmt.Sprintf("[%d]", i), + Error: err, + }) + } + } + if len(failures) > 0 { + return &validate.Error{Fields: failures} + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) diff --git a/examples/ex_tinkoff/oas_response_decoders_gen.go b/examples/ex_tinkoff/oas_response_decoders_gen.go index 4809b1687..9a010500f 100644 --- a/examples/ex_tinkoff/oas_response_decoders_gen.go +++ b/examples/ex_tinkoff/oas_response_decoders_gen.go @@ -47,6 +47,15 @@ func decodeMarketBondsGetResponse(resp *http.Response) (res MarketBondsGetRes, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -123,6 +132,15 @@ func decodeMarketCandlesGetResponse(resp *http.Response) (res MarketCandlesGetRe } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -199,6 +217,15 @@ func decodeMarketCurrenciesGetResponse(resp *http.Response) (res MarketCurrencie } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -275,6 +302,15 @@ func decodeMarketEtfsGetResponse(resp *http.Response) (res MarketEtfsGetRes, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -351,6 +387,15 @@ func decodeMarketOrderbookGetResponse(resp *http.Response) (res MarketOrderbookG } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -427,6 +472,15 @@ func decodeMarketSearchByFigiGetResponse(resp *http.Response) (res MarketSearchB } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -503,6 +557,15 @@ func decodeMarketSearchByTickerGetResponse(resp *http.Response) (res MarketSearc } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -579,6 +642,15 @@ func decodeMarketStocksGetResponse(resp *http.Response) (res MarketStocksGetRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -655,6 +727,15 @@ func decodeOperationsGetResponse(resp *http.Response) (res OperationsGetRes, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -807,6 +888,15 @@ func decodeOrdersGetResponse(resp *http.Response) (res OrdersGetRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -883,6 +973,15 @@ func decodeOrdersLimitOrderPostResponse(resp *http.Response) (res OrdersLimitOrd } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -959,6 +1058,15 @@ func decodeOrdersMarketOrderPostResponse(resp *http.Response) (res OrdersMarketO } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1035,6 +1143,15 @@ func decodePortfolioCurrenciesGetResponse(resp *http.Response) (res PortfolioCur } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1111,6 +1228,15 @@ func decodePortfolioGetResponse(resp *http.Response) (res PortfolioGetRes, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1415,6 +1541,15 @@ func decodeSandboxRegisterPostResponse(resp *http.Response) (res SandboxRegister } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1567,6 +1702,15 @@ func decodeUserAccountsGetResponse(resp *http.Response) (res UserAccountsGetRes, } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/internal/integration/sample_api/oas_response_decoders_gen.go b/internal/integration/sample_api/oas_response_decoders_gen.go index 5f1108161..4f3915a85 100644 --- a/internal/integration/sample_api/oas_response_decoders_gen.go +++ b/internal/integration/sample_api/oas_response_decoders_gen.go @@ -180,6 +180,15 @@ func decodeFoobarGetResponse(resp *http.Response) (res FoobarGetRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -224,6 +233,15 @@ func decodeFoobarPostResponse(resp *http.Response) (res FoobarPostRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -460,6 +478,15 @@ func decodePetCreateResponse(resp *http.Response) (res *Pet, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -511,6 +538,15 @@ func decodePetFriendsNamesByIDResponse(resp *http.Response) (res []string, _ err } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -552,6 +588,15 @@ func decodePetGetResponse(resp *http.Response) (res PetGetRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -775,6 +820,15 @@ func decodePetGetByNameResponse(resp *http.Response) (res *Pet, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -939,6 +993,15 @@ func decodeRecursiveArrayGetResponse(resp *http.Response) (res RecursiveArray, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -1155,6 +1218,15 @@ func decodeTestNullableOneofsResponse(resp *http.Response) (res TestNullableOneo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1190,6 +1262,15 @@ func decodeTestNullableOneofsResponse(resp *http.Response) (res TestNullableOneo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1225,6 +1306,15 @@ func decodeTestNullableOneofsResponse(resp *http.Response) (res TestNullableOneo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1266,6 +1356,15 @@ func decodeTestTupleResponse(resp *http.Response) (res *TupleTest, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1307,6 +1406,15 @@ func decodeTestTupleNamedResponse(resp *http.Response) (res *TupleNamedTest, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1348,6 +1456,15 @@ func decodeTestUniqueItemsResponse(resp *http.Response) (res *UniqueItemsTest, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/internal/integration/sample_api_ns/oas_response_decoders_gen.go b/internal/integration/sample_api_ns/oas_response_decoders_gen.go index 5f1108161..4f3915a85 100644 --- a/internal/integration/sample_api_ns/oas_response_decoders_gen.go +++ b/internal/integration/sample_api_ns/oas_response_decoders_gen.go @@ -180,6 +180,15 @@ func decodeFoobarGetResponse(resp *http.Response) (res FoobarGetRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -224,6 +233,15 @@ func decodeFoobarPostResponse(resp *http.Response) (res FoobarPostRes, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -460,6 +478,15 @@ func decodePetCreateResponse(resp *http.Response) (res *Pet, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -511,6 +538,15 @@ func decodePetFriendsNamesByIDResponse(resp *http.Response) (res []string, _ err } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -552,6 +588,15 @@ func decodePetGetResponse(resp *http.Response) (res PetGetRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -775,6 +820,15 @@ func decodePetGetByNameResponse(resp *http.Response) (res *Pet, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -939,6 +993,15 @@ func decodeRecursiveArrayGetResponse(resp *http.Response) (res RecursiveArray, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -1155,6 +1218,15 @@ func decodeTestNullableOneofsResponse(resp *http.Response) (res TestNullableOneo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1190,6 +1262,15 @@ func decodeTestNullableOneofsResponse(resp *http.Response) (res TestNullableOneo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1225,6 +1306,15 @@ func decodeTestNullableOneofsResponse(resp *http.Response) (res TestNullableOneo } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1266,6 +1356,15 @@ func decodeTestTupleResponse(resp *http.Response) (res *TupleTest, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1307,6 +1406,15 @@ func decodeTestTupleNamedResponse(resp *http.Response) (res *TupleNamedTest, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -1348,6 +1456,15 @@ func decodeTestUniqueItemsResponse(resp *http.Response) (res *UniqueItemsTest, _ } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/internal/integration/techempower/oas_response_decoders_gen.go b/internal/integration/techempower/oas_response_decoders_gen.go index 848fc016a..0fafe12ff 100644 --- a/internal/integration/techempower/oas_response_decoders_gen.go +++ b/internal/integration/techempower/oas_response_decoders_gen.go @@ -47,6 +47,15 @@ func decodeCachingResponse(resp *http.Response) (res WorldObjects, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -170,6 +179,15 @@ func decodeQueriesResponse(resp *http.Response) (res WorldObjects, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) @@ -211,6 +229,15 @@ func decodeUpdatesResponse(resp *http.Response) (res WorldObjects, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) diff --git a/internal/integration/test_anyof/oas_response_decoders_gen.go b/internal/integration/test_anyof/oas_response_decoders_gen.go index db83d2593..5ff700e74 100644 --- a/internal/integration/test_anyof/oas_response_decoders_gen.go +++ b/internal/integration/test_anyof/oas_response_decoders_gen.go @@ -47,6 +47,15 @@ func decodeIntegerNumberResponse(resp *http.Response) (res *IntegerNumber, _ err } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -88,6 +97,15 @@ func decodeJaegerAnyOfResponse(resp *http.Response) (res *JaegerAnyOf, _ error) } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) @@ -129,6 +147,15 @@ func decodeOneUUIDResponse(resp *http.Response) (res *OneUUID, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/internal/integration/test_enum_naming/oas_response_decoders_gen.go b/internal/integration/test_enum_naming/oas_response_decoders_gen.go index 2856864cd..a7bf39963 100644 --- a/internal/integration/test_enum_naming/oas_response_decoders_gen.go +++ b/internal/integration/test_enum_naming/oas_response_decoders_gen.go @@ -47,6 +47,15 @@ func decodeProbeLivenessResponse(resp *http.Response) (res *ProbeLivenessOK, _ e } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/internal/integration/test_form/oas_response_decoders_gen.go b/internal/integration/test_form/oas_response_decoders_gen.go index 15189e5b3..bfdbcac4b 100644 --- a/internal/integration/test_form/oas_response_decoders_gen.go +++ b/internal/integration/test_form/oas_response_decoders_gen.go @@ -92,6 +92,15 @@ func decodeTestMultipartUploadResponse(resp *http.Response) (res *TestMultipartU } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/internal/integration/test_http_requests/oas_response_decoders_gen.go b/internal/integration/test_http_requests/oas_response_decoders_gen.go index 6179d266d..ae08dcda4 100644 --- a/internal/integration/test_http_requests/oas_response_decoders_gen.go +++ b/internal/integration/test_http_requests/oas_response_decoders_gen.go @@ -208,6 +208,15 @@ func decodeStreamJSONResponse(resp *http.Response) (res float64, _ error) { } return res, err } + // Validate response. + if err := func() error { + if err := (validate.Float{}).Validate(float64(response)); err != nil { + return errors.Wrap(err, "float") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return response, nil default: return res, validate.InvalidContentType(ct) diff --git a/internal/integration/test_http_responses/oas_response_decoders_gen.go b/internal/integration/test_http_responses/oas_response_decoders_gen.go index 25a9a507b..c7a9a8a31 100644 --- a/internal/integration/test_http_responses/oas_response_decoders_gen.go +++ b/internal/integration/test_http_responses/oas_response_decoders_gen.go @@ -246,6 +246,15 @@ func decodeCombinedResponse(resp *http.Response) (res CombinedRes, _ error) { } return res, err } + // Validate response. + if err := func() error { + if response == nil { + return errors.New("nil is invalid value") + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &CombinedDefStatusCode{ StatusCode: resp.StatusCode, Response: response, @@ -936,6 +945,15 @@ func decodeStreamJSONResponse(resp *http.Response) (res StreamJSONRes, _ error) }(); err != nil { return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct) diff --git a/internal/integration/test_parameters/oas_response_decoders_gen.go b/internal/integration/test_parameters/oas_response_decoders_gen.go index a414fcd2b..d7aa033b8 100644 --- a/internal/integration/test_parameters/oas_response_decoders_gen.go +++ b/internal/integration/test_parameters/oas_response_decoders_gen.go @@ -56,6 +56,15 @@ func decodeContentParametersResponse(resp *http.Response) (res *ContentParameter } return res, err } + // Validate response. + if err := func() error { + if err := response.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + return res, errors.Wrap(err, "validate") + } return &response, nil default: return res, validate.InvalidContentType(ct)