diff --git a/contributors b/contributors new file mode 100644 index 00000000000..6f9a0ebd504 --- /dev/null +++ b/contributors @@ -0,0 +1,265 @@ +# contributors generated by `make contributors` + +115100 <115100@users.noreply.github.com> +abusaidm +Ackermann Yuriy +Aeneas +Aeneas +Aeneas +aeneasr <3372410+aeneasr@users.noreply.github.com> +aeneasr +aeneasr +aeneasr +Aeneas Rekkas +Aeneas Rekkas (arekkas) +Ajanthan +Akbar Uddin Kashif +Alano Terblanche +Alexander Widerberg +Alexander Widerberg +Allan Simon +Amaan Iqbal +Amir Aslaminejad +Amir Aslaminejad +Andreas Litt +André Filipe +Ankit Singh +Ante Mihalj +Anton Samoylenko +arapaho +arekkas +arekkas +Aritz Berasarte +Arkady Bagdasarov <56913719+arkady-bagdasarov@users.noreply.github.com> +Artem Yarmoliuk +Arthur Knoepflin +arunas-ka +aspeteRakete +Atallah khedrane +BastianHofmann +Benjamin Tanone +Ben Scholzen +Bernat Mut <1116133+monwolf@users.noreply.github.com> +bfrisbie-brex <63267486+bfrisbie-brex@users.noreply.github.com> +Bhargav SNV <44526455+Gituser143@users.noreply.github.com> +Brandon Philips +Brian <20056195+coopbri@users.noreply.github.com> +Brian Teller +Bruno Bigras +Bruno Heridet +catper <60221155+catper@users.noreply.github.com> +cherrymu +Christian Dreier +Christian Skovholm +clausdenk +Corey Burmeister +Dallan Quass +Damien Bravin +Daniel Jiménez +Daniel Schellhorn +Daniel Shuy +Daniel Sutton +darron froese +Dave Kushner <1289314+dkushner@users.noreply.github.com> +David +David Lobe +David López +David +David Wilkins +debrutal +DennisPattmann5012 <44261569+DennisPattmann5012@users.noreply.github.com> +Dexter Chua +dharmendraImprowised <72780358+DKImprowised@users.noreply.github.com> +Dibyajyoti Behera +Dimitrij Drus +Dimitrij Drus +Divyansh Bansal +Dmitry +Dmitry Dolbik +ducksecops +Edward Wilde +emil +Eric Douglas +Euan Kemp +fazal +fazal +Felix Jung +Flavio Leggio +Flori <40140792+fl0lli@users.noreply.github.com> +Frank Felhoffer +Furkan +Gajewski Dmitriy +Genchi +George Bolo +Gilbert Gilb's +Gorka Lerchundi Osa +Grant Zvolsky +Grant Zvolský +Greg Woodcock +Grigory +hackerman <3372410+aeneasr@users.noreply.github.com> +hackerman +Hans +Harsimran Singh Maan +Helmuth Bederna <25813283+IonFoXx@users.noreply.github.com> +Hendrik Heil +hisamura333 <0aw2794w78t0b4c@ezweb.ne.jp> +İbrahim Esen +Igor Zibarev +Imran Ismail +Iñigo +Iñigo +Jacek Symonowicz +Jakub Błaszczyk +Jakub Błaszczyk +James Elliott +jamesnicolas +Jamie Stackhouse +Jan Beckmann +Jan +Jay Linski +jayme-github +jess +jhuggett <59655877+jhuggett@users.noreply.github.com> +JiaLiPassion +Jimmy Stridh +Joao Carlos +Joao Carlos +Joel Pickup +John +John Wu +Josh Giles +Joshua Obasaju <41480580+obasajujoshua31@users.noreply.github.com> +Julian Tescher +Justin Clift +Kevin Minehart +khevse +Kim Neunert +Kishan B +kobayashilin +Kostya Lepa +Kunal Parikh +lauri +LemurP +Lennart Rosam +Louis Laureys +Lukasz Jagiello +Luke Stoward +Marco Hutzsch <39520486+marcohutzsch1234@users.noreply.github.com> +Masoud Tahmasebi +Matheus Moraes +Matt Bonnell <64976795+mbonnell-wish@users.noreply.github.com> +Matt Bonnell +Matt Drollette +Matteo Suppo +Matthew Fawcett +Matt Vinall +Matt Vinall +Maurizio +Maxime Song +Max Köhler +michaelwagler +Mitar +Mitar +mkontani +Moritz Lang +MOZGIII +Natalia +Nathan Mills +naveenpaul1 <79908956+naveenpaul1@users.noreply.github.com> +Neeraj +Nejcraft +nessita +Nestor +Nick Otter +NickUfer +Nick Ufer +Nikita Puzankov +NikolaySl +Nikolay Stupak +nishanth2143 +olFi95 +Olivier Deckers +Olivier Tremblay +ORY Continuous Integration +ORY Continuous Integration +ORY Continuous Integration +Oz Haven +Patrick Barker +Patrick Tescher +Patrik +Paul Harman +Petr Jediný +phi2039 +Philip Nicolcev <33558528+pnicolcev-tulipretail@users.noreply.github.com> +Philip Nicolcev +phiremande <16595434+phiremande@users.noreply.github.com> +Pierre-David Bélanger +pike1212 +pike1212 +prateek1192 <1192prateek@gmail.com> +Prateek Malhotra +Quentin Perez +Ricardo Iván Vieitez Parra <3857362+corrideat@users.noreply.github.com> +Richard Zana +Rich Wareham +rickwang7712 +RikiyaFujii +RNBack +robhinds +Rob Smith +Roman Lytvyn +Roman Minkin +Saad Tazi +sagarshah1983 +SaintMalik <37118134+saintmalik@users.noreply.github.com> +Samuele Lilli +Sawada Shota +sawadashota +Sawada Shota +seremenko-wish <60801091+seremenko-wish@users.noreply.github.com> +Shadaï ALI +Shane Starcher +Shankar Dhanasekaran +Shaurya Dhadwal +Shota SAWADA +Simon Lipp +Simon-Pierre Gingras <892367+spg@users.noreply.github.com> +simpleway +Smotrov Dmitriy +Stepan Rakitin +Stephan Renatus +Steve Kaliski +Sufijen Bani +Sven Neuhaus +The Gitter Badger +Thibault Doubliez +Thomas Aidan Curran +Thomas Aidan Curran +Thomas Recloux +Thomas Stewart +Thor Marius Henrichsen +TilmanTheile <50573074+TilmanTheile@users.noreply.github.com> +timothyknight +Tim Sazon +tutman96 <11356668+tutman96@users.noreply.github.com> +T Venu Madhav +tyaps +Vadim +vancity-amir <62674577+vancity-amir@users.noreply.github.com> +Vincent +Vinci Xu <277040271@qq.com> +vinckr +Vishesh Handa +Vitaly Migunov +wanderer163 <93438190+wanderer163@users.noreply.github.com> +Wei Cheng +Wojciech Kuźmiński <45849042+woojtek@users.noreply.github.com> +Wyatt Anderson +Yannick Heinrich +Yorman ����’.͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇͇Ỏ̷͖͈̞̩͎̻̫̫̜͉̠̫͕̭̭̫ ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎ +Yuki Hirasawa <48427044+hirasawayuki@users.noreply.github.com> +Zbigniew Mandziejewicz +zepatrik +zepatrik +巢鹏 diff --git a/internal/httpclient/client/admin/accept_consent_request_parameters.go b/internal/httpclient/client/admin/accept_consent_request_parameters.go index c573076321b..df23ce33395 100644 --- a/internal/httpclient/client/admin/accept_consent_request_parameters.go +++ b/internal/httpclient/client/admin/accept_consent_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewAcceptConsentRequestParams creates a new AcceptConsentRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewAcceptConsentRequestParams creates a new AcceptConsentRequestParams object +// with the default values initialized. func NewAcceptConsentRequestParams() *AcceptConsentRequestParams { + var () return &AcceptConsentRequestParams{ + timeout: cr.DefaultTimeout, } } // NewAcceptConsentRequestParamsWithTimeout creates a new AcceptConsentRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewAcceptConsentRequestParamsWithTimeout(timeout time.Duration) *AcceptConsentRequestParams { + var () return &AcceptConsentRequestParams{ + timeout: timeout, } } // NewAcceptConsentRequestParamsWithContext creates a new AcceptConsentRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewAcceptConsentRequestParamsWithContext(ctx context.Context) *AcceptConsentRequestParams { + var () return &AcceptConsentRequestParams{ + Context: ctx, } } // NewAcceptConsentRequestParamsWithHTTPClient creates a new AcceptConsentRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewAcceptConsentRequestParamsWithHTTPClient(client *http.Client) *AcceptConsentRequestParams { + var () return &AcceptConsentRequestParams{ HTTPClient: client, } } -/* AcceptConsentRequestParams contains all the parameters to send to the API endpoint - for the accept consent request operation. - - Typically these are written to a http.Request. +/*AcceptConsentRequestParams contains all the parameters to send to the API endpoint +for the accept consent request operation typically these are written to a http.Request */ type AcceptConsentRequestParams struct { - // Body. + /*Body*/ Body *models.AcceptConsentRequest - - // ConsentChallenge. + /*ConsentChallenge*/ ConsentChallenge string timeout time.Duration @@ -72,21 +72,6 @@ type AcceptConsentRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the accept consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptConsentRequestParams) WithDefaults() *AcceptConsentRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the accept consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptConsentRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the accept consent request params func (o *AcceptConsentRequestParams) WithTimeout(timeout time.Duration) *AcceptConsentRequestParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *AcceptConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -159,7 +145,6 @@ func (o *AcceptConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrConsentChallenge := o.ConsentChallenge qConsentChallenge := qrConsentChallenge if qConsentChallenge != "" { - if err := r.SetQueryParam("consent_challenge", qConsentChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/accept_consent_request_responses.go b/internal/httpclient/client/admin/accept_consent_request_responses.go index ca1d9bb992e..d192d9dd13d 100644 --- a/internal/httpclient/client/admin/accept_consent_request_responses.go +++ b/internal/httpclient/client/admin/accept_consent_request_responses.go @@ -41,8 +41,9 @@ func (o *AcceptConsentRequestReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewAcceptConsentRequestOK() *AcceptConsentRequestOK { return &AcceptConsentRequestOK{} } -/* AcceptConsentRequestOK describes a response with status code 200, with default header values. +/*AcceptConsentRequestOK handles this case with default header values. completedRequest */ @@ -62,6 +63,7 @@ type AcceptConsentRequestOK struct { func (o *AcceptConsentRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/accept][%d] acceptConsentRequestOK %+v", 200, o.Payload) } + func (o *AcceptConsentRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -83,7 +85,7 @@ func NewAcceptConsentRequestNotFound() *AcceptConsentRequestNotFound { return &AcceptConsentRequestNotFound{} } -/* AcceptConsentRequestNotFound describes a response with status code 404, with default header values. +/*AcceptConsentRequestNotFound handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type AcceptConsentRequestNotFound struct { func (o *AcceptConsentRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/accept][%d] acceptConsentRequestNotFound %+v", 404, o.Payload) } + func (o *AcceptConsentRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewAcceptConsentRequestInternalServerError() *AcceptConsentRequestInternalS return &AcceptConsentRequestInternalServerError{} } -/* AcceptConsentRequestInternalServerError describes a response with status code 500, with default header values. +/*AcceptConsentRequestInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type AcceptConsentRequestInternalServerError struct { func (o *AcceptConsentRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/accept][%d] acceptConsentRequestInternalServerError %+v", 500, o.Payload) } + func (o *AcceptConsentRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/accept_login_request_parameters.go b/internal/httpclient/client/admin/accept_login_request_parameters.go index ad0c47b0d30..20d130fc490 100644 --- a/internal/httpclient/client/admin/accept_login_request_parameters.go +++ b/internal/httpclient/client/admin/accept_login_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewAcceptLoginRequestParams creates a new AcceptLoginRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewAcceptLoginRequestParams creates a new AcceptLoginRequestParams object +// with the default values initialized. func NewAcceptLoginRequestParams() *AcceptLoginRequestParams { + var () return &AcceptLoginRequestParams{ + timeout: cr.DefaultTimeout, } } // NewAcceptLoginRequestParamsWithTimeout creates a new AcceptLoginRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewAcceptLoginRequestParamsWithTimeout(timeout time.Duration) *AcceptLoginRequestParams { + var () return &AcceptLoginRequestParams{ + timeout: timeout, } } // NewAcceptLoginRequestParamsWithContext creates a new AcceptLoginRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewAcceptLoginRequestParamsWithContext(ctx context.Context) *AcceptLoginRequestParams { + var () return &AcceptLoginRequestParams{ + Context: ctx, } } // NewAcceptLoginRequestParamsWithHTTPClient creates a new AcceptLoginRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewAcceptLoginRequestParamsWithHTTPClient(client *http.Client) *AcceptLoginRequestParams { + var () return &AcceptLoginRequestParams{ HTTPClient: client, } } -/* AcceptLoginRequestParams contains all the parameters to send to the API endpoint - for the accept login request operation. - - Typically these are written to a http.Request. +/*AcceptLoginRequestParams contains all the parameters to send to the API endpoint +for the accept login request operation typically these are written to a http.Request */ type AcceptLoginRequestParams struct { - // Body. + /*Body*/ Body *models.AcceptLoginRequest - - // LoginChallenge. + /*LoginChallenge*/ LoginChallenge string timeout time.Duration @@ -72,21 +72,6 @@ type AcceptLoginRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the accept login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptLoginRequestParams) WithDefaults() *AcceptLoginRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the accept login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptLoginRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the accept login request params func (o *AcceptLoginRequestParams) WithTimeout(timeout time.Duration) *AcceptLoginRequestParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *AcceptLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -159,7 +145,6 @@ func (o *AcceptLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s qrLoginChallenge := o.LoginChallenge qLoginChallenge := qrLoginChallenge if qLoginChallenge != "" { - if err := r.SetQueryParam("login_challenge", qLoginChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/accept_login_request_responses.go b/internal/httpclient/client/admin/accept_login_request_responses.go index a92b31dee21..7f4b5a71e50 100644 --- a/internal/httpclient/client/admin/accept_login_request_responses.go +++ b/internal/httpclient/client/admin/accept_login_request_responses.go @@ -53,8 +53,9 @@ func (o *AcceptLoginRequestReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -63,7 +64,7 @@ func NewAcceptLoginRequestOK() *AcceptLoginRequestOK { return &AcceptLoginRequestOK{} } -/* AcceptLoginRequestOK describes a response with status code 200, with default header values. +/*AcceptLoginRequestOK handles this case with default header values. completedRequest */ @@ -74,6 +75,7 @@ type AcceptLoginRequestOK struct { func (o *AcceptLoginRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestOK %+v", 200, o.Payload) } + func (o *AcceptLoginRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -95,7 +97,7 @@ func NewAcceptLoginRequestBadRequest() *AcceptLoginRequestBadRequest { return &AcceptLoginRequestBadRequest{} } -/* AcceptLoginRequestBadRequest describes a response with status code 400, with default header values. +/*AcceptLoginRequestBadRequest handles this case with default header values. jsonError */ @@ -106,6 +108,7 @@ type AcceptLoginRequestBadRequest struct { func (o *AcceptLoginRequestBadRequest) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestBadRequest %+v", 400, o.Payload) } + func (o *AcceptLoginRequestBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -127,7 +130,7 @@ func NewAcceptLoginRequestUnauthorized() *AcceptLoginRequestUnauthorized { return &AcceptLoginRequestUnauthorized{} } -/* AcceptLoginRequestUnauthorized describes a response with status code 401, with default header values. +/*AcceptLoginRequestUnauthorized handles this case with default header values. jsonError */ @@ -138,6 +141,7 @@ type AcceptLoginRequestUnauthorized struct { func (o *AcceptLoginRequestUnauthorized) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestUnauthorized %+v", 401, o.Payload) } + func (o *AcceptLoginRequestUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -159,7 +163,7 @@ func NewAcceptLoginRequestNotFound() *AcceptLoginRequestNotFound { return &AcceptLoginRequestNotFound{} } -/* AcceptLoginRequestNotFound describes a response with status code 404, with default header values. +/*AcceptLoginRequestNotFound handles this case with default header values. jsonError */ @@ -170,6 +174,7 @@ type AcceptLoginRequestNotFound struct { func (o *AcceptLoginRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestNotFound %+v", 404, o.Payload) } + func (o *AcceptLoginRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -191,7 +196,7 @@ func NewAcceptLoginRequestInternalServerError() *AcceptLoginRequestInternalServe return &AcceptLoginRequestInternalServerError{} } -/* AcceptLoginRequestInternalServerError describes a response with status code 500, with default header values. +/*AcceptLoginRequestInternalServerError handles this case with default header values. jsonError */ @@ -202,6 +207,7 @@ type AcceptLoginRequestInternalServerError struct { func (o *AcceptLoginRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/accept][%d] acceptLoginRequestInternalServerError %+v", 500, o.Payload) } + func (o *AcceptLoginRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/accept_logout_request_parameters.go b/internal/httpclient/client/admin/accept_logout_request_parameters.go index aa8727c2724..f5f48782535 100644 --- a/internal/httpclient/client/admin/accept_logout_request_parameters.go +++ b/internal/httpclient/client/admin/accept_logout_request_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewAcceptLogoutRequestParams creates a new AcceptLogoutRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewAcceptLogoutRequestParams creates a new AcceptLogoutRequestParams object +// with the default values initialized. func NewAcceptLogoutRequestParams() *AcceptLogoutRequestParams { + var () return &AcceptLogoutRequestParams{ + timeout: cr.DefaultTimeout, } } // NewAcceptLogoutRequestParamsWithTimeout creates a new AcceptLogoutRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewAcceptLogoutRequestParamsWithTimeout(timeout time.Duration) *AcceptLogoutRequestParams { + var () return &AcceptLogoutRequestParams{ + timeout: timeout, } } // NewAcceptLogoutRequestParamsWithContext creates a new AcceptLogoutRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewAcceptLogoutRequestParamsWithContext(ctx context.Context) *AcceptLogoutRequestParams { + var () return &AcceptLogoutRequestParams{ + Context: ctx, } } // NewAcceptLogoutRequestParamsWithHTTPClient creates a new AcceptLogoutRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewAcceptLogoutRequestParamsWithHTTPClient(client *http.Client) *AcceptLogoutRequestParams { + var () return &AcceptLogoutRequestParams{ HTTPClient: client, } } -/* AcceptLogoutRequestParams contains all the parameters to send to the API endpoint - for the accept logout request operation. - - Typically these are written to a http.Request. +/*AcceptLogoutRequestParams contains all the parameters to send to the API endpoint +for the accept logout request operation typically these are written to a http.Request */ type AcceptLogoutRequestParams struct { - // LogoutChallenge. + /*LogoutChallenge*/ LogoutChallenge string timeout time.Duration @@ -67,21 +68,6 @@ type AcceptLogoutRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the accept logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptLogoutRequestParams) WithDefaults() *AcceptLogoutRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the accept logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AcceptLogoutRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the accept logout request params func (o *AcceptLogoutRequestParams) WithTimeout(timeout time.Duration) *AcceptLogoutRequestParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *AcceptLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrLogoutChallenge := o.LogoutChallenge qLogoutChallenge := qrLogoutChallenge if qLogoutChallenge != "" { - if err := r.SetQueryParam("logout_challenge", qLogoutChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/accept_logout_request_responses.go b/internal/httpclient/client/admin/accept_logout_request_responses.go index 4ce46f91696..6cc29964d49 100644 --- a/internal/httpclient/client/admin/accept_logout_request_responses.go +++ b/internal/httpclient/client/admin/accept_logout_request_responses.go @@ -41,8 +41,9 @@ func (o *AcceptLogoutRequestReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewAcceptLogoutRequestOK() *AcceptLogoutRequestOK { return &AcceptLogoutRequestOK{} } -/* AcceptLogoutRequestOK describes a response with status code 200, with default header values. +/*AcceptLogoutRequestOK handles this case with default header values. completedRequest */ @@ -62,6 +63,7 @@ type AcceptLogoutRequestOK struct { func (o *AcceptLogoutRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/accept][%d] acceptLogoutRequestOK %+v", 200, o.Payload) } + func (o *AcceptLogoutRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -83,7 +85,7 @@ func NewAcceptLogoutRequestNotFound() *AcceptLogoutRequestNotFound { return &AcceptLogoutRequestNotFound{} } -/* AcceptLogoutRequestNotFound describes a response with status code 404, with default header values. +/*AcceptLogoutRequestNotFound handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type AcceptLogoutRequestNotFound struct { func (o *AcceptLogoutRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/accept][%d] acceptLogoutRequestNotFound %+v", 404, o.Payload) } + func (o *AcceptLogoutRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewAcceptLogoutRequestInternalServerError() *AcceptLogoutRequestInternalSer return &AcceptLogoutRequestInternalServerError{} } -/* AcceptLogoutRequestInternalServerError describes a response with status code 500, with default header values. +/*AcceptLogoutRequestInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type AcceptLogoutRequestInternalServerError struct { func (o *AcceptLogoutRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/accept][%d] acceptLogoutRequestInternalServerError %+v", 500, o.Payload) } + func (o *AcceptLogoutRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/admin_client.go b/internal/httpclient/client/admin/admin_client.go index e5c1544c43e..e626d4ccbdb 100644 --- a/internal/httpclient/client/admin/admin_client.go +++ b/internal/httpclient/client/admin/admin_client.go @@ -25,70 +25,67 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - // ClientService is the interface for Client methods type ClientService interface { - AcceptConsentRequest(params *AcceptConsentRequestParams, opts ...ClientOption) (*AcceptConsentRequestOK, error) + AcceptConsentRequest(params *AcceptConsentRequestParams) (*AcceptConsentRequestOK, error) - AcceptLoginRequest(params *AcceptLoginRequestParams, opts ...ClientOption) (*AcceptLoginRequestOK, error) + AcceptLoginRequest(params *AcceptLoginRequestParams) (*AcceptLoginRequestOK, error) - AcceptLogoutRequest(params *AcceptLogoutRequestParams, opts ...ClientOption) (*AcceptLogoutRequestOK, error) + AcceptLogoutRequest(params *AcceptLogoutRequestParams) (*AcceptLogoutRequestOK, error) - CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ...ClientOption) (*CreateJSONWebKeySetCreated, error) + CreateJSONWebKeySet(params *CreateJSONWebKeySetParams) (*CreateJSONWebKeySetCreated, error) - CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) + CreateOAuth2Client(params *CreateOAuth2ClientParams) (*CreateOAuth2ClientCreated, error) - DeleteJSONWebKey(params *DeleteJSONWebKeyParams, opts ...ClientOption) (*DeleteJSONWebKeyNoContent, error) + DeleteJSONWebKey(params *DeleteJSONWebKeyParams) (*DeleteJSONWebKeyNoContent, error) - DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ...ClientOption) (*DeleteJSONWebKeySetNoContent, error) + DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams) (*DeleteJSONWebKeySetNoContent, error) - DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) + DeleteOAuth2Client(params *DeleteOAuth2ClientParams) (*DeleteOAuth2ClientNoContent, error) - DeleteOAuth2Token(params *DeleteOAuth2TokenParams, opts ...ClientOption) (*DeleteOAuth2TokenNoContent, error) + DeleteOAuth2Token(params *DeleteOAuth2TokenParams) (*DeleteOAuth2TokenNoContent, error) - FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams, opts ...ClientOption) (*FlushInactiveOAuth2TokensNoContent, error) + FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams) (*FlushInactiveOAuth2TokensNoContent, error) - GetConsentRequest(params *GetConsentRequestParams, opts ...ClientOption) (*GetConsentRequestOK, error) + GetConsentRequest(params *GetConsentRequestParams) (*GetConsentRequestOK, error) - GetJSONWebKey(params *GetJSONWebKeyParams, opts ...ClientOption) (*GetJSONWebKeyOK, error) + GetJSONWebKey(params *GetJSONWebKeyParams) (*GetJSONWebKeyOK, error) - GetJSONWebKeySet(params *GetJSONWebKeySetParams, opts ...ClientOption) (*GetJSONWebKeySetOK, error) + GetJSONWebKeySet(params *GetJSONWebKeySetParams) (*GetJSONWebKeySetOK, error) - GetLoginRequest(params *GetLoginRequestParams, opts ...ClientOption) (*GetLoginRequestOK, error) + GetLoginRequest(params *GetLoginRequestParams) (*GetLoginRequestOK, error) - GetLogoutRequest(params *GetLogoutRequestParams, opts ...ClientOption) (*GetLogoutRequestOK, error) + GetLogoutRequest(params *GetLogoutRequestParams) (*GetLogoutRequestOK, error) - GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) + GetOAuth2Client(params *GetOAuth2ClientParams) (*GetOAuth2ClientOK, error) - GetVersion(params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error) + GetVersion(params *GetVersionParams) (*GetVersionOK, error) - IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams, opts ...ClientOption) (*IntrospectOAuth2TokenOK, error) + IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams) (*IntrospectOAuth2TokenOK, error) - IsInstanceAlive(params *IsInstanceAliveParams, opts ...ClientOption) (*IsInstanceAliveOK, error) + IsInstanceAlive(params *IsInstanceAliveParams) (*IsInstanceAliveOK, error) - ListOAuth2Clients(params *ListOAuth2ClientsParams, opts ...ClientOption) (*ListOAuth2ClientsOK, error) + ListOAuth2Clients(params *ListOAuth2ClientsParams) (*ListOAuth2ClientsOK, error) - ListSubjectConsentSessions(params *ListSubjectConsentSessionsParams, opts ...ClientOption) (*ListSubjectConsentSessionsOK, error) + ListSubjectConsentSessions(params *ListSubjectConsentSessionsParams) (*ListSubjectConsentSessionsOK, error) - PatchOAuth2Client(params *PatchOAuth2ClientParams, opts ...ClientOption) (*PatchOAuth2ClientOK, error) + PatchOAuth2Client(params *PatchOAuth2ClientParams) (*PatchOAuth2ClientOK, error) - RejectConsentRequest(params *RejectConsentRequestParams, opts ...ClientOption) (*RejectConsentRequestOK, error) + RejectConsentRequest(params *RejectConsentRequestParams) (*RejectConsentRequestOK, error) - RejectLoginRequest(params *RejectLoginRequestParams, opts ...ClientOption) (*RejectLoginRequestOK, error) + RejectLoginRequest(params *RejectLoginRequestParams) (*RejectLoginRequestOK, error) - RejectLogoutRequest(params *RejectLogoutRequestParams, opts ...ClientOption) (*RejectLogoutRequestNoContent, error) + RejectLogoutRequest(params *RejectLogoutRequestParams) (*RejectLogoutRequestNoContent, error) - RevokeAuthenticationSession(params *RevokeAuthenticationSessionParams, opts ...ClientOption) (*RevokeAuthenticationSessionNoContent, error) + RevokeAuthenticationSession(params *RevokeAuthenticationSessionParams) (*RevokeAuthenticationSessionNoContent, error) - RevokeConsentSessions(params *RevokeConsentSessionsParams, opts ...ClientOption) (*RevokeConsentSessionsNoContent, error) + RevokeConsentSessions(params *RevokeConsentSessionsParams) (*RevokeConsentSessionsNoContent, error) - UpdateJSONWebKey(params *UpdateJSONWebKeyParams, opts ...ClientOption) (*UpdateJSONWebKeyOK, error) + UpdateJSONWebKey(params *UpdateJSONWebKeyParams) (*UpdateJSONWebKeyOK, error) - UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ...ClientOption) (*UpdateJSONWebKeySetOK, error) + UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams) (*UpdateJSONWebKeySetOK, error) - UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) + UpdateOAuth2Client(params *UpdateOAuth2ClientParams) (*UpdateOAuth2ClientOK, error) SetTransport(transport runtime.ClientTransport) } @@ -113,12 +110,13 @@ consent request should be used as basis for future requests. The response contains a redirect URL which the consent provider should redirect the user-agent to. */ -func (a *Client) AcceptConsentRequest(params *AcceptConsentRequestParams, opts ...ClientOption) (*AcceptConsentRequestOK, error) { +func (a *Client) AcceptConsentRequest(params *AcceptConsentRequestParams) (*AcceptConsentRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAcceptConsentRequestParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "acceptConsentRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/consent/accept", @@ -129,12 +127,7 @@ func (a *Client) AcceptConsentRequest(params *AcceptConsentRequestParams, opts . Reader: &AcceptConsentRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -165,12 +158,13 @@ a cookie. The response contains a redirect URL which the login provider should redirect the user-agent to. */ -func (a *Client) AcceptLoginRequest(params *AcceptLoginRequestParams, opts ...ClientOption) (*AcceptLoginRequestOK, error) { +func (a *Client) AcceptLoginRequest(params *AcceptLoginRequestParams) (*AcceptLoginRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAcceptLoginRequestParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "acceptLoginRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/login/accept", @@ -181,12 +175,7 @@ func (a *Client) AcceptLoginRequest(params *AcceptLoginRequestParams, opts ...Cl Reader: &AcceptLoginRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -208,12 +197,13 @@ No body is required. The response contains a redirect URL which the consent provider should redirect the user-agent to. */ -func (a *Client) AcceptLogoutRequest(params *AcceptLogoutRequestParams, opts ...ClientOption) (*AcceptLogoutRequestOK, error) { +func (a *Client) AcceptLogoutRequest(params *AcceptLogoutRequestParams) (*AcceptLogoutRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewAcceptLogoutRequestParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "acceptLogoutRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/logout/accept", @@ -224,12 +214,7 @@ func (a *Client) AcceptLogoutRequest(params *AcceptLogoutRequestParams, opts ... Reader: &AcceptLogoutRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -250,12 +235,13 @@ func (a *Client) AcceptLogoutRequest(params *AcceptLogoutRequestParams, opts ... A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ...ClientOption) (*CreateJSONWebKeySetCreated, error) { +func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams) (*CreateJSONWebKeySetCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateJSONWebKeySetParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "createJsonWebKeySet", Method: "POST", PathPattern: "/keys/{set}", @@ -266,12 +252,7 @@ func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ... Reader: &CreateJSONWebKeySetReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -292,12 +273,13 @@ func (a *Client) CreateJSONWebKeySet(params *CreateJSONWebKeySetParams, opts ... OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...ClientOption) (*CreateOAuth2ClientCreated, error) { +func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams) (*CreateOAuth2ClientCreated, error) { // TODO: Validate the params before sending if params == nil { params = NewCreateOAuth2ClientParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "createOAuth2Client", Method: "POST", PathPattern: "/clients", @@ -308,12 +290,7 @@ func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...Cl Reader: &CreateOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -334,12 +311,13 @@ func (a *Client) CreateOAuth2Client(params *CreateOAuth2ClientParams, opts ...Cl A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) DeleteJSONWebKey(params *DeleteJSONWebKeyParams, opts ...ClientOption) (*DeleteJSONWebKeyNoContent, error) { +func (a *Client) DeleteJSONWebKey(params *DeleteJSONWebKeyParams) (*DeleteJSONWebKeyNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteJSONWebKeyParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "deleteJsonWebKey", Method: "DELETE", PathPattern: "/keys/{set}/{kid}", @@ -350,12 +328,7 @@ func (a *Client) DeleteJSONWebKey(params *DeleteJSONWebKeyParams, opts ...Client Reader: &DeleteJSONWebKeyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -376,12 +349,13 @@ func (a *Client) DeleteJSONWebKey(params *DeleteJSONWebKeyParams, opts ...Client A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ...ClientOption) (*DeleteJSONWebKeySetNoContent, error) { +func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams) (*DeleteJSONWebKeySetNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteJSONWebKeySetParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "deleteJsonWebKeySet", Method: "DELETE", PathPattern: "/keys/{set}", @@ -392,12 +366,7 @@ func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ... Reader: &DeleteJSONWebKeySetReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -418,12 +387,13 @@ func (a *Client) DeleteJSONWebKeySet(params *DeleteJSONWebKeySetParams, opts ... OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...ClientOption) (*DeleteOAuth2ClientNoContent, error) { +func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams) (*DeleteOAuth2ClientNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteOAuth2ClientParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "deleteOAuth2Client", Method: "DELETE", PathPattern: "/clients/{id}", @@ -434,12 +404,7 @@ func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...Cl Reader: &DeleteOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -458,12 +423,13 @@ func (a *Client) DeleteOAuth2Client(params *DeleteOAuth2ClientParams, opts ...Cl This endpoint deletes OAuth2 access tokens issued for a client from the database */ -func (a *Client) DeleteOAuth2Token(params *DeleteOAuth2TokenParams, opts ...ClientOption) (*DeleteOAuth2TokenNoContent, error) { +func (a *Client) DeleteOAuth2Token(params *DeleteOAuth2TokenParams) (*DeleteOAuth2TokenNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewDeleteOAuth2TokenParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "deleteOAuth2Token", Method: "DELETE", PathPattern: "/oauth2/tokens", @@ -474,12 +440,7 @@ func (a *Client) DeleteOAuth2Token(params *DeleteOAuth2TokenParams, opts ...Clie Reader: &DeleteOAuth2TokenReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -500,12 +461,13 @@ func (a *Client) DeleteOAuth2Token(params *DeleteOAuth2TokenParams, opts ...Clie not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be flushed as they are deleted automatically when performing the refresh flow. */ -func (a *Client) FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams, opts ...ClientOption) (*FlushInactiveOAuth2TokensNoContent, error) { +func (a *Client) FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensParams) (*FlushInactiveOAuth2TokensNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewFlushInactiveOAuth2TokensParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "flushInactiveOAuth2Tokens", Method: "POST", PathPattern: "/oauth2/flush", @@ -516,12 +478,7 @@ func (a *Client) FlushInactiveOAuth2Tokens(params *FlushInactiveOAuth2TokensPara Reader: &FlushInactiveOAuth2TokensReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -549,12 +506,13 @@ The consent challenge is appended to the consent provider's URL to which the sub provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. */ -func (a *Client) GetConsentRequest(params *GetConsentRequestParams, opts ...ClientOption) (*GetConsentRequestOK, error) { +func (a *Client) GetConsentRequest(params *GetConsentRequestParams) (*GetConsentRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetConsentRequestParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "getConsentRequest", Method: "GET", PathPattern: "/oauth2/auth/requests/consent", @@ -565,12 +523,7 @@ func (a *Client) GetConsentRequest(params *GetConsentRequestParams, opts ...Clie Reader: &GetConsentRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -589,12 +542,13 @@ func (a *Client) GetConsentRequest(params *GetConsentRequestParams, opts ...Clie This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid). */ -func (a *Client) GetJSONWebKey(params *GetJSONWebKeyParams, opts ...ClientOption) (*GetJSONWebKeyOK, error) { +func (a *Client) GetJSONWebKey(params *GetJSONWebKeyParams) (*GetJSONWebKeyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetJSONWebKeyParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "getJsonWebKey", Method: "GET", PathPattern: "/keys/{set}/{kid}", @@ -605,12 +559,7 @@ func (a *Client) GetJSONWebKey(params *GetJSONWebKeyParams, opts ...ClientOption Reader: &GetJSONWebKeyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -631,12 +580,13 @@ func (a *Client) GetJSONWebKey(params *GetJSONWebKeyParams, opts ...ClientOption A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) GetJSONWebKeySet(params *GetJSONWebKeySetParams, opts ...ClientOption) (*GetJSONWebKeySetOK, error) { +func (a *Client) GetJSONWebKeySet(params *GetJSONWebKeySetParams) (*GetJSONWebKeySetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetJSONWebKeySetParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "getJsonWebKeySet", Method: "GET", PathPattern: "/keys/{set}", @@ -647,12 +597,7 @@ func (a *Client) GetJSONWebKeySet(params *GetJSONWebKeySetParams, opts ...Client Reader: &GetJSONWebKeySetReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -677,12 +622,13 @@ a subject (in OAuth2 the proper name for subject is "resource owner"). The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. */ -func (a *Client) GetLoginRequest(params *GetLoginRequestParams, opts ...ClientOption) (*GetLoginRequestOK, error) { +func (a *Client) GetLoginRequest(params *GetLoginRequestParams) (*GetLoginRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetLoginRequestParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "getLoginRequest", Method: "GET", PathPattern: "/oauth2/auth/requests/login", @@ -693,12 +639,7 @@ func (a *Client) GetLoginRequest(params *GetLoginRequestParams, opts ...ClientOp Reader: &GetLoginRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -717,12 +658,13 @@ func (a *Client) GetLoginRequest(params *GetLoginRequestParams, opts ...ClientOp Use this endpoint to fetch a logout request. */ -func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams, opts ...ClientOption) (*GetLogoutRequestOK, error) { +func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams) (*GetLogoutRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetLogoutRequestParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "getLogoutRequest", Method: "GET", PathPattern: "/oauth2/auth/requests/logout", @@ -733,12 +675,7 @@ func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams, opts ...Client Reader: &GetLogoutRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -759,12 +696,13 @@ func (a *Client) GetLogoutRequest(params *GetLogoutRequestParams, opts ...Client OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOption) (*GetOAuth2ClientOK, error) { +func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams) (*GetOAuth2ClientOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetOAuth2ClientParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "getOAuth2Client", Method: "GET", PathPattern: "/clients/{id}", @@ -775,12 +713,7 @@ func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOp Reader: &GetOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -802,12 +735,13 @@ func (a *Client) GetOAuth2Client(params *GetOAuth2ClientParams, opts ...ClientOp If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. */ -func (a *Client) GetVersion(params *GetVersionParams, opts ...ClientOption) (*GetVersionOK, error) { +func (a *Client) GetVersion(params *GetVersionParams) (*GetVersionOK, error) { // TODO: Validate the params before sending if params == nil { params = NewGetVersionParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "getVersion", Method: "GET", PathPattern: "/version", @@ -818,12 +752,7 @@ func (a *Client) GetVersion(params *GetVersionParams, opts ...ClientOption) (*Ge Reader: &GetVersionReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -846,12 +775,13 @@ set additional data for a token by setting `accessTokenExtra` during the consent For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-endpoint/). */ -func (a *Client) IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams, opts ...ClientOption) (*IntrospectOAuth2TokenOK, error) { +func (a *Client) IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams) (*IntrospectOAuth2TokenOK, error) { // TODO: Validate the params before sending if params == nil { params = NewIntrospectOAuth2TokenParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "introspectOAuth2Token", Method: "POST", PathPattern: "/oauth2/introspect", @@ -862,12 +792,7 @@ func (a *Client) IntrospectOAuth2Token(params *IntrospectOAuth2TokenParams, opts Reader: &IntrospectOAuth2TokenReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -893,12 +818,13 @@ If the service supports TLS Edge Termination, this endpoint does not require the Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance. */ -func (a *Client) IsInstanceAlive(params *IsInstanceAliveParams, opts ...ClientOption) (*IsInstanceAliveOK, error) { +func (a *Client) IsInstanceAlive(params *IsInstanceAliveParams) (*IsInstanceAliveOK, error) { // TODO: Validate the params before sending if params == nil { params = NewIsInstanceAliveParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "isInstanceAlive", Method: "GET", PathPattern: "/health/alive", @@ -909,12 +835,7 @@ func (a *Client) IsInstanceAlive(params *IsInstanceAliveParams, opts ...ClientOp Reader: &IsInstanceAliveReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -937,12 +858,13 @@ OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usuall The "Link" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '; rel="{page}"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. Multiple links can be included in this header, and will be separated by a comma. */ -func (a *Client) ListOAuth2Clients(params *ListOAuth2ClientsParams, opts ...ClientOption) (*ListOAuth2ClientsOK, error) { +func (a *Client) ListOAuth2Clients(params *ListOAuth2ClientsParams) (*ListOAuth2ClientsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListOAuth2ClientsParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "listOAuth2Clients", Method: "GET", PathPattern: "/clients", @@ -953,12 +875,7 @@ func (a *Client) ListOAuth2Clients(params *ListOAuth2ClientsParams, opts ...Clie Reader: &ListOAuth2ClientsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -983,12 +900,13 @@ empty JSON array with status code 200 OK. The "Link" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '; rel="{page}"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'. Multiple links can be included in this header, and will be separated by a comma. */ -func (a *Client) ListSubjectConsentSessions(params *ListSubjectConsentSessionsParams, opts ...ClientOption) (*ListSubjectConsentSessionsOK, error) { +func (a *Client) ListSubjectConsentSessions(params *ListSubjectConsentSessionsParams) (*ListSubjectConsentSessionsOK, error) { // TODO: Validate the params before sending if params == nil { params = NewListSubjectConsentSessionsParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "listSubjectConsentSessions", Method: "GET", PathPattern: "/oauth2/auth/sessions/consent", @@ -999,12 +917,7 @@ func (a *Client) ListSubjectConsentSessions(params *ListSubjectConsentSessionsPa Reader: &ListSubjectConsentSessionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -1025,12 +938,13 @@ func (a *Client) ListSubjectConsentSessions(params *ListSubjectConsentSessionsPa OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) PatchOAuth2Client(params *PatchOAuth2ClientParams, opts ...ClientOption) (*PatchOAuth2ClientOK, error) { +func (a *Client) PatchOAuth2Client(params *PatchOAuth2ClientParams) (*PatchOAuth2ClientOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPatchOAuth2ClientParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "patchOAuth2Client", Method: "PATCH", PathPattern: "/clients/{id}", @@ -1041,12 +955,7 @@ func (a *Client) PatchOAuth2Client(params *PatchOAuth2ClientParams, opts ...Clie Reader: &PatchOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -1079,12 +988,13 @@ The consent provider must include a reason why the consent was not granted. The response contains a redirect URL which the consent provider should redirect the user-agent to. */ -func (a *Client) RejectConsentRequest(params *RejectConsentRequestParams, opts ...ClientOption) (*RejectConsentRequestOK, error) { +func (a *Client) RejectConsentRequest(params *RejectConsentRequestParams) (*RejectConsentRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRejectConsentRequestParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "rejectConsentRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/consent/reject", @@ -1095,12 +1005,7 @@ func (a *Client) RejectConsentRequest(params *RejectConsentRequestParams, opts . Reader: &RejectConsentRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -1130,12 +1035,13 @@ was be denied. The response contains a redirect URL which the login provider should redirect the user-agent to. */ -func (a *Client) RejectLoginRequest(params *RejectLoginRequestParams, opts ...ClientOption) (*RejectLoginRequestOK, error) { +func (a *Client) RejectLoginRequest(params *RejectLoginRequestParams) (*RejectLoginRequestOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRejectLoginRequestParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "rejectLoginRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/login/reject", @@ -1146,12 +1052,7 @@ func (a *Client) RejectLoginRequest(params *RejectLoginRequestParams, opts ...Cl Reader: &RejectLoginRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -1173,12 +1074,13 @@ No body is required. The response is empty as the logout provider has to chose what action to perform next. */ -func (a *Client) RejectLogoutRequest(params *RejectLogoutRequestParams, opts ...ClientOption) (*RejectLogoutRequestNoContent, error) { +func (a *Client) RejectLogoutRequest(params *RejectLogoutRequestParams) (*RejectLogoutRequestNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewRejectLogoutRequestParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "rejectLogoutRequest", Method: "PUT", PathPattern: "/oauth2/auth/requests/logout/reject", @@ -1189,12 +1091,7 @@ func (a *Client) RejectLogoutRequest(params *RejectLogoutRequestParams, opts ... Reader: &RejectLogoutRequestReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -1215,12 +1112,13 @@ func (a *Client) RejectLogoutRequest(params *RejectLogoutRequestParams, opts ... has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work with OpenID Connect Front- or Back-channel logout. */ -func (a *Client) RevokeAuthenticationSession(params *RevokeAuthenticationSessionParams, opts ...ClientOption) (*RevokeAuthenticationSessionNoContent, error) { +func (a *Client) RevokeAuthenticationSession(params *RevokeAuthenticationSessionParams) (*RevokeAuthenticationSessionNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewRevokeAuthenticationSessionParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "revokeAuthenticationSession", Method: "DELETE", PathPattern: "/oauth2/auth/sessions/login", @@ -1231,12 +1129,7 @@ func (a *Client) RevokeAuthenticationSession(params *RevokeAuthenticationSession Reader: &RevokeAuthenticationSessionReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -1256,12 +1149,13 @@ func (a *Client) RevokeAuthenticationSession(params *RevokeAuthenticationSession This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and invalidates all associated OAuth 2.0 Access Tokens. */ -func (a *Client) RevokeConsentSessions(params *RevokeConsentSessionsParams, opts ...ClientOption) (*RevokeConsentSessionsNoContent, error) { +func (a *Client) RevokeConsentSessions(params *RevokeConsentSessionsParams) (*RevokeConsentSessionsNoContent, error) { // TODO: Validate the params before sending if params == nil { params = NewRevokeConsentSessionsParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "revokeConsentSessions", Method: "DELETE", PathPattern: "/oauth2/auth/sessions/consent", @@ -1272,12 +1166,7 @@ func (a *Client) RevokeConsentSessions(params *RevokeConsentSessionsParams, opts Reader: &RevokeConsentSessionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -1298,12 +1187,13 @@ func (a *Client) RevokeConsentSessions(params *RevokeConsentSessionsParams, opts A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) UpdateJSONWebKey(params *UpdateJSONWebKeyParams, opts ...ClientOption) (*UpdateJSONWebKeyOK, error) { +func (a *Client) UpdateJSONWebKey(params *UpdateJSONWebKeyParams) (*UpdateJSONWebKeyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateJSONWebKeyParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "updateJsonWebKey", Method: "PUT", PathPattern: "/keys/{set}/{kid}", @@ -1314,12 +1204,7 @@ func (a *Client) UpdateJSONWebKey(params *UpdateJSONWebKeyParams, opts ...Client Reader: &UpdateJSONWebKeyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -1340,12 +1225,13 @@ func (a *Client) UpdateJSONWebKey(params *UpdateJSONWebKeyParams, opts ...Client A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well. */ -func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ...ClientOption) (*UpdateJSONWebKeySetOK, error) { +func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams) (*UpdateJSONWebKeySetOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateJSONWebKeySetParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "updateJsonWebKeySet", Method: "PUT", PathPattern: "/keys/{set}", @@ -1356,12 +1242,7 @@ func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ... Reader: &UpdateJSONWebKeySetReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -1382,12 +1263,13 @@ func (a *Client) UpdateJSONWebKeySet(params *UpdateJSONWebKeySetParams, opts ... OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components. */ -func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...ClientOption) (*UpdateOAuth2ClientOK, error) { +func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams) (*UpdateOAuth2ClientOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUpdateOAuth2ClientParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "updateOAuth2Client", Method: "PUT", PathPattern: "/clients/{id}", @@ -1398,12 +1280,7 @@ func (a *Client) UpdateOAuth2Client(params *UpdateOAuth2ClientParams, opts ...Cl Reader: &UpdateOAuth2ClientReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } diff --git a/internal/httpclient/client/admin/create_json_web_key_set_parameters.go b/internal/httpclient/client/admin/create_json_web_key_set_parameters.go index 43acf4eba80..e4c1c054393 100644 --- a/internal/httpclient/client/admin/create_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/create_json_web_key_set_parameters.go @@ -18,55 +18,55 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewCreateJSONWebKeySetParams creates a new CreateJSONWebKeySetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCreateJSONWebKeySetParams creates a new CreateJSONWebKeySetParams object +// with the default values initialized. func NewCreateJSONWebKeySetParams() *CreateJSONWebKeySetParams { + var () return &CreateJSONWebKeySetParams{ + timeout: cr.DefaultTimeout, } } // NewCreateJSONWebKeySetParamsWithTimeout creates a new CreateJSONWebKeySetParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCreateJSONWebKeySetParamsWithTimeout(timeout time.Duration) *CreateJSONWebKeySetParams { + var () return &CreateJSONWebKeySetParams{ + timeout: timeout, } } // NewCreateJSONWebKeySetParamsWithContext creates a new CreateJSONWebKeySetParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCreateJSONWebKeySetParamsWithContext(ctx context.Context) *CreateJSONWebKeySetParams { + var () return &CreateJSONWebKeySetParams{ + Context: ctx, } } // NewCreateJSONWebKeySetParamsWithHTTPClient creates a new CreateJSONWebKeySetParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCreateJSONWebKeySetParamsWithHTTPClient(client *http.Client) *CreateJSONWebKeySetParams { + var () return &CreateJSONWebKeySetParams{ HTTPClient: client, } } -/* CreateJSONWebKeySetParams contains all the parameters to send to the API endpoint - for the create Json web key set operation. - - Typically these are written to a http.Request. +/*CreateJSONWebKeySetParams contains all the parameters to send to the API endpoint +for the create Json web key set operation typically these are written to a http.Request */ type CreateJSONWebKeySetParams struct { - // Body. + /*Body*/ Body *models.JSONWebKeySetGeneratorRequest + /*Set + The set - /* Set. - - The set */ Set string @@ -75,21 +75,6 @@ type CreateJSONWebKeySetParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the create Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateJSONWebKeySetParams) WithDefaults() *CreateJSONWebKeySetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateJSONWebKeySetParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the create Json web key set params func (o *CreateJSONWebKeySetParams) WithTimeout(timeout time.Duration) *CreateJSONWebKeySetParams { o.SetTimeout(timeout) @@ -152,6 +137,7 @@ func (o *CreateJSONWebKeySetParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/create_json_web_key_set_responses.go b/internal/httpclient/client/admin/create_json_web_key_set_responses.go index 564e5d51f39..9e2515c969b 100644 --- a/internal/httpclient/client/admin/create_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/create_json_web_key_set_responses.go @@ -47,8 +47,9 @@ func (o *CreateJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewCreateJSONWebKeySetCreated() *CreateJSONWebKeySetCreated { return &CreateJSONWebKeySetCreated{} } -/* CreateJSONWebKeySetCreated describes a response with status code 201, with default header values. +/*CreateJSONWebKeySetCreated handles this case with default header values. JSONWebKeySet */ @@ -68,6 +69,7 @@ type CreateJSONWebKeySetCreated struct { func (o *CreateJSONWebKeySetCreated) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetCreated %+v", 201, o.Payload) } + func (o *CreateJSONWebKeySetCreated) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -89,7 +91,7 @@ func NewCreateJSONWebKeySetUnauthorized() *CreateJSONWebKeySetUnauthorized { return &CreateJSONWebKeySetUnauthorized{} } -/* CreateJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. +/*CreateJSONWebKeySetUnauthorized handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type CreateJSONWebKeySetUnauthorized struct { func (o *CreateJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetUnauthorized %+v", 401, o.Payload) } + func (o *CreateJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewCreateJSONWebKeySetForbidden() *CreateJSONWebKeySetForbidden { return &CreateJSONWebKeySetForbidden{} } -/* CreateJSONWebKeySetForbidden describes a response with status code 403, with default header values. +/*CreateJSONWebKeySetForbidden handles this case with default header values. jsonError */ @@ -132,6 +135,7 @@ type CreateJSONWebKeySetForbidden struct { func (o *CreateJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetForbidden %+v", 403, o.Payload) } + func (o *CreateJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -153,7 +157,7 @@ func NewCreateJSONWebKeySetInternalServerError() *CreateJSONWebKeySetInternalSer return &CreateJSONWebKeySetInternalServerError{} } -/* CreateJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. +/*CreateJSONWebKeySetInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type CreateJSONWebKeySetInternalServerError struct { func (o *CreateJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[POST /keys/{set}][%d] createJsonWebKeySetInternalServerError %+v", 500, o.Payload) } + func (o *CreateJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/create_o_auth2_client_parameters.go b/internal/httpclient/client/admin/create_o_auth2_client_parameters.go index f719021b83a..c3ce0633992 100644 --- a/internal/httpclient/client/admin/create_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/create_o_auth2_client_parameters.go @@ -18,50 +18,51 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewCreateOAuth2ClientParams creates a new CreateOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewCreateOAuth2ClientParams creates a new CreateOAuth2ClientParams object +// with the default values initialized. func NewCreateOAuth2ClientParams() *CreateOAuth2ClientParams { + var () return &CreateOAuth2ClientParams{ + timeout: cr.DefaultTimeout, } } // NewCreateOAuth2ClientParamsWithTimeout creates a new CreateOAuth2ClientParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewCreateOAuth2ClientParamsWithTimeout(timeout time.Duration) *CreateOAuth2ClientParams { + var () return &CreateOAuth2ClientParams{ + timeout: timeout, } } // NewCreateOAuth2ClientParamsWithContext creates a new CreateOAuth2ClientParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewCreateOAuth2ClientParamsWithContext(ctx context.Context) *CreateOAuth2ClientParams { + var () return &CreateOAuth2ClientParams{ + Context: ctx, } } // NewCreateOAuth2ClientParamsWithHTTPClient creates a new CreateOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewCreateOAuth2ClientParamsWithHTTPClient(client *http.Client) *CreateOAuth2ClientParams { + var () return &CreateOAuth2ClientParams{ HTTPClient: client, } } -/* CreateOAuth2ClientParams contains all the parameters to send to the API endpoint - for the create o auth2 client operation. - - Typically these are written to a http.Request. +/*CreateOAuth2ClientParams contains all the parameters to send to the API endpoint +for the create o auth2 client operation typically these are written to a http.Request */ type CreateOAuth2ClientParams struct { - // Body. + /*Body*/ Body *models.OAuth2Client timeout time.Duration @@ -69,21 +70,6 @@ type CreateOAuth2ClientParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the create o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateOAuth2ClientParams) WithDefaults() *CreateOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the create o auth2 client params func (o *CreateOAuth2ClientParams) WithTimeout(timeout time.Duration) *CreateOAuth2ClientParams { o.SetTimeout(timeout) @@ -135,6 +121,7 @@ func (o *CreateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/create_o_auth2_client_responses.go b/internal/httpclient/client/admin/create_o_auth2_client_responses.go index f4b2e9685bb..52af9e0716b 100644 --- a/internal/httpclient/client/admin/create_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/create_o_auth2_client_responses.go @@ -47,8 +47,9 @@ func (o *CreateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewCreateOAuth2ClientCreated() *CreateOAuth2ClientCreated { return &CreateOAuth2ClientCreated{} } -/* CreateOAuth2ClientCreated describes a response with status code 201, with default header values. +/*CreateOAuth2ClientCreated handles this case with default header values. oAuth2Client */ @@ -68,6 +69,7 @@ type CreateOAuth2ClientCreated struct { func (o *CreateOAuth2ClientCreated) Error() string { return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientCreated %+v", 201, o.Payload) } + func (o *CreateOAuth2ClientCreated) GetPayload() *models.OAuth2Client { return o.Payload } @@ -89,7 +91,7 @@ func NewCreateOAuth2ClientBadRequest() *CreateOAuth2ClientBadRequest { return &CreateOAuth2ClientBadRequest{} } -/* CreateOAuth2ClientBadRequest describes a response with status code 400, with default header values. +/*CreateOAuth2ClientBadRequest handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type CreateOAuth2ClientBadRequest struct { func (o *CreateOAuth2ClientBadRequest) Error() string { return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientBadRequest %+v", 400, o.Payload) } + func (o *CreateOAuth2ClientBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewCreateOAuth2ClientConflict() *CreateOAuth2ClientConflict { return &CreateOAuth2ClientConflict{} } -/* CreateOAuth2ClientConflict describes a response with status code 409, with default header values. +/*CreateOAuth2ClientConflict handles this case with default header values. jsonError */ @@ -132,6 +135,7 @@ type CreateOAuth2ClientConflict struct { func (o *CreateOAuth2ClientConflict) Error() string { return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientConflict %+v", 409, o.Payload) } + func (o *CreateOAuth2ClientConflict) GetPayload() *models.JSONError { return o.Payload } @@ -153,7 +157,7 @@ func NewCreateOAuth2ClientInternalServerError() *CreateOAuth2ClientInternalServe return &CreateOAuth2ClientInternalServerError{} } -/* CreateOAuth2ClientInternalServerError describes a response with status code 500, with default header values. +/*CreateOAuth2ClientInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type CreateOAuth2ClientInternalServerError struct { func (o *CreateOAuth2ClientInternalServerError) Error() string { return fmt.Sprintf("[POST /clients][%d] createOAuth2ClientInternalServerError %+v", 500, o.Payload) } + func (o *CreateOAuth2ClientInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/delete_json_web_key_parameters.go b/internal/httpclient/client/admin/delete_json_web_key_parameters.go index c1e71f1d5d8..4f4f4fa4401 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_parameters.go +++ b/internal/httpclient/client/admin/delete_json_web_key_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteJSONWebKeyParams creates a new DeleteJSONWebKeyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDeleteJSONWebKeyParams creates a new DeleteJSONWebKeyParams object +// with the default values initialized. func NewDeleteJSONWebKeyParams() *DeleteJSONWebKeyParams { + var () return &DeleteJSONWebKeyParams{ + timeout: cr.DefaultTimeout, } } // NewDeleteJSONWebKeyParamsWithTimeout creates a new DeleteJSONWebKeyParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDeleteJSONWebKeyParamsWithTimeout(timeout time.Duration) *DeleteJSONWebKeyParams { + var () return &DeleteJSONWebKeyParams{ + timeout: timeout, } } // NewDeleteJSONWebKeyParamsWithContext creates a new DeleteJSONWebKeyParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDeleteJSONWebKeyParamsWithContext(ctx context.Context) *DeleteJSONWebKeyParams { + var () return &DeleteJSONWebKeyParams{ + Context: ctx, } } // NewDeleteJSONWebKeyParamsWithHTTPClient creates a new DeleteJSONWebKeyParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDeleteJSONWebKeyParamsWithHTTPClient(client *http.Client) *DeleteJSONWebKeyParams { + var () return &DeleteJSONWebKeyParams{ HTTPClient: client, } } -/* DeleteJSONWebKeyParams contains all the parameters to send to the API endpoint - for the delete Json web key operation. - - Typically these are written to a http.Request. +/*DeleteJSONWebKeyParams contains all the parameters to send to the API endpoint +for the delete Json web key operation typically these are written to a http.Request */ type DeleteJSONWebKeyParams struct { - /* Kid. + /*Kid + The kid of the desired key - The kid of the desired key */ Kid string + /*Set + The set - /* Set. - - The set */ Set string @@ -76,21 +76,6 @@ type DeleteJSONWebKeyParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the delete Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteJSONWebKeyParams) WithDefaults() *DeleteJSONWebKeyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteJSONWebKeyParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the delete Json web key params func (o *DeleteJSONWebKeyParams) WithTimeout(timeout time.Duration) *DeleteJSONWebKeyParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/delete_json_web_key_responses.go b/internal/httpclient/client/admin/delete_json_web_key_responses.go index d5331905a2c..6caea37bb35 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_responses.go +++ b/internal/httpclient/client/admin/delete_json_web_key_responses.go @@ -47,8 +47,9 @@ func (o *DeleteJSONWebKeyReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,9 +58,9 @@ func NewDeleteJSONWebKeyNoContent() *DeleteJSONWebKeyNoContent { return &DeleteJSONWebKeyNoContent{} } -/* DeleteJSONWebKeyNoContent describes a response with status code 204, with default header values. +/*DeleteJSONWebKeyNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteJSONWebKeyNoContent struct { @@ -79,7 +80,7 @@ func NewDeleteJSONWebKeyUnauthorized() *DeleteJSONWebKeyUnauthorized { return &DeleteJSONWebKeyUnauthorized{} } -/* DeleteJSONWebKeyUnauthorized describes a response with status code 401, with default header values. +/*DeleteJSONWebKeyUnauthorized handles this case with default header values. jsonError */ @@ -90,6 +91,7 @@ type DeleteJSONWebKeyUnauthorized struct { func (o *DeleteJSONWebKeyUnauthorized) Error() string { return fmt.Sprintf("[DELETE /keys/{set}/{kid}][%d] deleteJsonWebKeyUnauthorized %+v", 401, o.Payload) } + func (o *DeleteJSONWebKeyUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -111,7 +113,7 @@ func NewDeleteJSONWebKeyForbidden() *DeleteJSONWebKeyForbidden { return &DeleteJSONWebKeyForbidden{} } -/* DeleteJSONWebKeyForbidden describes a response with status code 403, with default header values. +/*DeleteJSONWebKeyForbidden handles this case with default header values. jsonError */ @@ -122,6 +124,7 @@ type DeleteJSONWebKeyForbidden struct { func (o *DeleteJSONWebKeyForbidden) Error() string { return fmt.Sprintf("[DELETE /keys/{set}/{kid}][%d] deleteJsonWebKeyForbidden %+v", 403, o.Payload) } + func (o *DeleteJSONWebKeyForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -143,7 +146,7 @@ func NewDeleteJSONWebKeyInternalServerError() *DeleteJSONWebKeyInternalServerErr return &DeleteJSONWebKeyInternalServerError{} } -/* DeleteJSONWebKeyInternalServerError describes a response with status code 500, with default header values. +/*DeleteJSONWebKeyInternalServerError handles this case with default header values. jsonError */ @@ -154,6 +157,7 @@ type DeleteJSONWebKeyInternalServerError struct { func (o *DeleteJSONWebKeyInternalServerError) Error() string { return fmt.Sprintf("[DELETE /keys/{set}/{kid}][%d] deleteJsonWebKeyInternalServerError %+v", 500, o.Payload) } + func (o *DeleteJSONWebKeyInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go b/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go index 5bb84e5a07a..a6e06c48d86 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/delete_json_web_key_set_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteJSONWebKeySetParams creates a new DeleteJSONWebKeySetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDeleteJSONWebKeySetParams creates a new DeleteJSONWebKeySetParams object +// with the default values initialized. func NewDeleteJSONWebKeySetParams() *DeleteJSONWebKeySetParams { + var () return &DeleteJSONWebKeySetParams{ + timeout: cr.DefaultTimeout, } } // NewDeleteJSONWebKeySetParamsWithTimeout creates a new DeleteJSONWebKeySetParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDeleteJSONWebKeySetParamsWithTimeout(timeout time.Duration) *DeleteJSONWebKeySetParams { + var () return &DeleteJSONWebKeySetParams{ + timeout: timeout, } } // NewDeleteJSONWebKeySetParamsWithContext creates a new DeleteJSONWebKeySetParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDeleteJSONWebKeySetParamsWithContext(ctx context.Context) *DeleteJSONWebKeySetParams { + var () return &DeleteJSONWebKeySetParams{ + Context: ctx, } } // NewDeleteJSONWebKeySetParamsWithHTTPClient creates a new DeleteJSONWebKeySetParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDeleteJSONWebKeySetParamsWithHTTPClient(client *http.Client) *DeleteJSONWebKeySetParams { + var () return &DeleteJSONWebKeySetParams{ HTTPClient: client, } } -/* DeleteJSONWebKeySetParams contains all the parameters to send to the API endpoint - for the delete Json web key set operation. - - Typically these are written to a http.Request. +/*DeleteJSONWebKeySetParams contains all the parameters to send to the API endpoint +for the delete Json web key set operation typically these are written to a http.Request */ type DeleteJSONWebKeySetParams struct { - /* Set. + /*Set + The set - The set */ Set string @@ -70,21 +71,6 @@ type DeleteJSONWebKeySetParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the delete Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteJSONWebKeySetParams) WithDefaults() *DeleteJSONWebKeySetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteJSONWebKeySetParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the delete Json web key set params func (o *DeleteJSONWebKeySetParams) WithTimeout(timeout time.Duration) *DeleteJSONWebKeySetParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/delete_json_web_key_set_responses.go b/internal/httpclient/client/admin/delete_json_web_key_set_responses.go index 26ff80c09f9..7e769a6c132 100644 --- a/internal/httpclient/client/admin/delete_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/delete_json_web_key_set_responses.go @@ -47,8 +47,9 @@ func (o *DeleteJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,9 +58,9 @@ func NewDeleteJSONWebKeySetNoContent() *DeleteJSONWebKeySetNoContent { return &DeleteJSONWebKeySetNoContent{} } -/* DeleteJSONWebKeySetNoContent describes a response with status code 204, with default header values. +/*DeleteJSONWebKeySetNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteJSONWebKeySetNoContent struct { @@ -79,7 +80,7 @@ func NewDeleteJSONWebKeySetUnauthorized() *DeleteJSONWebKeySetUnauthorized { return &DeleteJSONWebKeySetUnauthorized{} } -/* DeleteJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. +/*DeleteJSONWebKeySetUnauthorized handles this case with default header values. jsonError */ @@ -90,6 +91,7 @@ type DeleteJSONWebKeySetUnauthorized struct { func (o *DeleteJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[DELETE /keys/{set}][%d] deleteJsonWebKeySetUnauthorized %+v", 401, o.Payload) } + func (o *DeleteJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -111,7 +113,7 @@ func NewDeleteJSONWebKeySetForbidden() *DeleteJSONWebKeySetForbidden { return &DeleteJSONWebKeySetForbidden{} } -/* DeleteJSONWebKeySetForbidden describes a response with status code 403, with default header values. +/*DeleteJSONWebKeySetForbidden handles this case with default header values. jsonError */ @@ -122,6 +124,7 @@ type DeleteJSONWebKeySetForbidden struct { func (o *DeleteJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[DELETE /keys/{set}][%d] deleteJsonWebKeySetForbidden %+v", 403, o.Payload) } + func (o *DeleteJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -143,7 +146,7 @@ func NewDeleteJSONWebKeySetInternalServerError() *DeleteJSONWebKeySetInternalSer return &DeleteJSONWebKeySetInternalServerError{} } -/* DeleteJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. +/*DeleteJSONWebKeySetInternalServerError handles this case with default header values. jsonError */ @@ -154,6 +157,7 @@ type DeleteJSONWebKeySetInternalServerError struct { func (o *DeleteJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[DELETE /keys/{set}][%d] deleteJsonWebKeySetInternalServerError %+v", 500, o.Payload) } + func (o *DeleteJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go b/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go index 313a6b76fdf..6eb2b90b311 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/delete_o_auth2_client_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteOAuth2ClientParams creates a new DeleteOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDeleteOAuth2ClientParams creates a new DeleteOAuth2ClientParams object +// with the default values initialized. func NewDeleteOAuth2ClientParams() *DeleteOAuth2ClientParams { + var () return &DeleteOAuth2ClientParams{ + timeout: cr.DefaultTimeout, } } // NewDeleteOAuth2ClientParamsWithTimeout creates a new DeleteOAuth2ClientParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDeleteOAuth2ClientParamsWithTimeout(timeout time.Duration) *DeleteOAuth2ClientParams { + var () return &DeleteOAuth2ClientParams{ + timeout: timeout, } } // NewDeleteOAuth2ClientParamsWithContext creates a new DeleteOAuth2ClientParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDeleteOAuth2ClientParamsWithContext(ctx context.Context) *DeleteOAuth2ClientParams { + var () return &DeleteOAuth2ClientParams{ + Context: ctx, } } // NewDeleteOAuth2ClientParamsWithHTTPClient creates a new DeleteOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDeleteOAuth2ClientParamsWithHTTPClient(client *http.Client) *DeleteOAuth2ClientParams { + var () return &DeleteOAuth2ClientParams{ HTTPClient: client, } } -/* DeleteOAuth2ClientParams contains all the parameters to send to the API endpoint - for the delete o auth2 client operation. - - Typically these are written to a http.Request. +/*DeleteOAuth2ClientParams contains all the parameters to send to the API endpoint +for the delete o auth2 client operation typically these are written to a http.Request */ type DeleteOAuth2ClientParams struct { - /* ID. + /*ID + The id of the OAuth 2.0 Client. - The id of the OAuth 2.0 Client. */ ID string @@ -70,21 +71,6 @@ type DeleteOAuth2ClientParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the delete o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteOAuth2ClientParams) WithDefaults() *DeleteOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the delete o auth2 client params func (o *DeleteOAuth2ClientParams) WithTimeout(timeout time.Duration) *DeleteOAuth2ClientParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/delete_o_auth2_client_responses.go b/internal/httpclient/client/admin/delete_o_auth2_client_responses.go index fb2869ba2d5..db47f97db15 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/delete_o_auth2_client_responses.go @@ -41,8 +41,9 @@ func (o *DeleteOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewDeleteOAuth2ClientNoContent() *DeleteOAuth2ClientNoContent { return &DeleteOAuth2ClientNoContent{} } -/* DeleteOAuth2ClientNoContent describes a response with status code 204, with default header values. +/*DeleteOAuth2ClientNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteOAuth2ClientNoContent struct { @@ -73,7 +74,7 @@ func NewDeleteOAuth2ClientNotFound() *DeleteOAuth2ClientNotFound { return &DeleteOAuth2ClientNotFound{} } -/* DeleteOAuth2ClientNotFound describes a response with status code 404, with default header values. +/*DeleteOAuth2ClientNotFound handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type DeleteOAuth2ClientNotFound struct { func (o *DeleteOAuth2ClientNotFound) Error() string { return fmt.Sprintf("[DELETE /clients/{id}][%d] deleteOAuth2ClientNotFound %+v", 404, o.Payload) } + func (o *DeleteOAuth2ClientNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewDeleteOAuth2ClientInternalServerError() *DeleteOAuth2ClientInternalServe return &DeleteOAuth2ClientInternalServerError{} } -/* DeleteOAuth2ClientInternalServerError describes a response with status code 500, with default header values. +/*DeleteOAuth2ClientInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type DeleteOAuth2ClientInternalServerError struct { func (o *DeleteOAuth2ClientInternalServerError) Error() string { return fmt.Sprintf("[DELETE /clients/{id}][%d] deleteOAuth2ClientInternalServerError %+v", 500, o.Payload) } + func (o *DeleteOAuth2ClientInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go b/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go index 683579f246a..ae926e1d885 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go +++ b/internal/httpclient/client/admin/delete_o_auth2_token_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDeleteOAuth2TokenParams creates a new DeleteOAuth2TokenParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDeleteOAuth2TokenParams creates a new DeleteOAuth2TokenParams object +// with the default values initialized. func NewDeleteOAuth2TokenParams() *DeleteOAuth2TokenParams { + var () return &DeleteOAuth2TokenParams{ + timeout: cr.DefaultTimeout, } } // NewDeleteOAuth2TokenParamsWithTimeout creates a new DeleteOAuth2TokenParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDeleteOAuth2TokenParamsWithTimeout(timeout time.Duration) *DeleteOAuth2TokenParams { + var () return &DeleteOAuth2TokenParams{ + timeout: timeout, } } // NewDeleteOAuth2TokenParamsWithContext creates a new DeleteOAuth2TokenParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDeleteOAuth2TokenParamsWithContext(ctx context.Context) *DeleteOAuth2TokenParams { + var () return &DeleteOAuth2TokenParams{ + Context: ctx, } } // NewDeleteOAuth2TokenParamsWithHTTPClient creates a new DeleteOAuth2TokenParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDeleteOAuth2TokenParamsWithHTTPClient(client *http.Client) *DeleteOAuth2TokenParams { + var () return &DeleteOAuth2TokenParams{ HTTPClient: client, } } -/* DeleteOAuth2TokenParams contains all the parameters to send to the API endpoint - for the delete o auth2 token operation. - - Typically these are written to a http.Request. +/*DeleteOAuth2TokenParams contains all the parameters to send to the API endpoint +for the delete o auth2 token operation typically these are written to a http.Request */ type DeleteOAuth2TokenParams struct { - // ClientID. + /*ClientID*/ ClientID string timeout time.Duration @@ -67,21 +68,6 @@ type DeleteOAuth2TokenParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the delete o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteOAuth2TokenParams) WithDefaults() *DeleteOAuth2TokenParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteOAuth2TokenParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the delete o auth2 token params func (o *DeleteOAuth2TokenParams) WithTimeout(timeout time.Duration) *DeleteOAuth2TokenParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *DeleteOAuth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg st qrClientID := o.ClientID qClientID := qrClientID if qClientID != "" { - if err := r.SetQueryParam("client_id", qClientID); err != nil { return err } diff --git a/internal/httpclient/client/admin/delete_o_auth2_token_responses.go b/internal/httpclient/client/admin/delete_o_auth2_token_responses.go index 91bce5c7128..cfbc62304a6 100644 --- a/internal/httpclient/client/admin/delete_o_auth2_token_responses.go +++ b/internal/httpclient/client/admin/delete_o_auth2_token_responses.go @@ -41,8 +41,9 @@ func (o *DeleteOAuth2TokenReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewDeleteOAuth2TokenNoContent() *DeleteOAuth2TokenNoContent { return &DeleteOAuth2TokenNoContent{} } -/* DeleteOAuth2TokenNoContent describes a response with status code 204, with default header values. +/*DeleteOAuth2TokenNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DeleteOAuth2TokenNoContent struct { @@ -73,7 +74,7 @@ func NewDeleteOAuth2TokenUnauthorized() *DeleteOAuth2TokenUnauthorized { return &DeleteOAuth2TokenUnauthorized{} } -/* DeleteOAuth2TokenUnauthorized describes a response with status code 401, with default header values. +/*DeleteOAuth2TokenUnauthorized handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type DeleteOAuth2TokenUnauthorized struct { func (o *DeleteOAuth2TokenUnauthorized) Error() string { return fmt.Sprintf("[DELETE /oauth2/tokens][%d] deleteOAuth2TokenUnauthorized %+v", 401, o.Payload) } + func (o *DeleteOAuth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewDeleteOAuth2TokenInternalServerError() *DeleteOAuth2TokenInternalServerE return &DeleteOAuth2TokenInternalServerError{} } -/* DeleteOAuth2TokenInternalServerError describes a response with status code 500, with default header values. +/*DeleteOAuth2TokenInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type DeleteOAuth2TokenInternalServerError struct { func (o *DeleteOAuth2TokenInternalServerError) Error() string { return fmt.Sprintf("[DELETE /oauth2/tokens][%d] deleteOAuth2TokenInternalServerError %+v", 500, o.Payload) } + func (o *DeleteOAuth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go index ae82bc9c891..619a282d2bd 100644 --- a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go +++ b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_parameters.go @@ -18,50 +18,51 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewFlushInactiveOAuth2TokensParams creates a new FlushInactiveOAuth2TokensParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewFlushInactiveOAuth2TokensParams creates a new FlushInactiveOAuth2TokensParams object +// with the default values initialized. func NewFlushInactiveOAuth2TokensParams() *FlushInactiveOAuth2TokensParams { + var () return &FlushInactiveOAuth2TokensParams{ + timeout: cr.DefaultTimeout, } } // NewFlushInactiveOAuth2TokensParamsWithTimeout creates a new FlushInactiveOAuth2TokensParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewFlushInactiveOAuth2TokensParamsWithTimeout(timeout time.Duration) *FlushInactiveOAuth2TokensParams { + var () return &FlushInactiveOAuth2TokensParams{ + timeout: timeout, } } // NewFlushInactiveOAuth2TokensParamsWithContext creates a new FlushInactiveOAuth2TokensParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewFlushInactiveOAuth2TokensParamsWithContext(ctx context.Context) *FlushInactiveOAuth2TokensParams { + var () return &FlushInactiveOAuth2TokensParams{ + Context: ctx, } } // NewFlushInactiveOAuth2TokensParamsWithHTTPClient creates a new FlushInactiveOAuth2TokensParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewFlushInactiveOAuth2TokensParamsWithHTTPClient(client *http.Client) *FlushInactiveOAuth2TokensParams { + var () return &FlushInactiveOAuth2TokensParams{ HTTPClient: client, } } -/* FlushInactiveOAuth2TokensParams contains all the parameters to send to the API endpoint - for the flush inactive o auth2 tokens operation. - - Typically these are written to a http.Request. +/*FlushInactiveOAuth2TokensParams contains all the parameters to send to the API endpoint +for the flush inactive o auth2 tokens operation typically these are written to a http.Request */ type FlushInactiveOAuth2TokensParams struct { - // Body. + /*Body*/ Body *models.FlushInactiveOAuth2TokensRequest timeout time.Duration @@ -69,21 +70,6 @@ type FlushInactiveOAuth2TokensParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the flush inactive o auth2 tokens params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *FlushInactiveOAuth2TokensParams) WithDefaults() *FlushInactiveOAuth2TokensParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the flush inactive o auth2 tokens params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *FlushInactiveOAuth2TokensParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the flush inactive o auth2 tokens params func (o *FlushInactiveOAuth2TokensParams) WithTimeout(timeout time.Duration) *FlushInactiveOAuth2TokensParams { o.SetTimeout(timeout) @@ -135,6 +121,7 @@ func (o *FlushInactiveOAuth2TokensParams) WriteToRequest(r runtime.ClientRequest return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go index 7632e44e2ce..242ee437e59 100644 --- a/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go +++ b/internal/httpclient/client/admin/flush_inactive_o_auth2_tokens_responses.go @@ -41,8 +41,9 @@ func (o *FlushInactiveOAuth2TokensReader) ReadResponse(response runtime.ClientRe return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewFlushInactiveOAuth2TokensNoContent() *FlushInactiveOAuth2TokensNoContent return &FlushInactiveOAuth2TokensNoContent{} } -/* FlushInactiveOAuth2TokensNoContent describes a response with status code 204, with default header values. +/*FlushInactiveOAuth2TokensNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type FlushInactiveOAuth2TokensNoContent struct { @@ -73,7 +74,7 @@ func NewFlushInactiveOAuth2TokensUnauthorized() *FlushInactiveOAuth2TokensUnauth return &FlushInactiveOAuth2TokensUnauthorized{} } -/* FlushInactiveOAuth2TokensUnauthorized describes a response with status code 401, with default header values. +/*FlushInactiveOAuth2TokensUnauthorized handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type FlushInactiveOAuth2TokensUnauthorized struct { func (o *FlushInactiveOAuth2TokensUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/flush][%d] flushInactiveOAuth2TokensUnauthorized %+v", 401, o.Payload) } + func (o *FlushInactiveOAuth2TokensUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewFlushInactiveOAuth2TokensInternalServerError() *FlushInactiveOAuth2Token return &FlushInactiveOAuth2TokensInternalServerError{} } -/* FlushInactiveOAuth2TokensInternalServerError describes a response with status code 500, with default header values. +/*FlushInactiveOAuth2TokensInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type FlushInactiveOAuth2TokensInternalServerError struct { func (o *FlushInactiveOAuth2TokensInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/flush][%d] flushInactiveOAuth2TokensInternalServerError %+v", 500, o.Payload) } + func (o *FlushInactiveOAuth2TokensInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_consent_request_parameters.go b/internal/httpclient/client/admin/get_consent_request_parameters.go index 3cdba97c4a1..76033747908 100644 --- a/internal/httpclient/client/admin/get_consent_request_parameters.go +++ b/internal/httpclient/client/admin/get_consent_request_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetConsentRequestParams creates a new GetConsentRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetConsentRequestParams creates a new GetConsentRequestParams object +// with the default values initialized. func NewGetConsentRequestParams() *GetConsentRequestParams { + var () return &GetConsentRequestParams{ + timeout: cr.DefaultTimeout, } } // NewGetConsentRequestParamsWithTimeout creates a new GetConsentRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetConsentRequestParamsWithTimeout(timeout time.Duration) *GetConsentRequestParams { + var () return &GetConsentRequestParams{ + timeout: timeout, } } // NewGetConsentRequestParamsWithContext creates a new GetConsentRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetConsentRequestParamsWithContext(ctx context.Context) *GetConsentRequestParams { + var () return &GetConsentRequestParams{ + Context: ctx, } } // NewGetConsentRequestParamsWithHTTPClient creates a new GetConsentRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetConsentRequestParamsWithHTTPClient(client *http.Client) *GetConsentRequestParams { + var () return &GetConsentRequestParams{ HTTPClient: client, } } -/* GetConsentRequestParams contains all the parameters to send to the API endpoint - for the get consent request operation. - - Typically these are written to a http.Request. +/*GetConsentRequestParams contains all the parameters to send to the API endpoint +for the get consent request operation typically these are written to a http.Request */ type GetConsentRequestParams struct { - // ConsentChallenge. + /*ConsentChallenge*/ ConsentChallenge string timeout time.Duration @@ -67,21 +68,6 @@ type GetConsentRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetConsentRequestParams) WithDefaults() *GetConsentRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetConsentRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get consent request params func (o *GetConsentRequestParams) WithTimeout(timeout time.Duration) *GetConsentRequestParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *GetConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg st qrConsentChallenge := o.ConsentChallenge qConsentChallenge := qrConsentChallenge if qConsentChallenge != "" { - if err := r.SetQueryParam("consent_challenge", qConsentChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/get_consent_request_responses.go b/internal/httpclient/client/admin/get_consent_request_responses.go index 6621dc5bd27..8a95208b137 100644 --- a/internal/httpclient/client/admin/get_consent_request_responses.go +++ b/internal/httpclient/client/admin/get_consent_request_responses.go @@ -47,8 +47,9 @@ func (o *GetConsentRequestReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewGetConsentRequestOK() *GetConsentRequestOK { return &GetConsentRequestOK{} } -/* GetConsentRequestOK describes a response with status code 200, with default header values. +/*GetConsentRequestOK handles this case with default header values. consentRequest */ @@ -68,6 +69,7 @@ type GetConsentRequestOK struct { func (o *GetConsentRequestOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestOK %+v", 200, o.Payload) } + func (o *GetConsentRequestOK) GetPayload() *models.ConsentRequest { return o.Payload } @@ -89,7 +91,7 @@ func NewGetConsentRequestNotFound() *GetConsentRequestNotFound { return &GetConsentRequestNotFound{} } -/* GetConsentRequestNotFound describes a response with status code 404, with default header values. +/*GetConsentRequestNotFound handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type GetConsentRequestNotFound struct { func (o *GetConsentRequestNotFound) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestNotFound %+v", 404, o.Payload) } + func (o *GetConsentRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewGetConsentRequestGone() *GetConsentRequestGone { return &GetConsentRequestGone{} } -/* GetConsentRequestGone describes a response with status code 410, with default header values. +/*GetConsentRequestGone handles this case with default header values. requestWasHandledResponse */ @@ -132,6 +135,7 @@ type GetConsentRequestGone struct { func (o *GetConsentRequestGone) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestGone %+v", 410, o.Payload) } + func (o *GetConsentRequestGone) GetPayload() *models.RequestWasHandledResponse { return o.Payload } @@ -153,7 +157,7 @@ func NewGetConsentRequestInternalServerError() *GetConsentRequestInternalServerE return &GetConsentRequestInternalServerError{} } -/* GetConsentRequestInternalServerError describes a response with status code 500, with default header values. +/*GetConsentRequestInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type GetConsentRequestInternalServerError struct { func (o *GetConsentRequestInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/consent][%d] getConsentRequestInternalServerError %+v", 500, o.Payload) } + func (o *GetConsentRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_json_web_key_parameters.go b/internal/httpclient/client/admin/get_json_web_key_parameters.go index bf7429056e8..c8c609b8695 100644 --- a/internal/httpclient/client/admin/get_json_web_key_parameters.go +++ b/internal/httpclient/client/admin/get_json_web_key_parameters.go @@ -16,58 +16,58 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetJSONWebKeyParams creates a new GetJSONWebKeyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetJSONWebKeyParams creates a new GetJSONWebKeyParams object +// with the default values initialized. func NewGetJSONWebKeyParams() *GetJSONWebKeyParams { + var () return &GetJSONWebKeyParams{ + timeout: cr.DefaultTimeout, } } // NewGetJSONWebKeyParamsWithTimeout creates a new GetJSONWebKeyParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetJSONWebKeyParamsWithTimeout(timeout time.Duration) *GetJSONWebKeyParams { + var () return &GetJSONWebKeyParams{ + timeout: timeout, } } // NewGetJSONWebKeyParamsWithContext creates a new GetJSONWebKeyParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetJSONWebKeyParamsWithContext(ctx context.Context) *GetJSONWebKeyParams { + var () return &GetJSONWebKeyParams{ + Context: ctx, } } // NewGetJSONWebKeyParamsWithHTTPClient creates a new GetJSONWebKeyParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetJSONWebKeyParamsWithHTTPClient(client *http.Client) *GetJSONWebKeyParams { + var () return &GetJSONWebKeyParams{ HTTPClient: client, } } -/* GetJSONWebKeyParams contains all the parameters to send to the API endpoint - for the get Json web key operation. - - Typically these are written to a http.Request. +/*GetJSONWebKeyParams contains all the parameters to send to the API endpoint +for the get Json web key operation typically these are written to a http.Request */ type GetJSONWebKeyParams struct { - /* Kid. + /*Kid + The kid of the desired key - The kid of the desired key */ Kid string + /*Set + The set - /* Set. - - The set */ Set string @@ -76,21 +76,6 @@ type GetJSONWebKeyParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetJSONWebKeyParams) WithDefaults() *GetJSONWebKeyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetJSONWebKeyParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get Json web key params func (o *GetJSONWebKeyParams) WithTimeout(timeout time.Duration) *GetJSONWebKeyParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_json_web_key_responses.go b/internal/httpclient/client/admin/get_json_web_key_responses.go index 2a0c4c2e50d..16951135c77 100644 --- a/internal/httpclient/client/admin/get_json_web_key_responses.go +++ b/internal/httpclient/client/admin/get_json_web_key_responses.go @@ -41,8 +41,9 @@ func (o *GetJSONWebKeyReader) ReadResponse(response runtime.ClientResponse, cons return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewGetJSONWebKeyOK() *GetJSONWebKeyOK { return &GetJSONWebKeyOK{} } -/* GetJSONWebKeyOK describes a response with status code 200, with default header values. +/*GetJSONWebKeyOK handles this case with default header values. JSONWebKeySet */ @@ -62,6 +63,7 @@ type GetJSONWebKeyOK struct { func (o *GetJSONWebKeyOK) Error() string { return fmt.Sprintf("[GET /keys/{set}/{kid}][%d] getJsonWebKeyOK %+v", 200, o.Payload) } + func (o *GetJSONWebKeyOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -83,7 +85,7 @@ func NewGetJSONWebKeyNotFound() *GetJSONWebKeyNotFound { return &GetJSONWebKeyNotFound{} } -/* GetJSONWebKeyNotFound describes a response with status code 404, with default header values. +/*GetJSONWebKeyNotFound handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type GetJSONWebKeyNotFound struct { func (o *GetJSONWebKeyNotFound) Error() string { return fmt.Sprintf("[GET /keys/{set}/{kid}][%d] getJsonWebKeyNotFound %+v", 404, o.Payload) } + func (o *GetJSONWebKeyNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewGetJSONWebKeyInternalServerError() *GetJSONWebKeyInternalServerError { return &GetJSONWebKeyInternalServerError{} } -/* GetJSONWebKeyInternalServerError describes a response with status code 500, with default header values. +/*GetJSONWebKeyInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type GetJSONWebKeyInternalServerError struct { func (o *GetJSONWebKeyInternalServerError) Error() string { return fmt.Sprintf("[GET /keys/{set}/{kid}][%d] getJsonWebKeyInternalServerError %+v", 500, o.Payload) } + func (o *GetJSONWebKeyInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_json_web_key_set_parameters.go b/internal/httpclient/client/admin/get_json_web_key_set_parameters.go index 1635ddb667d..34dee113c0d 100644 --- a/internal/httpclient/client/admin/get_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/get_json_web_key_set_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetJSONWebKeySetParams creates a new GetJSONWebKeySetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetJSONWebKeySetParams creates a new GetJSONWebKeySetParams object +// with the default values initialized. func NewGetJSONWebKeySetParams() *GetJSONWebKeySetParams { + var () return &GetJSONWebKeySetParams{ + timeout: cr.DefaultTimeout, } } // NewGetJSONWebKeySetParamsWithTimeout creates a new GetJSONWebKeySetParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetJSONWebKeySetParamsWithTimeout(timeout time.Duration) *GetJSONWebKeySetParams { + var () return &GetJSONWebKeySetParams{ + timeout: timeout, } } // NewGetJSONWebKeySetParamsWithContext creates a new GetJSONWebKeySetParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetJSONWebKeySetParamsWithContext(ctx context.Context) *GetJSONWebKeySetParams { + var () return &GetJSONWebKeySetParams{ + Context: ctx, } } // NewGetJSONWebKeySetParamsWithHTTPClient creates a new GetJSONWebKeySetParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetJSONWebKeySetParamsWithHTTPClient(client *http.Client) *GetJSONWebKeySetParams { + var () return &GetJSONWebKeySetParams{ HTTPClient: client, } } -/* GetJSONWebKeySetParams contains all the parameters to send to the API endpoint - for the get Json web key set operation. - - Typically these are written to a http.Request. +/*GetJSONWebKeySetParams contains all the parameters to send to the API endpoint +for the get Json web key set operation typically these are written to a http.Request */ type GetJSONWebKeySetParams struct { - /* Set. + /*Set + The set - The set */ Set string @@ -70,21 +71,6 @@ type GetJSONWebKeySetParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetJSONWebKeySetParams) WithDefaults() *GetJSONWebKeySetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetJSONWebKeySetParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get Json web key set params func (o *GetJSONWebKeySetParams) WithTimeout(timeout time.Duration) *GetJSONWebKeySetParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_json_web_key_set_responses.go b/internal/httpclient/client/admin/get_json_web_key_set_responses.go index 071a09ee356..3c04c72704c 100644 --- a/internal/httpclient/client/admin/get_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/get_json_web_key_set_responses.go @@ -47,8 +47,9 @@ func (o *GetJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewGetJSONWebKeySetOK() *GetJSONWebKeySetOK { return &GetJSONWebKeySetOK{} } -/* GetJSONWebKeySetOK describes a response with status code 200, with default header values. +/*GetJSONWebKeySetOK handles this case with default header values. JSONWebKeySet */ @@ -68,6 +69,7 @@ type GetJSONWebKeySetOK struct { func (o *GetJSONWebKeySetOK) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetOK %+v", 200, o.Payload) } + func (o *GetJSONWebKeySetOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -89,7 +91,7 @@ func NewGetJSONWebKeySetUnauthorized() *GetJSONWebKeySetUnauthorized { return &GetJSONWebKeySetUnauthorized{} } -/* GetJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. +/*GetJSONWebKeySetUnauthorized handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type GetJSONWebKeySetUnauthorized struct { func (o *GetJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetUnauthorized %+v", 401, o.Payload) } + func (o *GetJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewGetJSONWebKeySetForbidden() *GetJSONWebKeySetForbidden { return &GetJSONWebKeySetForbidden{} } -/* GetJSONWebKeySetForbidden describes a response with status code 403, with default header values. +/*GetJSONWebKeySetForbidden handles this case with default header values. jsonError */ @@ -132,6 +135,7 @@ type GetJSONWebKeySetForbidden struct { func (o *GetJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetForbidden %+v", 403, o.Payload) } + func (o *GetJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -153,7 +157,7 @@ func NewGetJSONWebKeySetInternalServerError() *GetJSONWebKeySetInternalServerErr return &GetJSONWebKeySetInternalServerError{} } -/* GetJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. +/*GetJSONWebKeySetInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type GetJSONWebKeySetInternalServerError struct { func (o *GetJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[GET /keys/{set}][%d] getJsonWebKeySetInternalServerError %+v", 500, o.Payload) } + func (o *GetJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_login_request_parameters.go b/internal/httpclient/client/admin/get_login_request_parameters.go index 55a3dae116f..32ce4b750f3 100644 --- a/internal/httpclient/client/admin/get_login_request_parameters.go +++ b/internal/httpclient/client/admin/get_login_request_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLoginRequestParams creates a new GetLoginRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetLoginRequestParams creates a new GetLoginRequestParams object +// with the default values initialized. func NewGetLoginRequestParams() *GetLoginRequestParams { + var () return &GetLoginRequestParams{ + timeout: cr.DefaultTimeout, } } // NewGetLoginRequestParamsWithTimeout creates a new GetLoginRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetLoginRequestParamsWithTimeout(timeout time.Duration) *GetLoginRequestParams { + var () return &GetLoginRequestParams{ + timeout: timeout, } } // NewGetLoginRequestParamsWithContext creates a new GetLoginRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetLoginRequestParamsWithContext(ctx context.Context) *GetLoginRequestParams { + var () return &GetLoginRequestParams{ + Context: ctx, } } // NewGetLoginRequestParamsWithHTTPClient creates a new GetLoginRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetLoginRequestParamsWithHTTPClient(client *http.Client) *GetLoginRequestParams { + var () return &GetLoginRequestParams{ HTTPClient: client, } } -/* GetLoginRequestParams contains all the parameters to send to the API endpoint - for the get login request operation. - - Typically these are written to a http.Request. +/*GetLoginRequestParams contains all the parameters to send to the API endpoint +for the get login request operation typically these are written to a http.Request */ type GetLoginRequestParams struct { - // LoginChallenge. + /*LoginChallenge*/ LoginChallenge string timeout time.Duration @@ -67,21 +68,6 @@ type GetLoginRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLoginRequestParams) WithDefaults() *GetLoginRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLoginRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get login request params func (o *GetLoginRequestParams) WithTimeout(timeout time.Duration) *GetLoginRequestParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *GetLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg strf qrLoginChallenge := o.LoginChallenge qLoginChallenge := qrLoginChallenge if qLoginChallenge != "" { - if err := r.SetQueryParam("login_challenge", qLoginChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/get_login_request_responses.go b/internal/httpclient/client/admin/get_login_request_responses.go index 4eaddfbf39f..57221a73d49 100644 --- a/internal/httpclient/client/admin/get_login_request_responses.go +++ b/internal/httpclient/client/admin/get_login_request_responses.go @@ -53,8 +53,9 @@ func (o *GetLoginRequestReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -63,7 +64,7 @@ func NewGetLoginRequestOK() *GetLoginRequestOK { return &GetLoginRequestOK{} } -/* GetLoginRequestOK describes a response with status code 200, with default header values. +/*GetLoginRequestOK handles this case with default header values. loginRequest */ @@ -74,6 +75,7 @@ type GetLoginRequestOK struct { func (o *GetLoginRequestOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestOK %+v", 200, o.Payload) } + func (o *GetLoginRequestOK) GetPayload() *models.LoginRequest { return o.Payload } @@ -95,7 +97,7 @@ func NewGetLoginRequestBadRequest() *GetLoginRequestBadRequest { return &GetLoginRequestBadRequest{} } -/* GetLoginRequestBadRequest describes a response with status code 400, with default header values. +/*GetLoginRequestBadRequest handles this case with default header values. jsonError */ @@ -106,6 +108,7 @@ type GetLoginRequestBadRequest struct { func (o *GetLoginRequestBadRequest) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestBadRequest %+v", 400, o.Payload) } + func (o *GetLoginRequestBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -127,7 +130,7 @@ func NewGetLoginRequestNotFound() *GetLoginRequestNotFound { return &GetLoginRequestNotFound{} } -/* GetLoginRequestNotFound describes a response with status code 404, with default header values. +/*GetLoginRequestNotFound handles this case with default header values. jsonError */ @@ -138,6 +141,7 @@ type GetLoginRequestNotFound struct { func (o *GetLoginRequestNotFound) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestNotFound %+v", 404, o.Payload) } + func (o *GetLoginRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -159,7 +163,7 @@ func NewGetLoginRequestGone() *GetLoginRequestGone { return &GetLoginRequestGone{} } -/* GetLoginRequestGone describes a response with status code 410, with default header values. +/*GetLoginRequestGone handles this case with default header values. requestWasHandledResponse */ @@ -170,6 +174,7 @@ type GetLoginRequestGone struct { func (o *GetLoginRequestGone) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestGone %+v", 410, o.Payload) } + func (o *GetLoginRequestGone) GetPayload() *models.RequestWasHandledResponse { return o.Payload } @@ -191,7 +196,7 @@ func NewGetLoginRequestInternalServerError() *GetLoginRequestInternalServerError return &GetLoginRequestInternalServerError{} } -/* GetLoginRequestInternalServerError describes a response with status code 500, with default header values. +/*GetLoginRequestInternalServerError handles this case with default header values. jsonError */ @@ -202,6 +207,7 @@ type GetLoginRequestInternalServerError struct { func (o *GetLoginRequestInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/login][%d] getLoginRequestInternalServerError %+v", 500, o.Payload) } + func (o *GetLoginRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_logout_request_parameters.go b/internal/httpclient/client/admin/get_logout_request_parameters.go index 97cf9f7e4bc..27ed8793be3 100644 --- a/internal/httpclient/client/admin/get_logout_request_parameters.go +++ b/internal/httpclient/client/admin/get_logout_request_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetLogoutRequestParams creates a new GetLogoutRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetLogoutRequestParams creates a new GetLogoutRequestParams object +// with the default values initialized. func NewGetLogoutRequestParams() *GetLogoutRequestParams { + var () return &GetLogoutRequestParams{ + timeout: cr.DefaultTimeout, } } // NewGetLogoutRequestParamsWithTimeout creates a new GetLogoutRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetLogoutRequestParamsWithTimeout(timeout time.Duration) *GetLogoutRequestParams { + var () return &GetLogoutRequestParams{ + timeout: timeout, } } // NewGetLogoutRequestParamsWithContext creates a new GetLogoutRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetLogoutRequestParamsWithContext(ctx context.Context) *GetLogoutRequestParams { + var () return &GetLogoutRequestParams{ + Context: ctx, } } // NewGetLogoutRequestParamsWithHTTPClient creates a new GetLogoutRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetLogoutRequestParamsWithHTTPClient(client *http.Client) *GetLogoutRequestParams { + var () return &GetLogoutRequestParams{ HTTPClient: client, } } -/* GetLogoutRequestParams contains all the parameters to send to the API endpoint - for the get logout request operation. - - Typically these are written to a http.Request. +/*GetLogoutRequestParams contains all the parameters to send to the API endpoint +for the get logout request operation typically these are written to a http.Request */ type GetLogoutRequestParams struct { - // LogoutChallenge. + /*LogoutChallenge*/ LogoutChallenge string timeout time.Duration @@ -67,21 +68,6 @@ type GetLogoutRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLogoutRequestParams) WithDefaults() *GetLogoutRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetLogoutRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get logout request params func (o *GetLogoutRequestParams) WithTimeout(timeout time.Duration) *GetLogoutRequestParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *GetLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg str qrLogoutChallenge := o.LogoutChallenge qLogoutChallenge := qrLogoutChallenge if qLogoutChallenge != "" { - if err := r.SetQueryParam("logout_challenge", qLogoutChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/get_logout_request_responses.go b/internal/httpclient/client/admin/get_logout_request_responses.go index 0b6448c101b..9d708a06795 100644 --- a/internal/httpclient/client/admin/get_logout_request_responses.go +++ b/internal/httpclient/client/admin/get_logout_request_responses.go @@ -47,8 +47,9 @@ func (o *GetLogoutRequestReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewGetLogoutRequestOK() *GetLogoutRequestOK { return &GetLogoutRequestOK{} } -/* GetLogoutRequestOK describes a response with status code 200, with default header values. +/*GetLogoutRequestOK handles this case with default header values. logoutRequest */ @@ -68,6 +69,7 @@ type GetLogoutRequestOK struct { func (o *GetLogoutRequestOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestOK %+v", 200, o.Payload) } + func (o *GetLogoutRequestOK) GetPayload() *models.LogoutRequest { return o.Payload } @@ -89,7 +91,7 @@ func NewGetLogoutRequestNotFound() *GetLogoutRequestNotFound { return &GetLogoutRequestNotFound{} } -/* GetLogoutRequestNotFound describes a response with status code 404, with default header values. +/*GetLogoutRequestNotFound handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type GetLogoutRequestNotFound struct { func (o *GetLogoutRequestNotFound) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestNotFound %+v", 404, o.Payload) } + func (o *GetLogoutRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewGetLogoutRequestGone() *GetLogoutRequestGone { return &GetLogoutRequestGone{} } -/* GetLogoutRequestGone describes a response with status code 410, with default header values. +/*GetLogoutRequestGone handles this case with default header values. requestWasHandledResponse */ @@ -132,6 +135,7 @@ type GetLogoutRequestGone struct { func (o *GetLogoutRequestGone) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestGone %+v", 410, o.Payload) } + func (o *GetLogoutRequestGone) GetPayload() *models.RequestWasHandledResponse { return o.Payload } @@ -153,7 +157,7 @@ func NewGetLogoutRequestInternalServerError() *GetLogoutRequestInternalServerErr return &GetLogoutRequestInternalServerError{} } -/* GetLogoutRequestInternalServerError describes a response with status code 500, with default header values. +/*GetLogoutRequestInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type GetLogoutRequestInternalServerError struct { func (o *GetLogoutRequestInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/requests/logout][%d] getLogoutRequestInternalServerError %+v", 500, o.Payload) } + func (o *GetLogoutRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_o_auth2_client_parameters.go b/internal/httpclient/client/admin/get_o_auth2_client_parameters.go index f9af2c1f16f..ea7cb067357 100644 --- a/internal/httpclient/client/admin/get_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/get_o_auth2_client_parameters.go @@ -16,52 +16,53 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetOAuth2ClientParams creates a new GetOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetOAuth2ClientParams creates a new GetOAuth2ClientParams object +// with the default values initialized. func NewGetOAuth2ClientParams() *GetOAuth2ClientParams { + var () return &GetOAuth2ClientParams{ + timeout: cr.DefaultTimeout, } } // NewGetOAuth2ClientParamsWithTimeout creates a new GetOAuth2ClientParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetOAuth2ClientParamsWithTimeout(timeout time.Duration) *GetOAuth2ClientParams { + var () return &GetOAuth2ClientParams{ + timeout: timeout, } } // NewGetOAuth2ClientParamsWithContext creates a new GetOAuth2ClientParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetOAuth2ClientParamsWithContext(ctx context.Context) *GetOAuth2ClientParams { + var () return &GetOAuth2ClientParams{ + Context: ctx, } } // NewGetOAuth2ClientParamsWithHTTPClient creates a new GetOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetOAuth2ClientParamsWithHTTPClient(client *http.Client) *GetOAuth2ClientParams { + var () return &GetOAuth2ClientParams{ HTTPClient: client, } } -/* GetOAuth2ClientParams contains all the parameters to send to the API endpoint - for the get o auth2 client operation. - - Typically these are written to a http.Request. +/*GetOAuth2ClientParams contains all the parameters to send to the API endpoint +for the get o auth2 client operation typically these are written to a http.Request */ type GetOAuth2ClientParams struct { - /* ID. + /*ID + The id of the OAuth 2.0 Client. - The id of the OAuth 2.0 Client. */ ID string @@ -70,21 +71,6 @@ type GetOAuth2ClientParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetOAuth2ClientParams) WithDefaults() *GetOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get o auth2 client params func (o *GetOAuth2ClientParams) WithTimeout(timeout time.Duration) *GetOAuth2ClientParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_o_auth2_client_responses.go b/internal/httpclient/client/admin/get_o_auth2_client_responses.go index f00e4038c4d..1f156792a72 100644 --- a/internal/httpclient/client/admin/get_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/get_o_auth2_client_responses.go @@ -41,8 +41,9 @@ func (o *GetOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewGetOAuth2ClientOK() *GetOAuth2ClientOK { return &GetOAuth2ClientOK{} } -/* GetOAuth2ClientOK describes a response with status code 200, with default header values. +/*GetOAuth2ClientOK handles this case with default header values. oAuth2Client */ @@ -62,6 +63,7 @@ type GetOAuth2ClientOK struct { func (o *GetOAuth2ClientOK) Error() string { return fmt.Sprintf("[GET /clients/{id}][%d] getOAuth2ClientOK %+v", 200, o.Payload) } + func (o *GetOAuth2ClientOK) GetPayload() *models.OAuth2Client { return o.Payload } @@ -83,7 +85,7 @@ func NewGetOAuth2ClientUnauthorized() *GetOAuth2ClientUnauthorized { return &GetOAuth2ClientUnauthorized{} } -/* GetOAuth2ClientUnauthorized describes a response with status code 401, with default header values. +/*GetOAuth2ClientUnauthorized handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type GetOAuth2ClientUnauthorized struct { func (o *GetOAuth2ClientUnauthorized) Error() string { return fmt.Sprintf("[GET /clients/{id}][%d] getOAuth2ClientUnauthorized %+v", 401, o.Payload) } + func (o *GetOAuth2ClientUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewGetOAuth2ClientInternalServerError() *GetOAuth2ClientInternalServerError return &GetOAuth2ClientInternalServerError{} } -/* GetOAuth2ClientInternalServerError describes a response with status code 500, with default header values. +/*GetOAuth2ClientInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type GetOAuth2ClientInternalServerError struct { func (o *GetOAuth2ClientInternalServerError) Error() string { return fmt.Sprintf("[GET /clients/{id}][%d] getOAuth2ClientInternalServerError %+v", 500, o.Payload) } + func (o *GetOAuth2ClientInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/get_version_parameters.go b/internal/httpclient/client/admin/get_version_parameters.go index 56746becb66..24417d3a303 100644 --- a/internal/httpclient/client/admin/get_version_parameters.go +++ b/internal/httpclient/client/admin/get_version_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewGetVersionParams creates a new GetVersionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewGetVersionParams creates a new GetVersionParams object +// with the default values initialized. func NewGetVersionParams() *GetVersionParams { + return &GetVersionParams{ + timeout: cr.DefaultTimeout, } } // NewGetVersionParamsWithTimeout creates a new GetVersionParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewGetVersionParamsWithTimeout(timeout time.Duration) *GetVersionParams { + return &GetVersionParams{ + timeout: timeout, } } // NewGetVersionParamsWithContext creates a new GetVersionParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewGetVersionParamsWithContext(ctx context.Context) *GetVersionParams { + return &GetVersionParams{ + Context: ctx, } } // NewGetVersionParamsWithHTTPClient creates a new GetVersionParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewGetVersionParamsWithHTTPClient(client *http.Client) *GetVersionParams { + return &GetVersionParams{ HTTPClient: client, } } -/* GetVersionParams contains all the parameters to send to the API endpoint - for the get version operation. - - Typically these are written to a http.Request. +/*GetVersionParams contains all the parameters to send to the API endpoint +for the get version operation typically these are written to a http.Request */ type GetVersionParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type GetVersionParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the get version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetVersionParams) WithDefaults() *GetVersionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetVersionParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the get version params func (o *GetVersionParams) WithTimeout(timeout time.Duration) *GetVersionParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/get_version_responses.go b/internal/httpclient/client/admin/get_version_responses.go index 55510cd6c00..1755c1707da 100644 --- a/internal/httpclient/client/admin/get_version_responses.go +++ b/internal/httpclient/client/admin/get_version_responses.go @@ -29,8 +29,9 @@ func (o *GetVersionReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return result, nil + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -39,7 +40,7 @@ func NewGetVersionOK() *GetVersionOK { return &GetVersionOK{} } -/* GetVersionOK describes a response with status code 200, with default header values. +/*GetVersionOK handles this case with default header values. version */ @@ -50,6 +51,7 @@ type GetVersionOK struct { func (o *GetVersionOK) Error() string { return fmt.Sprintf("[GET /version][%d] getVersionOK %+v", 200, o.Payload) } + func (o *GetVersionOK) GetPayload() *models.Version { return o.Payload } diff --git a/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go b/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go index c1addcfac03..3913438d85d 100644 --- a/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go +++ b/internal/httpclient/client/admin/introspect_o_auth2_token_parameters.go @@ -16,62 +16,62 @@ import ( "github.com/go-openapi/strfmt" ) -// NewIntrospectOAuth2TokenParams creates a new IntrospectOAuth2TokenParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewIntrospectOAuth2TokenParams creates a new IntrospectOAuth2TokenParams object +// with the default values initialized. func NewIntrospectOAuth2TokenParams() *IntrospectOAuth2TokenParams { + var () return &IntrospectOAuth2TokenParams{ + timeout: cr.DefaultTimeout, } } // NewIntrospectOAuth2TokenParamsWithTimeout creates a new IntrospectOAuth2TokenParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewIntrospectOAuth2TokenParamsWithTimeout(timeout time.Duration) *IntrospectOAuth2TokenParams { + var () return &IntrospectOAuth2TokenParams{ + timeout: timeout, } } // NewIntrospectOAuth2TokenParamsWithContext creates a new IntrospectOAuth2TokenParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewIntrospectOAuth2TokenParamsWithContext(ctx context.Context) *IntrospectOAuth2TokenParams { + var () return &IntrospectOAuth2TokenParams{ + Context: ctx, } } // NewIntrospectOAuth2TokenParamsWithHTTPClient creates a new IntrospectOAuth2TokenParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewIntrospectOAuth2TokenParamsWithHTTPClient(client *http.Client) *IntrospectOAuth2TokenParams { + var () return &IntrospectOAuth2TokenParams{ HTTPClient: client, } } -/* IntrospectOAuth2TokenParams contains all the parameters to send to the API endpoint - for the introspect o auth2 token operation. - - Typically these are written to a http.Request. +/*IntrospectOAuth2TokenParams contains all the parameters to send to the API endpoint +for the introspect o auth2 token operation typically these are written to a http.Request */ type IntrospectOAuth2TokenParams struct { - /* Scope. - - An optional, space separated list of required scopes. If the access token was not granted one of the + /*Scope + An optional, space separated list of required scopes. If the access token was not granted one of the scopes, the result of active will be false. + */ Scope *string - - /* Token. - - The string value of the token. For access tokens, this + /*Token + The string value of the token. For access tokens, this is the "access_token" value returned from the token endpoint defined in OAuth 2.0. For refresh tokens, this is the "refresh_token" value returned. + */ Token string @@ -80,21 +80,6 @@ type IntrospectOAuth2TokenParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the introspect o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IntrospectOAuth2TokenParams) WithDefaults() *IntrospectOAuth2TokenParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the introspect o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IntrospectOAuth2TokenParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the introspect o auth2 token params func (o *IntrospectOAuth2TokenParams) WithTimeout(timeout time.Duration) *IntrospectOAuth2TokenParams { o.SetTimeout(timeout) @@ -171,6 +156,7 @@ func (o *IntrospectOAuth2TokenParams) WriteToRequest(r runtime.ClientRequest, re return err } } + } // form param token diff --git a/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go b/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go index 8ea409176f7..5dff4abf68e 100644 --- a/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go +++ b/internal/httpclient/client/admin/introspect_o_auth2_token_responses.go @@ -41,8 +41,9 @@ func (o *IntrospectOAuth2TokenReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewIntrospectOAuth2TokenOK() *IntrospectOAuth2TokenOK { return &IntrospectOAuth2TokenOK{} } -/* IntrospectOAuth2TokenOK describes a response with status code 200, with default header values. +/*IntrospectOAuth2TokenOK handles this case with default header values. oAuth2TokenIntrospection */ @@ -62,6 +63,7 @@ type IntrospectOAuth2TokenOK struct { func (o *IntrospectOAuth2TokenOK) Error() string { return fmt.Sprintf("[POST /oauth2/introspect][%d] introspectOAuth2TokenOK %+v", 200, o.Payload) } + func (o *IntrospectOAuth2TokenOK) GetPayload() *models.OAuth2TokenIntrospection { return o.Payload } @@ -83,7 +85,7 @@ func NewIntrospectOAuth2TokenUnauthorized() *IntrospectOAuth2TokenUnauthorized { return &IntrospectOAuth2TokenUnauthorized{} } -/* IntrospectOAuth2TokenUnauthorized describes a response with status code 401, with default header values. +/*IntrospectOAuth2TokenUnauthorized handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type IntrospectOAuth2TokenUnauthorized struct { func (o *IntrospectOAuth2TokenUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/introspect][%d] introspectOAuth2TokenUnauthorized %+v", 401, o.Payload) } + func (o *IntrospectOAuth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewIntrospectOAuth2TokenInternalServerError() *IntrospectOAuth2TokenInterna return &IntrospectOAuth2TokenInternalServerError{} } -/* IntrospectOAuth2TokenInternalServerError describes a response with status code 500, with default header values. +/*IntrospectOAuth2TokenInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type IntrospectOAuth2TokenInternalServerError struct { func (o *IntrospectOAuth2TokenInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/introspect][%d] introspectOAuth2TokenInternalServerError %+v", 500, o.Payload) } + func (o *IntrospectOAuth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/is_instance_alive_parameters.go b/internal/httpclient/client/admin/is_instance_alive_parameters.go index 50766f53d7e..44c9c204fe3 100644 --- a/internal/httpclient/client/admin/is_instance_alive_parameters.go +++ b/internal/httpclient/client/admin/is_instance_alive_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewIsInstanceAliveParams creates a new IsInstanceAliveParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewIsInstanceAliveParams creates a new IsInstanceAliveParams object +// with the default values initialized. func NewIsInstanceAliveParams() *IsInstanceAliveParams { + return &IsInstanceAliveParams{ + timeout: cr.DefaultTimeout, } } // NewIsInstanceAliveParamsWithTimeout creates a new IsInstanceAliveParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewIsInstanceAliveParamsWithTimeout(timeout time.Duration) *IsInstanceAliveParams { + return &IsInstanceAliveParams{ + timeout: timeout, } } // NewIsInstanceAliveParamsWithContext creates a new IsInstanceAliveParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewIsInstanceAliveParamsWithContext(ctx context.Context) *IsInstanceAliveParams { + return &IsInstanceAliveParams{ + Context: ctx, } } // NewIsInstanceAliveParamsWithHTTPClient creates a new IsInstanceAliveParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewIsInstanceAliveParamsWithHTTPClient(client *http.Client) *IsInstanceAliveParams { + return &IsInstanceAliveParams{ HTTPClient: client, } } -/* IsInstanceAliveParams contains all the parameters to send to the API endpoint - for the is instance alive operation. - - Typically these are written to a http.Request. +/*IsInstanceAliveParams contains all the parameters to send to the API endpoint +for the is instance alive operation typically these are written to a http.Request */ type IsInstanceAliveParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type IsInstanceAliveParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the is instance alive params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceAliveParams) WithDefaults() *IsInstanceAliveParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the is instance alive params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceAliveParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the is instance alive params func (o *IsInstanceAliveParams) WithTimeout(timeout time.Duration) *IsInstanceAliveParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/admin/is_instance_alive_responses.go b/internal/httpclient/client/admin/is_instance_alive_responses.go index fd1036d01fb..ddf10ab1b45 100644 --- a/internal/httpclient/client/admin/is_instance_alive_responses.go +++ b/internal/httpclient/client/admin/is_instance_alive_responses.go @@ -35,8 +35,9 @@ func (o *IsInstanceAliveReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewIsInstanceAliveOK() *IsInstanceAliveOK { return &IsInstanceAliveOK{} } -/* IsInstanceAliveOK describes a response with status code 200, with default header values. +/*IsInstanceAliveOK handles this case with default header values. healthStatus */ @@ -56,6 +57,7 @@ type IsInstanceAliveOK struct { func (o *IsInstanceAliveOK) Error() string { return fmt.Sprintf("[GET /health/alive][%d] isInstanceAliveOK %+v", 200, o.Payload) } + func (o *IsInstanceAliveOK) GetPayload() *models.HealthStatus { return o.Payload } @@ -77,7 +79,7 @@ func NewIsInstanceAliveInternalServerError() *IsInstanceAliveInternalServerError return &IsInstanceAliveInternalServerError{} } -/* IsInstanceAliveInternalServerError describes a response with status code 500, with default header values. +/*IsInstanceAliveInternalServerError handles this case with default header values. jsonError */ @@ -88,6 +90,7 @@ type IsInstanceAliveInternalServerError struct { func (o *IsInstanceAliveInternalServerError) Error() string { return fmt.Sprintf("[GET /health/alive][%d] isInstanceAliveInternalServerError %+v", 500, o.Payload) } + func (o *IsInstanceAliveInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/list_o_auth2_clients_parameters.go b/internal/httpclient/client/admin/list_o_auth2_clients_parameters.go index ad03327fc58..7c8c3986c43 100644 --- a/internal/httpclient/client/admin/list_o_auth2_clients_parameters.go +++ b/internal/httpclient/client/admin/list_o_auth2_clients_parameters.go @@ -17,74 +17,68 @@ import ( "github.com/go-openapi/swag" ) -// NewListOAuth2ClientsParams creates a new ListOAuth2ClientsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewListOAuth2ClientsParams creates a new ListOAuth2ClientsParams object +// with the default values initialized. func NewListOAuth2ClientsParams() *ListOAuth2ClientsParams { + var () return &ListOAuth2ClientsParams{ + timeout: cr.DefaultTimeout, } } // NewListOAuth2ClientsParamsWithTimeout creates a new ListOAuth2ClientsParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewListOAuth2ClientsParamsWithTimeout(timeout time.Duration) *ListOAuth2ClientsParams { + var () return &ListOAuth2ClientsParams{ + timeout: timeout, } } // NewListOAuth2ClientsParamsWithContext creates a new ListOAuth2ClientsParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewListOAuth2ClientsParamsWithContext(ctx context.Context) *ListOAuth2ClientsParams { + var () return &ListOAuth2ClientsParams{ + Context: ctx, } } // NewListOAuth2ClientsParamsWithHTTPClient creates a new ListOAuth2ClientsParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewListOAuth2ClientsParamsWithHTTPClient(client *http.Client) *ListOAuth2ClientsParams { + var () return &ListOAuth2ClientsParams{ HTTPClient: client, } } -/* ListOAuth2ClientsParams contains all the parameters to send to the API endpoint - for the list o auth2 clients operation. - - Typically these are written to a http.Request. +/*ListOAuth2ClientsParams contains all the parameters to send to the API endpoint +for the list o auth2 clients operation typically these are written to a http.Request */ type ListOAuth2ClientsParams struct { - /* ClientName. + /*ClientName + The name of the clients to filter by. - The name of the clients to filter by. */ ClientName *string + /*Limit + The maximum amount of clients to returned, upper bound is 500 clients. - /* Limit. - - The maximum amount of clients to returned, upper bound is 500 clients. - - Format: int64 */ Limit *int64 + /*Offset + The offset from where to start looking. - /* Offset. - - The offset from where to start looking. - - Format: int64 */ Offset *int64 + /*Owner + The owner of the clients to filter by. - /* Owner. - - The owner of the clients to filter by. */ Owner *string @@ -93,21 +87,6 @@ type ListOAuth2ClientsParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the list o auth2 clients params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListOAuth2ClientsParams) WithDefaults() *ListOAuth2ClientsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list o auth2 clients params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListOAuth2ClientsParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the list o auth2 clients params func (o *ListOAuth2ClientsParams) WithTimeout(timeout time.Duration) *ListOAuth2ClientsParams { o.SetTimeout(timeout) @@ -197,68 +176,64 @@ func (o *ListOAuth2ClientsParams) WriteToRequest(r runtime.ClientRequest, reg st // query param client_name var qrClientName string - if o.ClientName != nil { qrClientName = *o.ClientName } qClientName := qrClientName if qClientName != "" { - if err := r.SetQueryParam("client_name", qClientName); err != nil { return err } } + } if o.Limit != nil { // query param limit var qrLimit int64 - if o.Limit != nil { qrLimit = *o.Limit } qLimit := swag.FormatInt64(qrLimit) if qLimit != "" { - if err := r.SetQueryParam("limit", qLimit); err != nil { return err } } + } if o.Offset != nil { // query param offset var qrOffset int64 - if o.Offset != nil { qrOffset = *o.Offset } qOffset := swag.FormatInt64(qrOffset) if qOffset != "" { - if err := r.SetQueryParam("offset", qOffset); err != nil { return err } } + } if o.Owner != nil { // query param owner var qrOwner string - if o.Owner != nil { qrOwner = *o.Owner } qOwner := qrOwner if qOwner != "" { - if err := r.SetQueryParam("owner", qOwner); err != nil { return err } } + } if len(res) > 0 { diff --git a/internal/httpclient/client/admin/list_o_auth2_clients_responses.go b/internal/httpclient/client/admin/list_o_auth2_clients_responses.go index aaeeb264335..5614a890e21 100644 --- a/internal/httpclient/client/admin/list_o_auth2_clients_responses.go +++ b/internal/httpclient/client/admin/list_o_auth2_clients_responses.go @@ -35,8 +35,9 @@ func (o *ListOAuth2ClientsReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewListOAuth2ClientsOK() *ListOAuth2ClientsOK { return &ListOAuth2ClientsOK{} } -/* ListOAuth2ClientsOK describes a response with status code 200, with default header values. +/*ListOAuth2ClientsOK handles this case with default header values. A list of clients. */ @@ -56,6 +57,7 @@ type ListOAuth2ClientsOK struct { func (o *ListOAuth2ClientsOK) Error() string { return fmt.Sprintf("[GET /clients][%d] listOAuth2ClientsOK %+v", 200, o.Payload) } + func (o *ListOAuth2ClientsOK) GetPayload() []*models.OAuth2Client { return o.Payload } @@ -75,7 +77,7 @@ func NewListOAuth2ClientsInternalServerError() *ListOAuth2ClientsInternalServerE return &ListOAuth2ClientsInternalServerError{} } -/* ListOAuth2ClientsInternalServerError describes a response with status code 500, with default header values. +/*ListOAuth2ClientsInternalServerError handles this case with default header values. jsonError */ @@ -86,6 +88,7 @@ type ListOAuth2ClientsInternalServerError struct { func (o *ListOAuth2ClientsInternalServerError) Error() string { return fmt.Sprintf("[GET /clients][%d] listOAuth2ClientsInternalServerError %+v", 500, o.Payload) } + func (o *ListOAuth2ClientsInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go b/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go index 6788e8f5dab..bca88f73d5f 100644 --- a/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go +++ b/internal/httpclient/client/admin/list_subject_consent_sessions_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewListSubjectConsentSessionsParams creates a new ListSubjectConsentSessionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewListSubjectConsentSessionsParams creates a new ListSubjectConsentSessionsParams object +// with the default values initialized. func NewListSubjectConsentSessionsParams() *ListSubjectConsentSessionsParams { + var () return &ListSubjectConsentSessionsParams{ + timeout: cr.DefaultTimeout, } } // NewListSubjectConsentSessionsParamsWithTimeout creates a new ListSubjectConsentSessionsParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewListSubjectConsentSessionsParamsWithTimeout(timeout time.Duration) *ListSubjectConsentSessionsParams { + var () return &ListSubjectConsentSessionsParams{ + timeout: timeout, } } // NewListSubjectConsentSessionsParamsWithContext creates a new ListSubjectConsentSessionsParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewListSubjectConsentSessionsParamsWithContext(ctx context.Context) *ListSubjectConsentSessionsParams { + var () return &ListSubjectConsentSessionsParams{ + Context: ctx, } } // NewListSubjectConsentSessionsParamsWithHTTPClient creates a new ListSubjectConsentSessionsParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewListSubjectConsentSessionsParamsWithHTTPClient(client *http.Client) *ListSubjectConsentSessionsParams { + var () return &ListSubjectConsentSessionsParams{ HTTPClient: client, } } -/* ListSubjectConsentSessionsParams contains all the parameters to send to the API endpoint - for the list subject consent sessions operation. - - Typically these are written to a http.Request. +/*ListSubjectConsentSessionsParams contains all the parameters to send to the API endpoint +for the list subject consent sessions operation typically these are written to a http.Request */ type ListSubjectConsentSessionsParams struct { - // Subject. + /*Subject*/ Subject string timeout time.Duration @@ -67,21 +68,6 @@ type ListSubjectConsentSessionsParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the list subject consent sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSubjectConsentSessionsParams) WithDefaults() *ListSubjectConsentSessionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list subject consent sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSubjectConsentSessionsParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the list subject consent sessions params func (o *ListSubjectConsentSessionsParams) WithTimeout(timeout time.Duration) *ListSubjectConsentSessionsParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *ListSubjectConsentSessionsParams) WriteToRequest(r runtime.ClientReques qrSubject := o.Subject qSubject := qrSubject if qSubject != "" { - if err := r.SetQueryParam("subject", qSubject); err != nil { return err } diff --git a/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go b/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go index 4fc96215fce..009ebef70a9 100644 --- a/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go +++ b/internal/httpclient/client/admin/list_subject_consent_sessions_responses.go @@ -41,8 +41,9 @@ func (o *ListSubjectConsentSessionsReader) ReadResponse(response runtime.ClientR return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewListSubjectConsentSessionsOK() *ListSubjectConsentSessionsOK { return &ListSubjectConsentSessionsOK{} } -/* ListSubjectConsentSessionsOK describes a response with status code 200, with default header values. +/*ListSubjectConsentSessionsOK handles this case with default header values. A list of used consent requests. */ @@ -62,6 +63,7 @@ type ListSubjectConsentSessionsOK struct { func (o *ListSubjectConsentSessionsOK) Error() string { return fmt.Sprintf("[GET /oauth2/auth/sessions/consent][%d] listSubjectConsentSessionsOK %+v", 200, o.Payload) } + func (o *ListSubjectConsentSessionsOK) GetPayload() []*models.PreviousConsentSession { return o.Payload } @@ -81,7 +83,7 @@ func NewListSubjectConsentSessionsBadRequest() *ListSubjectConsentSessionsBadReq return &ListSubjectConsentSessionsBadRequest{} } -/* ListSubjectConsentSessionsBadRequest describes a response with status code 400, with default header values. +/*ListSubjectConsentSessionsBadRequest handles this case with default header values. jsonError */ @@ -92,6 +94,7 @@ type ListSubjectConsentSessionsBadRequest struct { func (o *ListSubjectConsentSessionsBadRequest) Error() string { return fmt.Sprintf("[GET /oauth2/auth/sessions/consent][%d] listSubjectConsentSessionsBadRequest %+v", 400, o.Payload) } + func (o *ListSubjectConsentSessionsBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -113,7 +116,7 @@ func NewListSubjectConsentSessionsInternalServerError() *ListSubjectConsentSessi return &ListSubjectConsentSessionsInternalServerError{} } -/* ListSubjectConsentSessionsInternalServerError describes a response with status code 500, with default header values. +/*ListSubjectConsentSessionsInternalServerError handles this case with default header values. jsonError */ @@ -124,6 +127,7 @@ type ListSubjectConsentSessionsInternalServerError struct { func (o *ListSubjectConsentSessionsInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth/sessions/consent][%d] listSubjectConsentSessionsInternalServerError %+v", 500, o.Payload) } + func (o *ListSubjectConsentSessionsInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go b/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go index bb40dbefc65..1e35ba6e391 100644 --- a/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/patch_o_auth2_client_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewPatchOAuth2ClientParams creates a new PatchOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewPatchOAuth2ClientParams creates a new PatchOAuth2ClientParams object +// with the default values initialized. func NewPatchOAuth2ClientParams() *PatchOAuth2ClientParams { + var () return &PatchOAuth2ClientParams{ + timeout: cr.DefaultTimeout, } } // NewPatchOAuth2ClientParamsWithTimeout creates a new PatchOAuth2ClientParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewPatchOAuth2ClientParamsWithTimeout(timeout time.Duration) *PatchOAuth2ClientParams { + var () return &PatchOAuth2ClientParams{ + timeout: timeout, } } // NewPatchOAuth2ClientParamsWithContext creates a new PatchOAuth2ClientParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewPatchOAuth2ClientParamsWithContext(ctx context.Context) *PatchOAuth2ClientParams { + var () return &PatchOAuth2ClientParams{ + Context: ctx, } } // NewPatchOAuth2ClientParamsWithHTTPClient creates a new PatchOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewPatchOAuth2ClientParamsWithHTTPClient(client *http.Client) *PatchOAuth2ClientParams { + var () return &PatchOAuth2ClientParams{ HTTPClient: client, } } -/* PatchOAuth2ClientParams contains all the parameters to send to the API endpoint - for the patch o auth2 client operation. - - Typically these are written to a http.Request. +/*PatchOAuth2ClientParams contains all the parameters to send to the API endpoint +for the patch o auth2 client operation typically these are written to a http.Request */ type PatchOAuth2ClientParams struct { - // Body. + /*Body*/ Body models.PatchRequest - - // ID. + /*ID*/ ID string timeout time.Duration @@ -72,21 +72,6 @@ type PatchOAuth2ClientParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the patch o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchOAuth2ClientParams) WithDefaults() *PatchOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the patch o auth2 client params func (o *PatchOAuth2ClientParams) WithTimeout(timeout time.Duration) *PatchOAuth2ClientParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *PatchOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg st return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/patch_o_auth2_client_responses.go b/internal/httpclient/client/admin/patch_o_auth2_client_responses.go index 9415c04a86c..fb2f52d8683 100644 --- a/internal/httpclient/client/admin/patch_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/patch_o_auth2_client_responses.go @@ -35,8 +35,9 @@ func (o *PatchOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewPatchOAuth2ClientOK() *PatchOAuth2ClientOK { return &PatchOAuth2ClientOK{} } -/* PatchOAuth2ClientOK describes a response with status code 200, with default header values. +/*PatchOAuth2ClientOK handles this case with default header values. oAuth2Client */ @@ -56,6 +57,7 @@ type PatchOAuth2ClientOK struct { func (o *PatchOAuth2ClientOK) Error() string { return fmt.Sprintf("[PATCH /clients/{id}][%d] patchOAuth2ClientOK %+v", 200, o.Payload) } + func (o *PatchOAuth2ClientOK) GetPayload() *models.OAuth2Client { return o.Payload } @@ -77,7 +79,7 @@ func NewPatchOAuth2ClientInternalServerError() *PatchOAuth2ClientInternalServerE return &PatchOAuth2ClientInternalServerError{} } -/* PatchOAuth2ClientInternalServerError describes a response with status code 500, with default header values. +/*PatchOAuth2ClientInternalServerError handles this case with default header values. jsonError */ @@ -88,6 +90,7 @@ type PatchOAuth2ClientInternalServerError struct { func (o *PatchOAuth2ClientInternalServerError) Error() string { return fmt.Sprintf("[PATCH /clients/{id}][%d] patchOAuth2ClientInternalServerError %+v", 500, o.Payload) } + func (o *PatchOAuth2ClientInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/reject_consent_request_parameters.go b/internal/httpclient/client/admin/reject_consent_request_parameters.go index a71725bd0ed..eba20d4bd3e 100644 --- a/internal/httpclient/client/admin/reject_consent_request_parameters.go +++ b/internal/httpclient/client/admin/reject_consent_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewRejectConsentRequestParams creates a new RejectConsentRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRejectConsentRequestParams creates a new RejectConsentRequestParams object +// with the default values initialized. func NewRejectConsentRequestParams() *RejectConsentRequestParams { + var () return &RejectConsentRequestParams{ + timeout: cr.DefaultTimeout, } } // NewRejectConsentRequestParamsWithTimeout creates a new RejectConsentRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRejectConsentRequestParamsWithTimeout(timeout time.Duration) *RejectConsentRequestParams { + var () return &RejectConsentRequestParams{ + timeout: timeout, } } // NewRejectConsentRequestParamsWithContext creates a new RejectConsentRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRejectConsentRequestParamsWithContext(ctx context.Context) *RejectConsentRequestParams { + var () return &RejectConsentRequestParams{ + Context: ctx, } } // NewRejectConsentRequestParamsWithHTTPClient creates a new RejectConsentRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRejectConsentRequestParamsWithHTTPClient(client *http.Client) *RejectConsentRequestParams { + var () return &RejectConsentRequestParams{ HTTPClient: client, } } -/* RejectConsentRequestParams contains all the parameters to send to the API endpoint - for the reject consent request operation. - - Typically these are written to a http.Request. +/*RejectConsentRequestParams contains all the parameters to send to the API endpoint +for the reject consent request operation typically these are written to a http.Request */ type RejectConsentRequestParams struct { - // Body. + /*Body*/ Body *models.RejectRequest - - // ConsentChallenge. + /*ConsentChallenge*/ ConsentChallenge string timeout time.Duration @@ -72,21 +72,6 @@ type RejectConsentRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the reject consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectConsentRequestParams) WithDefaults() *RejectConsentRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the reject consent request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectConsentRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the reject consent request params func (o *RejectConsentRequestParams) WithTimeout(timeout time.Duration) *RejectConsentRequestParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *RejectConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -159,7 +145,6 @@ func (o *RejectConsentRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrConsentChallenge := o.ConsentChallenge qConsentChallenge := qrConsentChallenge if qConsentChallenge != "" { - if err := r.SetQueryParam("consent_challenge", qConsentChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/reject_consent_request_responses.go b/internal/httpclient/client/admin/reject_consent_request_responses.go index 16e00fe420c..9f300b01793 100644 --- a/internal/httpclient/client/admin/reject_consent_request_responses.go +++ b/internal/httpclient/client/admin/reject_consent_request_responses.go @@ -41,8 +41,9 @@ func (o *RejectConsentRequestReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewRejectConsentRequestOK() *RejectConsentRequestOK { return &RejectConsentRequestOK{} } -/* RejectConsentRequestOK describes a response with status code 200, with default header values. +/*RejectConsentRequestOK handles this case with default header values. completedRequest */ @@ -62,6 +63,7 @@ type RejectConsentRequestOK struct { func (o *RejectConsentRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/reject][%d] rejectConsentRequestOK %+v", 200, o.Payload) } + func (o *RejectConsentRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -83,7 +85,7 @@ func NewRejectConsentRequestNotFound() *RejectConsentRequestNotFound { return &RejectConsentRequestNotFound{} } -/* RejectConsentRequestNotFound describes a response with status code 404, with default header values. +/*RejectConsentRequestNotFound handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type RejectConsentRequestNotFound struct { func (o *RejectConsentRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/reject][%d] rejectConsentRequestNotFound %+v", 404, o.Payload) } + func (o *RejectConsentRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewRejectConsentRequestInternalServerError() *RejectConsentRequestInternalS return &RejectConsentRequestInternalServerError{} } -/* RejectConsentRequestInternalServerError describes a response with status code 500, with default header values. +/*RejectConsentRequestInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type RejectConsentRequestInternalServerError struct { func (o *RejectConsentRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/consent/reject][%d] rejectConsentRequestInternalServerError %+v", 500, o.Payload) } + func (o *RejectConsentRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/reject_login_request_parameters.go b/internal/httpclient/client/admin/reject_login_request_parameters.go index 300a4e9b1c3..03556b805fc 100644 --- a/internal/httpclient/client/admin/reject_login_request_parameters.go +++ b/internal/httpclient/client/admin/reject_login_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewRejectLoginRequestParams creates a new RejectLoginRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRejectLoginRequestParams creates a new RejectLoginRequestParams object +// with the default values initialized. func NewRejectLoginRequestParams() *RejectLoginRequestParams { + var () return &RejectLoginRequestParams{ + timeout: cr.DefaultTimeout, } } // NewRejectLoginRequestParamsWithTimeout creates a new RejectLoginRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRejectLoginRequestParamsWithTimeout(timeout time.Duration) *RejectLoginRequestParams { + var () return &RejectLoginRequestParams{ + timeout: timeout, } } // NewRejectLoginRequestParamsWithContext creates a new RejectLoginRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRejectLoginRequestParamsWithContext(ctx context.Context) *RejectLoginRequestParams { + var () return &RejectLoginRequestParams{ + Context: ctx, } } // NewRejectLoginRequestParamsWithHTTPClient creates a new RejectLoginRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRejectLoginRequestParamsWithHTTPClient(client *http.Client) *RejectLoginRequestParams { + var () return &RejectLoginRequestParams{ HTTPClient: client, } } -/* RejectLoginRequestParams contains all the parameters to send to the API endpoint - for the reject login request operation. - - Typically these are written to a http.Request. +/*RejectLoginRequestParams contains all the parameters to send to the API endpoint +for the reject login request operation typically these are written to a http.Request */ type RejectLoginRequestParams struct { - // Body. + /*Body*/ Body *models.RejectRequest - - // LoginChallenge. + /*LoginChallenge*/ LoginChallenge string timeout time.Duration @@ -72,21 +72,6 @@ type RejectLoginRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the reject login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectLoginRequestParams) WithDefaults() *RejectLoginRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the reject login request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectLoginRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the reject login request params func (o *RejectLoginRequestParams) WithTimeout(timeout time.Duration) *RejectLoginRequestParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *RejectLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -159,7 +145,6 @@ func (o *RejectLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg s qrLoginChallenge := o.LoginChallenge qLoginChallenge := qrLoginChallenge if qLoginChallenge != "" { - if err := r.SetQueryParam("login_challenge", qLoginChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/reject_login_request_responses.go b/internal/httpclient/client/admin/reject_login_request_responses.go index aa45932f0c7..edc2b3e66ad 100644 --- a/internal/httpclient/client/admin/reject_login_request_responses.go +++ b/internal/httpclient/client/admin/reject_login_request_responses.go @@ -53,8 +53,9 @@ func (o *RejectLoginRequestReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -63,7 +64,7 @@ func NewRejectLoginRequestOK() *RejectLoginRequestOK { return &RejectLoginRequestOK{} } -/* RejectLoginRequestOK describes a response with status code 200, with default header values. +/*RejectLoginRequestOK handles this case with default header values. completedRequest */ @@ -74,6 +75,7 @@ type RejectLoginRequestOK struct { func (o *RejectLoginRequestOK) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestOK %+v", 200, o.Payload) } + func (o *RejectLoginRequestOK) GetPayload() *models.CompletedRequest { return o.Payload } @@ -95,7 +97,7 @@ func NewRejectLoginRequestBadRequest() *RejectLoginRequestBadRequest { return &RejectLoginRequestBadRequest{} } -/* RejectLoginRequestBadRequest describes a response with status code 400, with default header values. +/*RejectLoginRequestBadRequest handles this case with default header values. jsonError */ @@ -106,6 +108,7 @@ type RejectLoginRequestBadRequest struct { func (o *RejectLoginRequestBadRequest) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestBadRequest %+v", 400, o.Payload) } + func (o *RejectLoginRequestBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -127,7 +130,7 @@ func NewRejectLoginRequestUnauthorized() *RejectLoginRequestUnauthorized { return &RejectLoginRequestUnauthorized{} } -/* RejectLoginRequestUnauthorized describes a response with status code 401, with default header values. +/*RejectLoginRequestUnauthorized handles this case with default header values. jsonError */ @@ -138,6 +141,7 @@ type RejectLoginRequestUnauthorized struct { func (o *RejectLoginRequestUnauthorized) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestUnauthorized %+v", 401, o.Payload) } + func (o *RejectLoginRequestUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -159,7 +163,7 @@ func NewRejectLoginRequestNotFound() *RejectLoginRequestNotFound { return &RejectLoginRequestNotFound{} } -/* RejectLoginRequestNotFound describes a response with status code 404, with default header values. +/*RejectLoginRequestNotFound handles this case with default header values. jsonError */ @@ -170,6 +174,7 @@ type RejectLoginRequestNotFound struct { func (o *RejectLoginRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestNotFound %+v", 404, o.Payload) } + func (o *RejectLoginRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -191,7 +196,7 @@ func NewRejectLoginRequestInternalServerError() *RejectLoginRequestInternalServe return &RejectLoginRequestInternalServerError{} } -/* RejectLoginRequestInternalServerError describes a response with status code 500, with default header values. +/*RejectLoginRequestInternalServerError handles this case with default header values. jsonError */ @@ -202,6 +207,7 @@ type RejectLoginRequestInternalServerError struct { func (o *RejectLoginRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/login/reject][%d] rejectLoginRequestInternalServerError %+v", 500, o.Payload) } + func (o *RejectLoginRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/reject_logout_request_parameters.go b/internal/httpclient/client/admin/reject_logout_request_parameters.go index f39e96898b2..be87d346429 100644 --- a/internal/httpclient/client/admin/reject_logout_request_parameters.go +++ b/internal/httpclient/client/admin/reject_logout_request_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewRejectLogoutRequestParams creates a new RejectLogoutRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRejectLogoutRequestParams creates a new RejectLogoutRequestParams object +// with the default values initialized. func NewRejectLogoutRequestParams() *RejectLogoutRequestParams { + var () return &RejectLogoutRequestParams{ + timeout: cr.DefaultTimeout, } } // NewRejectLogoutRequestParamsWithTimeout creates a new RejectLogoutRequestParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRejectLogoutRequestParamsWithTimeout(timeout time.Duration) *RejectLogoutRequestParams { + var () return &RejectLogoutRequestParams{ + timeout: timeout, } } // NewRejectLogoutRequestParamsWithContext creates a new RejectLogoutRequestParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRejectLogoutRequestParamsWithContext(ctx context.Context) *RejectLogoutRequestParams { + var () return &RejectLogoutRequestParams{ + Context: ctx, } } // NewRejectLogoutRequestParamsWithHTTPClient creates a new RejectLogoutRequestParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRejectLogoutRequestParamsWithHTTPClient(client *http.Client) *RejectLogoutRequestParams { + var () return &RejectLogoutRequestParams{ HTTPClient: client, } } -/* RejectLogoutRequestParams contains all the parameters to send to the API endpoint - for the reject logout request operation. - - Typically these are written to a http.Request. +/*RejectLogoutRequestParams contains all the parameters to send to the API endpoint +for the reject logout request operation typically these are written to a http.Request */ type RejectLogoutRequestParams struct { - // Body. + /*Body*/ Body *models.RejectRequest - - // LogoutChallenge. + /*LogoutChallenge*/ LogoutChallenge string timeout time.Duration @@ -72,21 +72,6 @@ type RejectLogoutRequestParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the reject logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectLogoutRequestParams) WithDefaults() *RejectLogoutRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the reject logout request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RejectLogoutRequestParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the reject logout request params func (o *RejectLogoutRequestParams) WithTimeout(timeout time.Duration) *RejectLogoutRequestParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *RejectLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err @@ -159,7 +145,6 @@ func (o *RejectLogoutRequestParams) WriteToRequest(r runtime.ClientRequest, reg qrLogoutChallenge := o.LogoutChallenge qLogoutChallenge := qrLogoutChallenge if qLogoutChallenge != "" { - if err := r.SetQueryParam("logout_challenge", qLogoutChallenge); err != nil { return err } diff --git a/internal/httpclient/client/admin/reject_logout_request_responses.go b/internal/httpclient/client/admin/reject_logout_request_responses.go index 0ebd365c5a6..30181ba0928 100644 --- a/internal/httpclient/client/admin/reject_logout_request_responses.go +++ b/internal/httpclient/client/admin/reject_logout_request_responses.go @@ -41,8 +41,9 @@ func (o *RejectLogoutRequestReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewRejectLogoutRequestNoContent() *RejectLogoutRequestNoContent { return &RejectLogoutRequestNoContent{} } -/* RejectLogoutRequestNoContent describes a response with status code 204, with default header values. +/*RejectLogoutRequestNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RejectLogoutRequestNoContent struct { @@ -73,7 +74,7 @@ func NewRejectLogoutRequestNotFound() *RejectLogoutRequestNotFound { return &RejectLogoutRequestNotFound{} } -/* RejectLogoutRequestNotFound describes a response with status code 404, with default header values. +/*RejectLogoutRequestNotFound handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type RejectLogoutRequestNotFound struct { func (o *RejectLogoutRequestNotFound) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/reject][%d] rejectLogoutRequestNotFound %+v", 404, o.Payload) } + func (o *RejectLogoutRequestNotFound) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewRejectLogoutRequestInternalServerError() *RejectLogoutRequestInternalSer return &RejectLogoutRequestInternalServerError{} } -/* RejectLogoutRequestInternalServerError describes a response with status code 500, with default header values. +/*RejectLogoutRequestInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type RejectLogoutRequestInternalServerError struct { func (o *RejectLogoutRequestInternalServerError) Error() string { return fmt.Sprintf("[PUT /oauth2/auth/requests/logout/reject][%d] rejectLogoutRequestInternalServerError %+v", 500, o.Payload) } + func (o *RejectLogoutRequestInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/revoke_authentication_session_parameters.go b/internal/httpclient/client/admin/revoke_authentication_session_parameters.go index 780e8fd0266..dab7c8b54dd 100644 --- a/internal/httpclient/client/admin/revoke_authentication_session_parameters.go +++ b/internal/httpclient/client/admin/revoke_authentication_session_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRevokeAuthenticationSessionParams creates a new RevokeAuthenticationSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRevokeAuthenticationSessionParams creates a new RevokeAuthenticationSessionParams object +// with the default values initialized. func NewRevokeAuthenticationSessionParams() *RevokeAuthenticationSessionParams { + var () return &RevokeAuthenticationSessionParams{ + timeout: cr.DefaultTimeout, } } // NewRevokeAuthenticationSessionParamsWithTimeout creates a new RevokeAuthenticationSessionParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRevokeAuthenticationSessionParamsWithTimeout(timeout time.Duration) *RevokeAuthenticationSessionParams { + var () return &RevokeAuthenticationSessionParams{ + timeout: timeout, } } // NewRevokeAuthenticationSessionParamsWithContext creates a new RevokeAuthenticationSessionParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRevokeAuthenticationSessionParamsWithContext(ctx context.Context) *RevokeAuthenticationSessionParams { + var () return &RevokeAuthenticationSessionParams{ + Context: ctx, } } // NewRevokeAuthenticationSessionParamsWithHTTPClient creates a new RevokeAuthenticationSessionParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRevokeAuthenticationSessionParamsWithHTTPClient(client *http.Client) *RevokeAuthenticationSessionParams { + var () return &RevokeAuthenticationSessionParams{ HTTPClient: client, } } -/* RevokeAuthenticationSessionParams contains all the parameters to send to the API endpoint - for the revoke authentication session operation. - - Typically these are written to a http.Request. +/*RevokeAuthenticationSessionParams contains all the parameters to send to the API endpoint +for the revoke authentication session operation typically these are written to a http.Request */ type RevokeAuthenticationSessionParams struct { - // Subject. + /*Subject*/ Subject string timeout time.Duration @@ -67,21 +68,6 @@ type RevokeAuthenticationSessionParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the revoke authentication session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeAuthenticationSessionParams) WithDefaults() *RevokeAuthenticationSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the revoke authentication session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeAuthenticationSessionParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the revoke authentication session params func (o *RevokeAuthenticationSessionParams) WithTimeout(timeout time.Duration) *RevokeAuthenticationSessionParams { o.SetTimeout(timeout) @@ -138,7 +124,6 @@ func (o *RevokeAuthenticationSessionParams) WriteToRequest(r runtime.ClientReque qrSubject := o.Subject qSubject := qrSubject if qSubject != "" { - if err := r.SetQueryParam("subject", qSubject); err != nil { return err } diff --git a/internal/httpclient/client/admin/revoke_authentication_session_responses.go b/internal/httpclient/client/admin/revoke_authentication_session_responses.go index ae2ae24e964..bd18b558cd4 100644 --- a/internal/httpclient/client/admin/revoke_authentication_session_responses.go +++ b/internal/httpclient/client/admin/revoke_authentication_session_responses.go @@ -41,8 +41,9 @@ func (o *RevokeAuthenticationSessionReader) ReadResponse(response runtime.Client return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewRevokeAuthenticationSessionNoContent() *RevokeAuthenticationSessionNoCon return &RevokeAuthenticationSessionNoContent{} } -/* RevokeAuthenticationSessionNoContent describes a response with status code 204, with default header values. +/*RevokeAuthenticationSessionNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RevokeAuthenticationSessionNoContent struct { @@ -73,7 +74,7 @@ func NewRevokeAuthenticationSessionBadRequest() *RevokeAuthenticationSessionBadR return &RevokeAuthenticationSessionBadRequest{} } -/* RevokeAuthenticationSessionBadRequest describes a response with status code 400, with default header values. +/*RevokeAuthenticationSessionBadRequest handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type RevokeAuthenticationSessionBadRequest struct { func (o *RevokeAuthenticationSessionBadRequest) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/login][%d] revokeAuthenticationSessionBadRequest %+v", 400, o.Payload) } + func (o *RevokeAuthenticationSessionBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewRevokeAuthenticationSessionInternalServerError() *RevokeAuthenticationSe return &RevokeAuthenticationSessionInternalServerError{} } -/* RevokeAuthenticationSessionInternalServerError describes a response with status code 500, with default header values. +/*RevokeAuthenticationSessionInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type RevokeAuthenticationSessionInternalServerError struct { func (o *RevokeAuthenticationSessionInternalServerError) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/login][%d] revokeAuthenticationSessionInternalServerError %+v", 500, o.Payload) } + func (o *RevokeAuthenticationSessionInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go b/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go index 357224b576f..6dadc668afd 100644 --- a/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go +++ b/internal/httpclient/client/admin/revoke_consent_sessions_parameters.go @@ -17,64 +17,63 @@ import ( "github.com/go-openapi/swag" ) -// NewRevokeConsentSessionsParams creates a new RevokeConsentSessionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRevokeConsentSessionsParams creates a new RevokeConsentSessionsParams object +// with the default values initialized. func NewRevokeConsentSessionsParams() *RevokeConsentSessionsParams { + var () return &RevokeConsentSessionsParams{ + timeout: cr.DefaultTimeout, } } // NewRevokeConsentSessionsParamsWithTimeout creates a new RevokeConsentSessionsParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRevokeConsentSessionsParamsWithTimeout(timeout time.Duration) *RevokeConsentSessionsParams { + var () return &RevokeConsentSessionsParams{ + timeout: timeout, } } // NewRevokeConsentSessionsParamsWithContext creates a new RevokeConsentSessionsParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRevokeConsentSessionsParamsWithContext(ctx context.Context) *RevokeConsentSessionsParams { + var () return &RevokeConsentSessionsParams{ + Context: ctx, } } // NewRevokeConsentSessionsParamsWithHTTPClient creates a new RevokeConsentSessionsParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRevokeConsentSessionsParamsWithHTTPClient(client *http.Client) *RevokeConsentSessionsParams { + var () return &RevokeConsentSessionsParams{ HTTPClient: client, } } -/* RevokeConsentSessionsParams contains all the parameters to send to the API endpoint - for the revoke consent sessions operation. - - Typically these are written to a http.Request. +/*RevokeConsentSessionsParams contains all the parameters to send to the API endpoint +for the revoke consent sessions operation typically these are written to a http.Request */ type RevokeConsentSessionsParams struct { - /* All. + /*All + If set to `?all=true`, deletes all consent sessions by the Subject that have been granted. - If set to `?all=true`, deletes all consent sessions by the Subject that have been granted. */ All *bool + /*Client + If set, deletes only those consent sessions by the Subject that have been granted to the specified OAuth 2.0 Client ID - /* Client. - - If set, deletes only those consent sessions by the Subject that have been granted to the specified OAuth 2.0 Client ID */ Client *string + /*Subject + The subject (Subject) who's consent sessions should be deleted. - /* Subject. - - The subject (Subject) who's consent sessions should be deleted. */ Subject string @@ -83,21 +82,6 @@ type RevokeConsentSessionsParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the revoke consent sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeConsentSessionsParams) WithDefaults() *RevokeConsentSessionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the revoke consent sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeConsentSessionsParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the revoke consent sessions params func (o *RevokeConsentSessionsParams) WithTimeout(timeout time.Duration) *RevokeConsentSessionsParams { o.SetTimeout(timeout) @@ -176,41 +160,38 @@ func (o *RevokeConsentSessionsParams) WriteToRequest(r runtime.ClientRequest, re // query param all var qrAll bool - if o.All != nil { qrAll = *o.All } qAll := swag.FormatBool(qrAll) if qAll != "" { - if err := r.SetQueryParam("all", qAll); err != nil { return err } } + } if o.Client != nil { // query param client var qrClient string - if o.Client != nil { qrClient = *o.Client } qClient := qrClient if qClient != "" { - if err := r.SetQueryParam("client", qClient); err != nil { return err } } + } // query param subject qrSubject := o.Subject qSubject := qrSubject if qSubject != "" { - if err := r.SetQueryParam("subject", qSubject); err != nil { return err } diff --git a/internal/httpclient/client/admin/revoke_consent_sessions_responses.go b/internal/httpclient/client/admin/revoke_consent_sessions_responses.go index 168fe30d353..fdff5894287 100644 --- a/internal/httpclient/client/admin/revoke_consent_sessions_responses.go +++ b/internal/httpclient/client/admin/revoke_consent_sessions_responses.go @@ -41,8 +41,9 @@ func (o *RevokeConsentSessionsReader) ReadResponse(response runtime.ClientRespon return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewRevokeConsentSessionsNoContent() *RevokeConsentSessionsNoContent { return &RevokeConsentSessionsNoContent{} } -/* RevokeConsentSessionsNoContent describes a response with status code 204, with default header values. +/*RevokeConsentSessionsNoContent handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RevokeConsentSessionsNoContent struct { @@ -73,7 +74,7 @@ func NewRevokeConsentSessionsBadRequest() *RevokeConsentSessionsBadRequest { return &RevokeConsentSessionsBadRequest{} } -/* RevokeConsentSessionsBadRequest describes a response with status code 400, with default header values. +/*RevokeConsentSessionsBadRequest handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type RevokeConsentSessionsBadRequest struct { func (o *RevokeConsentSessionsBadRequest) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/consent][%d] revokeConsentSessionsBadRequest %+v", 400, o.Payload) } + func (o *RevokeConsentSessionsBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewRevokeConsentSessionsInternalServerError() *RevokeConsentSessionsInterna return &RevokeConsentSessionsInternalServerError{} } -/* RevokeConsentSessionsInternalServerError describes a response with status code 500, with default header values. +/*RevokeConsentSessionsInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type RevokeConsentSessionsInternalServerError struct { func (o *RevokeConsentSessionsInternalServerError) Error() string { return fmt.Sprintf("[DELETE /oauth2/auth/sessions/consent][%d] revokeConsentSessionsInternalServerError %+v", 500, o.Payload) } + func (o *RevokeConsentSessionsInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/update_json_web_key_parameters.go b/internal/httpclient/client/admin/update_json_web_key_parameters.go index 1d58a24513f..23d00be45c1 100644 --- a/internal/httpclient/client/admin/update_json_web_key_parameters.go +++ b/internal/httpclient/client/admin/update_json_web_key_parameters.go @@ -18,61 +18,60 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewUpdateJSONWebKeyParams creates a new UpdateJSONWebKeyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewUpdateJSONWebKeyParams creates a new UpdateJSONWebKeyParams object +// with the default values initialized. func NewUpdateJSONWebKeyParams() *UpdateJSONWebKeyParams { + var () return &UpdateJSONWebKeyParams{ + timeout: cr.DefaultTimeout, } } // NewUpdateJSONWebKeyParamsWithTimeout creates a new UpdateJSONWebKeyParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewUpdateJSONWebKeyParamsWithTimeout(timeout time.Duration) *UpdateJSONWebKeyParams { + var () return &UpdateJSONWebKeyParams{ + timeout: timeout, } } // NewUpdateJSONWebKeyParamsWithContext creates a new UpdateJSONWebKeyParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewUpdateJSONWebKeyParamsWithContext(ctx context.Context) *UpdateJSONWebKeyParams { + var () return &UpdateJSONWebKeyParams{ + Context: ctx, } } // NewUpdateJSONWebKeyParamsWithHTTPClient creates a new UpdateJSONWebKeyParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewUpdateJSONWebKeyParamsWithHTTPClient(client *http.Client) *UpdateJSONWebKeyParams { + var () return &UpdateJSONWebKeyParams{ HTTPClient: client, } } -/* UpdateJSONWebKeyParams contains all the parameters to send to the API endpoint - for the update Json web key operation. - - Typically these are written to a http.Request. +/*UpdateJSONWebKeyParams contains all the parameters to send to the API endpoint +for the update Json web key operation typically these are written to a http.Request */ type UpdateJSONWebKeyParams struct { - // Body. + /*Body*/ Body *models.JSONWebKey + /*Kid + The kid of the desired key - /* Kid. - - The kid of the desired key */ Kid string + /*Set + The set - /* Set. - - The set */ Set string @@ -81,21 +80,6 @@ type UpdateJSONWebKeyParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the update Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateJSONWebKeyParams) WithDefaults() *UpdateJSONWebKeyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update Json web key params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateJSONWebKeyParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the update Json web key params func (o *UpdateJSONWebKeyParams) WithTimeout(timeout time.Duration) *UpdateJSONWebKeyParams { o.SetTimeout(timeout) @@ -169,6 +153,7 @@ func (o *UpdateJSONWebKeyParams) WriteToRequest(r runtime.ClientRequest, reg str return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/update_json_web_key_responses.go b/internal/httpclient/client/admin/update_json_web_key_responses.go index 59ef84d5d52..fe134e053e6 100644 --- a/internal/httpclient/client/admin/update_json_web_key_responses.go +++ b/internal/httpclient/client/admin/update_json_web_key_responses.go @@ -47,8 +47,9 @@ func (o *UpdateJSONWebKeyReader) ReadResponse(response runtime.ClientResponse, c return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewUpdateJSONWebKeyOK() *UpdateJSONWebKeyOK { return &UpdateJSONWebKeyOK{} } -/* UpdateJSONWebKeyOK describes a response with status code 200, with default header values. +/*UpdateJSONWebKeyOK handles this case with default header values. JSONWebKey */ @@ -68,6 +69,7 @@ type UpdateJSONWebKeyOK struct { func (o *UpdateJSONWebKeyOK) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyOK %+v", 200, o.Payload) } + func (o *UpdateJSONWebKeyOK) GetPayload() *models.JSONWebKey { return o.Payload } @@ -89,7 +91,7 @@ func NewUpdateJSONWebKeyUnauthorized() *UpdateJSONWebKeyUnauthorized { return &UpdateJSONWebKeyUnauthorized{} } -/* UpdateJSONWebKeyUnauthorized describes a response with status code 401, with default header values. +/*UpdateJSONWebKeyUnauthorized handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type UpdateJSONWebKeyUnauthorized struct { func (o *UpdateJSONWebKeyUnauthorized) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyUnauthorized %+v", 401, o.Payload) } + func (o *UpdateJSONWebKeyUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewUpdateJSONWebKeyForbidden() *UpdateJSONWebKeyForbidden { return &UpdateJSONWebKeyForbidden{} } -/* UpdateJSONWebKeyForbidden describes a response with status code 403, with default header values. +/*UpdateJSONWebKeyForbidden handles this case with default header values. jsonError */ @@ -132,6 +135,7 @@ type UpdateJSONWebKeyForbidden struct { func (o *UpdateJSONWebKeyForbidden) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyForbidden %+v", 403, o.Payload) } + func (o *UpdateJSONWebKeyForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -153,7 +157,7 @@ func NewUpdateJSONWebKeyInternalServerError() *UpdateJSONWebKeyInternalServerErr return &UpdateJSONWebKeyInternalServerError{} } -/* UpdateJSONWebKeyInternalServerError describes a response with status code 500, with default header values. +/*UpdateJSONWebKeyInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type UpdateJSONWebKeyInternalServerError struct { func (o *UpdateJSONWebKeyInternalServerError) Error() string { return fmt.Sprintf("[PUT /keys/{set}/{kid}][%d] updateJsonWebKeyInternalServerError %+v", 500, o.Payload) } + func (o *UpdateJSONWebKeyInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/update_json_web_key_set_parameters.go b/internal/httpclient/client/admin/update_json_web_key_set_parameters.go index 20cc85a3770..5d5de04e2f1 100644 --- a/internal/httpclient/client/admin/update_json_web_key_set_parameters.go +++ b/internal/httpclient/client/admin/update_json_web_key_set_parameters.go @@ -18,55 +18,55 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewUpdateJSONWebKeySetParams creates a new UpdateJSONWebKeySetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewUpdateJSONWebKeySetParams creates a new UpdateJSONWebKeySetParams object +// with the default values initialized. func NewUpdateJSONWebKeySetParams() *UpdateJSONWebKeySetParams { + var () return &UpdateJSONWebKeySetParams{ + timeout: cr.DefaultTimeout, } } // NewUpdateJSONWebKeySetParamsWithTimeout creates a new UpdateJSONWebKeySetParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewUpdateJSONWebKeySetParamsWithTimeout(timeout time.Duration) *UpdateJSONWebKeySetParams { + var () return &UpdateJSONWebKeySetParams{ + timeout: timeout, } } // NewUpdateJSONWebKeySetParamsWithContext creates a new UpdateJSONWebKeySetParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewUpdateJSONWebKeySetParamsWithContext(ctx context.Context) *UpdateJSONWebKeySetParams { + var () return &UpdateJSONWebKeySetParams{ + Context: ctx, } } // NewUpdateJSONWebKeySetParamsWithHTTPClient creates a new UpdateJSONWebKeySetParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewUpdateJSONWebKeySetParamsWithHTTPClient(client *http.Client) *UpdateJSONWebKeySetParams { + var () return &UpdateJSONWebKeySetParams{ HTTPClient: client, } } -/* UpdateJSONWebKeySetParams contains all the parameters to send to the API endpoint - for the update Json web key set operation. - - Typically these are written to a http.Request. +/*UpdateJSONWebKeySetParams contains all the parameters to send to the API endpoint +for the update Json web key set operation typically these are written to a http.Request */ type UpdateJSONWebKeySetParams struct { - // Body. + /*Body*/ Body *models.JSONWebKeySet + /*Set + The set - /* Set. - - The set */ Set string @@ -75,21 +75,6 @@ type UpdateJSONWebKeySetParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the update Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateJSONWebKeySetParams) WithDefaults() *UpdateJSONWebKeySetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update Json web key set params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateJSONWebKeySetParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the update Json web key set params func (o *UpdateJSONWebKeySetParams) WithTimeout(timeout time.Duration) *UpdateJSONWebKeySetParams { o.SetTimeout(timeout) @@ -152,6 +137,7 @@ func (o *UpdateJSONWebKeySetParams) WriteToRequest(r runtime.ClientRequest, reg return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/update_json_web_key_set_responses.go b/internal/httpclient/client/admin/update_json_web_key_set_responses.go index fbc2a60031e..b48ffb1fc13 100644 --- a/internal/httpclient/client/admin/update_json_web_key_set_responses.go +++ b/internal/httpclient/client/admin/update_json_web_key_set_responses.go @@ -47,8 +47,9 @@ func (o *UpdateJSONWebKeySetReader) ReadResponse(response runtime.ClientResponse return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewUpdateJSONWebKeySetOK() *UpdateJSONWebKeySetOK { return &UpdateJSONWebKeySetOK{} } -/* UpdateJSONWebKeySetOK describes a response with status code 200, with default header values. +/*UpdateJSONWebKeySetOK handles this case with default header values. JSONWebKeySet */ @@ -68,6 +69,7 @@ type UpdateJSONWebKeySetOK struct { func (o *UpdateJSONWebKeySetOK) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetOK %+v", 200, o.Payload) } + func (o *UpdateJSONWebKeySetOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -89,7 +91,7 @@ func NewUpdateJSONWebKeySetUnauthorized() *UpdateJSONWebKeySetUnauthorized { return &UpdateJSONWebKeySetUnauthorized{} } -/* UpdateJSONWebKeySetUnauthorized describes a response with status code 401, with default header values. +/*UpdateJSONWebKeySetUnauthorized handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type UpdateJSONWebKeySetUnauthorized struct { func (o *UpdateJSONWebKeySetUnauthorized) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetUnauthorized %+v", 401, o.Payload) } + func (o *UpdateJSONWebKeySetUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewUpdateJSONWebKeySetForbidden() *UpdateJSONWebKeySetForbidden { return &UpdateJSONWebKeySetForbidden{} } -/* UpdateJSONWebKeySetForbidden describes a response with status code 403, with default header values. +/*UpdateJSONWebKeySetForbidden handles this case with default header values. jsonError */ @@ -132,6 +135,7 @@ type UpdateJSONWebKeySetForbidden struct { func (o *UpdateJSONWebKeySetForbidden) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetForbidden %+v", 403, o.Payload) } + func (o *UpdateJSONWebKeySetForbidden) GetPayload() *models.JSONError { return o.Payload } @@ -153,7 +157,7 @@ func NewUpdateJSONWebKeySetInternalServerError() *UpdateJSONWebKeySetInternalSer return &UpdateJSONWebKeySetInternalServerError{} } -/* UpdateJSONWebKeySetInternalServerError describes a response with status code 500, with default header values. +/*UpdateJSONWebKeySetInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type UpdateJSONWebKeySetInternalServerError struct { func (o *UpdateJSONWebKeySetInternalServerError) Error() string { return fmt.Sprintf("[PUT /keys/{set}][%d] updateJsonWebKeySetInternalServerError %+v", 500, o.Payload) } + func (o *UpdateJSONWebKeySetInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/admin/update_o_auth2_client_parameters.go b/internal/httpclient/client/admin/update_o_auth2_client_parameters.go index d767532c9a0..85400c84f9f 100644 --- a/internal/httpclient/client/admin/update_o_auth2_client_parameters.go +++ b/internal/httpclient/client/admin/update_o_auth2_client_parameters.go @@ -18,53 +18,53 @@ import ( "github.com/ory/hydra/internal/httpclient/models" ) -// NewUpdateOAuth2ClientParams creates a new UpdateOAuth2ClientParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewUpdateOAuth2ClientParams creates a new UpdateOAuth2ClientParams object +// with the default values initialized. func NewUpdateOAuth2ClientParams() *UpdateOAuth2ClientParams { + var () return &UpdateOAuth2ClientParams{ + timeout: cr.DefaultTimeout, } } // NewUpdateOAuth2ClientParamsWithTimeout creates a new UpdateOAuth2ClientParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewUpdateOAuth2ClientParamsWithTimeout(timeout time.Duration) *UpdateOAuth2ClientParams { + var () return &UpdateOAuth2ClientParams{ + timeout: timeout, } } // NewUpdateOAuth2ClientParamsWithContext creates a new UpdateOAuth2ClientParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewUpdateOAuth2ClientParamsWithContext(ctx context.Context) *UpdateOAuth2ClientParams { + var () return &UpdateOAuth2ClientParams{ + Context: ctx, } } // NewUpdateOAuth2ClientParamsWithHTTPClient creates a new UpdateOAuth2ClientParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewUpdateOAuth2ClientParamsWithHTTPClient(client *http.Client) *UpdateOAuth2ClientParams { + var () return &UpdateOAuth2ClientParams{ HTTPClient: client, } } -/* UpdateOAuth2ClientParams contains all the parameters to send to the API endpoint - for the update o auth2 client operation. - - Typically these are written to a http.Request. +/*UpdateOAuth2ClientParams contains all the parameters to send to the API endpoint +for the update o auth2 client operation typically these are written to a http.Request */ type UpdateOAuth2ClientParams struct { - // Body. + /*Body*/ Body *models.OAuth2Client - - // ID. + /*ID*/ ID string timeout time.Duration @@ -72,21 +72,6 @@ type UpdateOAuth2ClientParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the update o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateOAuth2ClientParams) WithDefaults() *UpdateOAuth2ClientParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update o auth2 client params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateOAuth2ClientParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the update o auth2 client params func (o *UpdateOAuth2ClientParams) WithTimeout(timeout time.Duration) *UpdateOAuth2ClientParams { o.SetTimeout(timeout) @@ -149,6 +134,7 @@ func (o *UpdateOAuth2ClientParams) WriteToRequest(r runtime.ClientRequest, reg s return err } var res []error + if o.Body != nil { if err := r.SetBodyParam(o.Body); err != nil { return err diff --git a/internal/httpclient/client/admin/update_o_auth2_client_responses.go b/internal/httpclient/client/admin/update_o_auth2_client_responses.go index ce776c59ef3..150c68fe1d8 100644 --- a/internal/httpclient/client/admin/update_o_auth2_client_responses.go +++ b/internal/httpclient/client/admin/update_o_auth2_client_responses.go @@ -35,8 +35,9 @@ func (o *UpdateOAuth2ClientReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewUpdateOAuth2ClientOK() *UpdateOAuth2ClientOK { return &UpdateOAuth2ClientOK{} } -/* UpdateOAuth2ClientOK describes a response with status code 200, with default header values. +/*UpdateOAuth2ClientOK handles this case with default header values. oAuth2Client */ @@ -56,6 +57,7 @@ type UpdateOAuth2ClientOK struct { func (o *UpdateOAuth2ClientOK) Error() string { return fmt.Sprintf("[PUT /clients/{id}][%d] updateOAuth2ClientOK %+v", 200, o.Payload) } + func (o *UpdateOAuth2ClientOK) GetPayload() *models.OAuth2Client { return o.Payload } @@ -77,7 +79,7 @@ func NewUpdateOAuth2ClientInternalServerError() *UpdateOAuth2ClientInternalServe return &UpdateOAuth2ClientInternalServerError{} } -/* UpdateOAuth2ClientInternalServerError describes a response with status code 500, with default header values. +/*UpdateOAuth2ClientInternalServerError handles this case with default header values. jsonError */ @@ -88,6 +90,7 @@ type UpdateOAuth2ClientInternalServerError struct { func (o *UpdateOAuth2ClientInternalServerError) Error() string { return fmt.Sprintf("[PUT /clients/{id}][%d] updateOAuth2ClientInternalServerError %+v", 500, o.Payload) } + func (o *UpdateOAuth2ClientInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/metadata/metadata_client.go b/internal/httpclient/client/metadata/metadata_client.go index 669fe3539b1..73bf982a7e6 100644 --- a/internal/httpclient/client/metadata/metadata_client.go +++ b/internal/httpclient/client/metadata/metadata_client.go @@ -25,12 +25,9 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - // ClientService is the interface for Client methods type ClientService interface { - Prometheus(params *PrometheusParams, opts ...ClientOption) (*PrometheusOK, error) + Prometheus(params *PrometheusParams) (*PrometheusOK, error) SetTransport(transport runtime.ClientTransport) } @@ -45,12 +42,13 @@ prometheus.io/port: "4434" prometheus.io/path: "/metrics/prometheus" ``` */ -func (a *Client) Prometheus(params *PrometheusParams, opts ...ClientOption) (*PrometheusOK, error) { +func (a *Client) Prometheus(params *PrometheusParams) (*PrometheusOK, error) { // TODO: Validate the params before sending if params == nil { params = NewPrometheusParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "prometheus", Method: "GET", PathPattern: "/metrics/prometheus", @@ -61,12 +59,7 @@ func (a *Client) Prometheus(params *PrometheusParams, opts ...ClientOption) (*Pr Reader: &PrometheusReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } diff --git a/internal/httpclient/client/metadata/prometheus_parameters.go b/internal/httpclient/client/metadata/prometheus_parameters.go index b98a921ea85..06b59ae0691 100644 --- a/internal/httpclient/client/metadata/prometheus_parameters.go +++ b/internal/httpclient/client/metadata/prometheus_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewPrometheusParams creates a new PrometheusParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewPrometheusParams creates a new PrometheusParams object +// with the default values initialized. func NewPrometheusParams() *PrometheusParams { + return &PrometheusParams{ + timeout: cr.DefaultTimeout, } } // NewPrometheusParamsWithTimeout creates a new PrometheusParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewPrometheusParamsWithTimeout(timeout time.Duration) *PrometheusParams { + return &PrometheusParams{ + timeout: timeout, } } // NewPrometheusParamsWithContext creates a new PrometheusParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewPrometheusParamsWithContext(ctx context.Context) *PrometheusParams { + return &PrometheusParams{ + Context: ctx, } } // NewPrometheusParamsWithHTTPClient creates a new PrometheusParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewPrometheusParamsWithHTTPClient(client *http.Client) *PrometheusParams { + return &PrometheusParams{ HTTPClient: client, } } -/* PrometheusParams contains all the parameters to send to the API endpoint - for the prometheus operation. - - Typically these are written to a http.Request. +/*PrometheusParams contains all the parameters to send to the API endpoint +for the prometheus operation typically these are written to a http.Request */ type PrometheusParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type PrometheusParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the prometheus params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PrometheusParams) WithDefaults() *PrometheusParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the prometheus params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PrometheusParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the prometheus params func (o *PrometheusParams) WithTimeout(timeout time.Duration) *PrometheusParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/metadata/prometheus_responses.go b/internal/httpclient/client/metadata/prometheus_responses.go index 91a18f4a176..8a4835a2d1f 100644 --- a/internal/httpclient/client/metadata/prometheus_responses.go +++ b/internal/httpclient/client/metadata/prometheus_responses.go @@ -26,8 +26,9 @@ func (o *PrometheusReader) ReadResponse(response runtime.ClientResponse, consume return nil, err } return result, nil + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -36,9 +37,9 @@ func NewPrometheusOK() *PrometheusOK { return &PrometheusOK{} } -/* PrometheusOK describes a response with status code 200, with default header values. +/*PrometheusOK handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type PrometheusOK struct { diff --git a/internal/httpclient/client/public/disconnect_user_parameters.go b/internal/httpclient/client/public/disconnect_user_parameters.go index e0c9b3938d5..e87c91fff85 100644 --- a/internal/httpclient/client/public/disconnect_user_parameters.go +++ b/internal/httpclient/client/public/disconnect_user_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDisconnectUserParams creates a new DisconnectUserParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDisconnectUserParams creates a new DisconnectUserParams object +// with the default values initialized. func NewDisconnectUserParams() *DisconnectUserParams { + return &DisconnectUserParams{ + timeout: cr.DefaultTimeout, } } // NewDisconnectUserParamsWithTimeout creates a new DisconnectUserParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDisconnectUserParamsWithTimeout(timeout time.Duration) *DisconnectUserParams { + return &DisconnectUserParams{ + timeout: timeout, } } // NewDisconnectUserParamsWithContext creates a new DisconnectUserParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDisconnectUserParamsWithContext(ctx context.Context) *DisconnectUserParams { + return &DisconnectUserParams{ + Context: ctx, } } // NewDisconnectUserParamsWithHTTPClient creates a new DisconnectUserParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDisconnectUserParamsWithHTTPClient(client *http.Client) *DisconnectUserParams { + return &DisconnectUserParams{ HTTPClient: client, } } -/* DisconnectUserParams contains all the parameters to send to the API endpoint - for the disconnect user operation. - - Typically these are written to a http.Request. +/*DisconnectUserParams contains all the parameters to send to the API endpoint +for the disconnect user operation typically these are written to a http.Request */ type DisconnectUserParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type DisconnectUserParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the disconnect user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisconnectUserParams) WithDefaults() *DisconnectUserParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the disconnect user params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisconnectUserParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the disconnect user params func (o *DisconnectUserParams) WithTimeout(timeout time.Duration) *DisconnectUserParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/disconnect_user_responses.go b/internal/httpclient/client/public/disconnect_user_responses.go index e5a423481dd..cba4856c5ef 100644 --- a/internal/httpclient/client/public/disconnect_user_responses.go +++ b/internal/httpclient/client/public/disconnect_user_responses.go @@ -26,8 +26,9 @@ func (o *DisconnectUserReader) ReadResponse(response runtime.ClientResponse, con return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -36,9 +37,9 @@ func NewDisconnectUserFound() *DisconnectUserFound { return &DisconnectUserFound{} } -/* DisconnectUserFound describes a response with status code 302, with default header values. +/*DisconnectUserFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type DisconnectUserFound struct { diff --git a/internal/httpclient/client/public/discover_open_id_configuration_parameters.go b/internal/httpclient/client/public/discover_open_id_configuration_parameters.go index 93ff41bb9a5..db24ed1492a 100644 --- a/internal/httpclient/client/public/discover_open_id_configuration_parameters.go +++ b/internal/httpclient/client/public/discover_open_id_configuration_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewDiscoverOpenIDConfigurationParams creates a new DiscoverOpenIDConfigurationParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewDiscoverOpenIDConfigurationParams creates a new DiscoverOpenIDConfigurationParams object +// with the default values initialized. func NewDiscoverOpenIDConfigurationParams() *DiscoverOpenIDConfigurationParams { + return &DiscoverOpenIDConfigurationParams{ + timeout: cr.DefaultTimeout, } } // NewDiscoverOpenIDConfigurationParamsWithTimeout creates a new DiscoverOpenIDConfigurationParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewDiscoverOpenIDConfigurationParamsWithTimeout(timeout time.Duration) *DiscoverOpenIDConfigurationParams { + return &DiscoverOpenIDConfigurationParams{ + timeout: timeout, } } // NewDiscoverOpenIDConfigurationParamsWithContext creates a new DiscoverOpenIDConfigurationParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewDiscoverOpenIDConfigurationParamsWithContext(ctx context.Context) *DiscoverOpenIDConfigurationParams { + return &DiscoverOpenIDConfigurationParams{ + Context: ctx, } } // NewDiscoverOpenIDConfigurationParamsWithHTTPClient creates a new DiscoverOpenIDConfigurationParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewDiscoverOpenIDConfigurationParamsWithHTTPClient(client *http.Client) *DiscoverOpenIDConfigurationParams { + return &DiscoverOpenIDConfigurationParams{ HTTPClient: client, } } -/* DiscoverOpenIDConfigurationParams contains all the parameters to send to the API endpoint - for the discover open ID configuration operation. - - Typically these are written to a http.Request. +/*DiscoverOpenIDConfigurationParams contains all the parameters to send to the API endpoint +for the discover open ID configuration operation typically these are written to a http.Request */ type DiscoverOpenIDConfigurationParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type DiscoverOpenIDConfigurationParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the discover open ID configuration params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DiscoverOpenIDConfigurationParams) WithDefaults() *DiscoverOpenIDConfigurationParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the discover open ID configuration params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DiscoverOpenIDConfigurationParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the discover open ID configuration params func (o *DiscoverOpenIDConfigurationParams) WithTimeout(timeout time.Duration) *DiscoverOpenIDConfigurationParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/discover_open_id_configuration_responses.go b/internal/httpclient/client/public/discover_open_id_configuration_responses.go index ad0e1e75fba..a3e7a6c5b7c 100644 --- a/internal/httpclient/client/public/discover_open_id_configuration_responses.go +++ b/internal/httpclient/client/public/discover_open_id_configuration_responses.go @@ -41,8 +41,9 @@ func (o *DiscoverOpenIDConfigurationReader) ReadResponse(response runtime.Client return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewDiscoverOpenIDConfigurationOK() *DiscoverOpenIDConfigurationOK { return &DiscoverOpenIDConfigurationOK{} } -/* DiscoverOpenIDConfigurationOK describes a response with status code 200, with default header values. +/*DiscoverOpenIDConfigurationOK handles this case with default header values. wellKnown */ @@ -62,6 +63,7 @@ type DiscoverOpenIDConfigurationOK struct { func (o *DiscoverOpenIDConfigurationOK) Error() string { return fmt.Sprintf("[GET /.well-known/openid-configuration][%d] discoverOpenIdConfigurationOK %+v", 200, o.Payload) } + func (o *DiscoverOpenIDConfigurationOK) GetPayload() *models.WellKnown { return o.Payload } @@ -83,7 +85,7 @@ func NewDiscoverOpenIDConfigurationUnauthorized() *DiscoverOpenIDConfigurationUn return &DiscoverOpenIDConfigurationUnauthorized{} } -/* DiscoverOpenIDConfigurationUnauthorized describes a response with status code 401, with default header values. +/*DiscoverOpenIDConfigurationUnauthorized handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type DiscoverOpenIDConfigurationUnauthorized struct { func (o *DiscoverOpenIDConfigurationUnauthorized) Error() string { return fmt.Sprintf("[GET /.well-known/openid-configuration][%d] discoverOpenIdConfigurationUnauthorized %+v", 401, o.Payload) } + func (o *DiscoverOpenIDConfigurationUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewDiscoverOpenIDConfigurationInternalServerError() *DiscoverOpenIDConfigur return &DiscoverOpenIDConfigurationInternalServerError{} } -/* DiscoverOpenIDConfigurationInternalServerError describes a response with status code 500, with default header values. +/*DiscoverOpenIDConfigurationInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type DiscoverOpenIDConfigurationInternalServerError struct { func (o *DiscoverOpenIDConfigurationInternalServerError) Error() string { return fmt.Sprintf("[GET /.well-known/openid-configuration][%d] discoverOpenIdConfigurationInternalServerError %+v", 500, o.Payload) } + func (o *DiscoverOpenIDConfigurationInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/is_instance_ready_parameters.go b/internal/httpclient/client/public/is_instance_ready_parameters.go index 1d00d0188ae..b6ae09dcfd3 100644 --- a/internal/httpclient/client/public/is_instance_ready_parameters.go +++ b/internal/httpclient/client/public/is_instance_ready_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewIsInstanceReadyParams creates a new IsInstanceReadyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewIsInstanceReadyParams creates a new IsInstanceReadyParams object +// with the default values initialized. func NewIsInstanceReadyParams() *IsInstanceReadyParams { + return &IsInstanceReadyParams{ + timeout: cr.DefaultTimeout, } } // NewIsInstanceReadyParamsWithTimeout creates a new IsInstanceReadyParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewIsInstanceReadyParamsWithTimeout(timeout time.Duration) *IsInstanceReadyParams { + return &IsInstanceReadyParams{ + timeout: timeout, } } // NewIsInstanceReadyParamsWithContext creates a new IsInstanceReadyParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewIsInstanceReadyParamsWithContext(ctx context.Context) *IsInstanceReadyParams { + return &IsInstanceReadyParams{ + Context: ctx, } } // NewIsInstanceReadyParamsWithHTTPClient creates a new IsInstanceReadyParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewIsInstanceReadyParamsWithHTTPClient(client *http.Client) *IsInstanceReadyParams { + return &IsInstanceReadyParams{ HTTPClient: client, } } -/* IsInstanceReadyParams contains all the parameters to send to the API endpoint - for the is instance ready operation. - - Typically these are written to a http.Request. +/*IsInstanceReadyParams contains all the parameters to send to the API endpoint +for the is instance ready operation typically these are written to a http.Request */ type IsInstanceReadyParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type IsInstanceReadyParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the is instance ready params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceReadyParams) WithDefaults() *IsInstanceReadyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the is instance ready params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *IsInstanceReadyParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the is instance ready params func (o *IsInstanceReadyParams) WithTimeout(timeout time.Duration) *IsInstanceReadyParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/is_instance_ready_responses.go b/internal/httpclient/client/public/is_instance_ready_responses.go index e09081bd45b..2739bb4c847 100644 --- a/internal/httpclient/client/public/is_instance_ready_responses.go +++ b/internal/httpclient/client/public/is_instance_ready_responses.go @@ -35,8 +35,9 @@ func (o *IsInstanceReadyReader) ReadResponse(response runtime.ClientResponse, co return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewIsInstanceReadyOK() *IsInstanceReadyOK { return &IsInstanceReadyOK{} } -/* IsInstanceReadyOK describes a response with status code 200, with default header values. +/*IsInstanceReadyOK handles this case with default header values. healthStatus */ @@ -56,6 +57,7 @@ type IsInstanceReadyOK struct { func (o *IsInstanceReadyOK) Error() string { return fmt.Sprintf("[GET /health/ready][%d] isInstanceReadyOK %+v", 200, o.Payload) } + func (o *IsInstanceReadyOK) GetPayload() *models.HealthStatus { return o.Payload } @@ -77,7 +79,7 @@ func NewIsInstanceReadyServiceUnavailable() *IsInstanceReadyServiceUnavailable { return &IsInstanceReadyServiceUnavailable{} } -/* IsInstanceReadyServiceUnavailable describes a response with status code 503, with default header values. +/*IsInstanceReadyServiceUnavailable handles this case with default header values. healthNotReadyStatus */ @@ -88,6 +90,7 @@ type IsInstanceReadyServiceUnavailable struct { func (o *IsInstanceReadyServiceUnavailable) Error() string { return fmt.Sprintf("[GET /health/ready][%d] isInstanceReadyServiceUnavailable %+v", 503, o.Payload) } + func (o *IsInstanceReadyServiceUnavailable) GetPayload() *models.HealthNotReadyStatus { return o.Payload } diff --git a/internal/httpclient/client/public/oauth2_token_parameters.go b/internal/httpclient/client/public/oauth2_token_parameters.go index c67d2e921e3..6acc0424a20 100644 --- a/internal/httpclient/client/public/oauth2_token_parameters.go +++ b/internal/httpclient/client/public/oauth2_token_parameters.go @@ -16,62 +16,59 @@ import ( "github.com/go-openapi/strfmt" ) -// NewOauth2TokenParams creates a new Oauth2TokenParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewOauth2TokenParams creates a new Oauth2TokenParams object +// with the default values initialized. func NewOauth2TokenParams() *Oauth2TokenParams { + var () return &Oauth2TokenParams{ + timeout: cr.DefaultTimeout, } } // NewOauth2TokenParamsWithTimeout creates a new Oauth2TokenParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewOauth2TokenParamsWithTimeout(timeout time.Duration) *Oauth2TokenParams { + var () return &Oauth2TokenParams{ + timeout: timeout, } } // NewOauth2TokenParamsWithContext creates a new Oauth2TokenParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewOauth2TokenParamsWithContext(ctx context.Context) *Oauth2TokenParams { + var () return &Oauth2TokenParams{ + Context: ctx, } } // NewOauth2TokenParamsWithHTTPClient creates a new Oauth2TokenParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewOauth2TokenParamsWithHTTPClient(client *http.Client) *Oauth2TokenParams { + var () return &Oauth2TokenParams{ HTTPClient: client, } } -/* Oauth2TokenParams contains all the parameters to send to the API endpoint - for the oauth2 token operation. - - Typically these are written to a http.Request. +/*Oauth2TokenParams contains all the parameters to send to the API endpoint +for the oauth2 token operation typically these are written to a http.Request */ type Oauth2TokenParams struct { - // ClientID. + /*ClientID*/ ClientID *string - - // Code. + /*Code*/ Code *string - - // GrantType. + /*GrantType*/ GrantType string - - // RedirectURI. + /*RedirectURI*/ RedirectURI *string - - // RefreshToken. + /*RefreshToken*/ RefreshToken *string timeout time.Duration @@ -79,21 +76,6 @@ type Oauth2TokenParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the oauth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *Oauth2TokenParams) WithDefaults() *Oauth2TokenParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the oauth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *Oauth2TokenParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the oauth2 token params func (o *Oauth2TokenParams) WithTimeout(timeout time.Duration) *Oauth2TokenParams { o.SetTimeout(timeout) @@ -203,6 +185,7 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } + } if o.Code != nil { @@ -218,6 +201,7 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } + } // form param grant_type @@ -242,6 +226,7 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } + } if o.RefreshToken != nil { @@ -257,6 +242,7 @@ func (o *Oauth2TokenParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.R return err } } + } if len(res) > 0 { diff --git a/internal/httpclient/client/public/oauth2_token_responses.go b/internal/httpclient/client/public/oauth2_token_responses.go index 72db050471a..1a0fe662680 100644 --- a/internal/httpclient/client/public/oauth2_token_responses.go +++ b/internal/httpclient/client/public/oauth2_token_responses.go @@ -47,8 +47,9 @@ func (o *Oauth2TokenReader) ReadResponse(response runtime.ClientResponse, consum return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -57,7 +58,7 @@ func NewOauth2TokenOK() *Oauth2TokenOK { return &Oauth2TokenOK{} } -/* Oauth2TokenOK describes a response with status code 200, with default header values. +/*Oauth2TokenOK handles this case with default header values. oauth2TokenResponse */ @@ -68,6 +69,7 @@ type Oauth2TokenOK struct { func (o *Oauth2TokenOK) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenOK %+v", 200, o.Payload) } + func (o *Oauth2TokenOK) GetPayload() *models.Oauth2TokenResponse { return o.Payload } @@ -89,7 +91,7 @@ func NewOauth2TokenBadRequest() *Oauth2TokenBadRequest { return &Oauth2TokenBadRequest{} } -/* Oauth2TokenBadRequest describes a response with status code 400, with default header values. +/*Oauth2TokenBadRequest handles this case with default header values. jsonError */ @@ -100,6 +102,7 @@ type Oauth2TokenBadRequest struct { func (o *Oauth2TokenBadRequest) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenBadRequest %+v", 400, o.Payload) } + func (o *Oauth2TokenBadRequest) GetPayload() *models.JSONError { return o.Payload } @@ -121,7 +124,7 @@ func NewOauth2TokenUnauthorized() *Oauth2TokenUnauthorized { return &Oauth2TokenUnauthorized{} } -/* Oauth2TokenUnauthorized describes a response with status code 401, with default header values. +/*Oauth2TokenUnauthorized handles this case with default header values. jsonError */ @@ -132,6 +135,7 @@ type Oauth2TokenUnauthorized struct { func (o *Oauth2TokenUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenUnauthorized %+v", 401, o.Payload) } + func (o *Oauth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -153,7 +157,7 @@ func NewOauth2TokenInternalServerError() *Oauth2TokenInternalServerError { return &Oauth2TokenInternalServerError{} } -/* Oauth2TokenInternalServerError describes a response with status code 500, with default header values. +/*Oauth2TokenInternalServerError handles this case with default header values. jsonError */ @@ -164,6 +168,7 @@ type Oauth2TokenInternalServerError struct { func (o *Oauth2TokenInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/token][%d] oauth2TokenInternalServerError %+v", 500, o.Payload) } + func (o *Oauth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/oauth_auth_parameters.go b/internal/httpclient/client/public/oauth_auth_parameters.go index 46f21005985..4476b6a7414 100644 --- a/internal/httpclient/client/public/oauth_auth_parameters.go +++ b/internal/httpclient/client/public/oauth_auth_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewOauthAuthParams creates a new OauthAuthParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewOauthAuthParams creates a new OauthAuthParams object +// with the default values initialized. func NewOauthAuthParams() *OauthAuthParams { + return &OauthAuthParams{ + timeout: cr.DefaultTimeout, } } // NewOauthAuthParamsWithTimeout creates a new OauthAuthParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewOauthAuthParamsWithTimeout(timeout time.Duration) *OauthAuthParams { + return &OauthAuthParams{ + timeout: timeout, } } // NewOauthAuthParamsWithContext creates a new OauthAuthParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewOauthAuthParamsWithContext(ctx context.Context) *OauthAuthParams { + return &OauthAuthParams{ + Context: ctx, } } // NewOauthAuthParamsWithHTTPClient creates a new OauthAuthParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewOauthAuthParamsWithHTTPClient(client *http.Client) *OauthAuthParams { + return &OauthAuthParams{ HTTPClient: client, } } -/* OauthAuthParams contains all the parameters to send to the API endpoint - for the oauth auth operation. - - Typically these are written to a http.Request. +/*OauthAuthParams contains all the parameters to send to the API endpoint +for the oauth auth operation typically these are written to a http.Request */ type OauthAuthParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type OauthAuthParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the oauth auth params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *OauthAuthParams) WithDefaults() *OauthAuthParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the oauth auth params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *OauthAuthParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the oauth auth params func (o *OauthAuthParams) WithTimeout(timeout time.Duration) *OauthAuthParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/oauth_auth_responses.go b/internal/httpclient/client/public/oauth_auth_responses.go index 7a0a3477b9d..ad4a379f4c2 100644 --- a/internal/httpclient/client/public/oauth_auth_responses.go +++ b/internal/httpclient/client/public/oauth_auth_responses.go @@ -41,8 +41,9 @@ func (o *OauthAuthReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewOauthAuthFound() *OauthAuthFound { return &OauthAuthFound{} } -/* OauthAuthFound describes a response with status code 302, with default header values. +/*OauthAuthFound handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type OauthAuthFound struct { @@ -73,7 +74,7 @@ func NewOauthAuthUnauthorized() *OauthAuthUnauthorized { return &OauthAuthUnauthorized{} } -/* OauthAuthUnauthorized describes a response with status code 401, with default header values. +/*OauthAuthUnauthorized handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type OauthAuthUnauthorized struct { func (o *OauthAuthUnauthorized) Error() string { return fmt.Sprintf("[GET /oauth2/auth][%d] oauthAuthUnauthorized %+v", 401, o.Payload) } + func (o *OauthAuthUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewOauthAuthInternalServerError() *OauthAuthInternalServerError { return &OauthAuthInternalServerError{} } -/* OauthAuthInternalServerError describes a response with status code 500, with default header values. +/*OauthAuthInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type OauthAuthInternalServerError struct { func (o *OauthAuthInternalServerError) Error() string { return fmt.Sprintf("[GET /oauth2/auth][%d] oauthAuthInternalServerError %+v", 500, o.Payload) } + func (o *OauthAuthInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/public_client.go b/internal/httpclient/client/public/public_client.go index aed55d3e0d7..c5e30ab557d 100644 --- a/internal/httpclient/client/public/public_client.go +++ b/internal/httpclient/client/public/public_client.go @@ -25,26 +25,23 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - // ClientService is the interface for Client methods type ClientService interface { - DisconnectUser(params *DisconnectUserParams, opts ...ClientOption) error + DisconnectUser(params *DisconnectUserParams) error - DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams, opts ...ClientOption) (*DiscoverOpenIDConfigurationOK, error) + DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams) (*DiscoverOpenIDConfigurationOK, error) - IsInstanceReady(params *IsInstanceReadyParams, opts ...ClientOption) (*IsInstanceReadyOK, error) + IsInstanceReady(params *IsInstanceReadyParams) (*IsInstanceReadyOK, error) - Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*Oauth2TokenOK, error) + Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*Oauth2TokenOK, error) - OauthAuth(params *OauthAuthParams, opts ...ClientOption) error + OauthAuth(params *OauthAuthParams) error - RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeOAuth2TokenOK, error) + RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeOAuth2TokenOK, error) - Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UserinfoOK, error) + Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter) (*UserinfoOK, error) - WellKnown(params *WellKnownParams, opts ...ClientOption) (*WellKnownOK, error) + WellKnown(params *WellKnownParams) (*WellKnownOK, error) SetTransport(transport runtime.ClientTransport) } @@ -57,12 +54,13 @@ type ClientService interface { https://openid.net/specs/openid-connect-frontchannel-1_0.html https://openid.net/specs/openid-connect-backchannel-1_0.html */ -func (a *Client) DisconnectUser(params *DisconnectUserParams, opts ...ClientOption) error { +func (a *Client) DisconnectUser(params *DisconnectUserParams) error { // TODO: Validate the params before sending if params == nil { params = NewDisconnectUserParams() } - op := &runtime.ClientOperation{ + + _, err := a.transport.Submit(&runtime.ClientOperation{ ID: "disconnectUser", Method: "GET", PathPattern: "/oauth2/sessions/logout", @@ -73,12 +71,7 @@ func (a *Client) DisconnectUser(params *DisconnectUserParams, opts ...ClientOpti Reader: &DisconnectUserReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - _, err := a.transport.Submit(op) + }) if err != nil { return err } @@ -95,12 +88,13 @@ flow at https://openid.net/specs/openid-connect-discovery-1_0.html . Popular libraries for OpenID Connect clients include oidc-client-js (JavaScript), go-oidc (Golang), and others. For a full list of clients go here: https://openid.net/developers/certified/ */ -func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams, opts ...ClientOption) (*DiscoverOpenIDConfigurationOK, error) { +func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfigurationParams) (*DiscoverOpenIDConfigurationOK, error) { // TODO: Validate the params before sending if params == nil { params = NewDiscoverOpenIDConfigurationParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "discoverOpenIDConfiguration", Method: "GET", PathPattern: "/.well-known/openid-configuration", @@ -111,12 +105,7 @@ func (a *Client) DiscoverOpenIDConfiguration(params *DiscoverOpenIDConfiguration Reader: &DiscoverOpenIDConfigurationReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -142,12 +131,13 @@ If the service supports TLS Edge Termination, this endpoint does not require the Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance. */ -func (a *Client) IsInstanceReady(params *IsInstanceReadyParams, opts ...ClientOption) (*IsInstanceReadyOK, error) { +func (a *Client) IsInstanceReady(params *IsInstanceReadyParams) (*IsInstanceReadyOK, error) { // TODO: Validate the params before sending if params == nil { params = NewIsInstanceReadyParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "isInstanceReady", Method: "GET", PathPattern: "/health/ready", @@ -158,12 +148,7 @@ func (a *Client) IsInstanceReady(params *IsInstanceReadyParams, opts ...ClientOp Reader: &IsInstanceReadyReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -189,12 +174,13 @@ request entity-body. > > Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed above! */ -func (a *Client) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*Oauth2TokenOK, error) { +func (a *Client) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*Oauth2TokenOK, error) { // TODO: Validate the params before sending if params == nil { params = NewOauth2TokenParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "oauth2Token", Method: "POST", PathPattern: "/oauth2/token", @@ -206,12 +192,7 @@ func (a *Client) Oauth2Token(params *Oauth2TokenParams, authInfo runtime.ClientA AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -233,12 +214,13 @@ OAuth2 is a very popular protocol and a library for your programming language wi To learn more about this flow please refer to the specification: https://tools.ietf.org/html/rfc6749 */ -func (a *Client) OauthAuth(params *OauthAuthParams, opts ...ClientOption) error { +func (a *Client) OauthAuth(params *OauthAuthParams) error { // TODO: Validate the params before sending if params == nil { params = NewOauthAuthParams() } - op := &runtime.ClientOperation{ + + _, err := a.transport.Submit(&runtime.ClientOperation{ ID: "oauthAuth", Method: "GET", PathPattern: "/oauth2/auth", @@ -249,12 +231,7 @@ func (a *Client) OauthAuth(params *OauthAuthParams, opts ...ClientOption) error Reader: &OauthAuthReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - _, err := a.transport.Submit(op) + }) if err != nil { return err } @@ -269,12 +246,13 @@ longer be used to make access requests, and a revoked refresh token can no longe Revoking a refresh token also invalidates the access token that was created with it. A token may only be revoked by the client the token was generated for. */ -func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RevokeOAuth2TokenOK, error) { +func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo runtime.ClientAuthInfoWriter) (*RevokeOAuth2TokenOK, error) { // TODO: Validate the params before sending if params == nil { params = NewRevokeOAuth2TokenParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "revokeOAuth2Token", Method: "POST", PathPattern: "/oauth2/revoke", @@ -286,12 +264,7 @@ func (a *Client) RevokeOAuth2Token(params *RevokeOAuth2TokenParams, authInfo run AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -317,12 +290,13 @@ In the case of authentication error, a WWW-Authenticate header might be set in t with more information about the error. See [the spec](https://datatracker.ietf.org/doc/html/rfc6750#section-3) for more details about header format. */ -func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UserinfoOK, error) { +func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInfoWriter) (*UserinfoOK, error) { // TODO: Validate the params before sending if params == nil { params = NewUserinfoParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "userinfo", Method: "GET", PathPattern: "/userinfo", @@ -334,12 +308,7 @@ func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInf AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } @@ -360,12 +329,13 @@ func (a *Client) Userinfo(params *UserinfoParams, authInfo runtime.ClientAuthInf if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like [node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others. */ -func (a *Client) WellKnown(params *WellKnownParams, opts ...ClientOption) (*WellKnownOK, error) { +func (a *Client) WellKnown(params *WellKnownParams) (*WellKnownOK, error) { // TODO: Validate the params before sending if params == nil { params = NewWellKnownParams() } - op := &runtime.ClientOperation{ + + result, err := a.transport.Submit(&runtime.ClientOperation{ ID: "wellKnown", Method: "GET", PathPattern: "/.well-known/jwks.json", @@ -376,12 +346,7 @@ func (a *Client) WellKnown(params *WellKnownParams, opts ...ClientOption) (*Well Reader: &WellKnownReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) + }) if err != nil { return nil, err } diff --git a/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go b/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go index 8a67b4b2903..782c6be73b8 100644 --- a/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go +++ b/internal/httpclient/client/public/revoke_o_auth2_token_parameters.go @@ -16,50 +16,51 @@ import ( "github.com/go-openapi/strfmt" ) -// NewRevokeOAuth2TokenParams creates a new RevokeOAuth2TokenParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewRevokeOAuth2TokenParams creates a new RevokeOAuth2TokenParams object +// with the default values initialized. func NewRevokeOAuth2TokenParams() *RevokeOAuth2TokenParams { + var () return &RevokeOAuth2TokenParams{ + timeout: cr.DefaultTimeout, } } // NewRevokeOAuth2TokenParamsWithTimeout creates a new RevokeOAuth2TokenParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewRevokeOAuth2TokenParamsWithTimeout(timeout time.Duration) *RevokeOAuth2TokenParams { + var () return &RevokeOAuth2TokenParams{ + timeout: timeout, } } // NewRevokeOAuth2TokenParamsWithContext creates a new RevokeOAuth2TokenParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewRevokeOAuth2TokenParamsWithContext(ctx context.Context) *RevokeOAuth2TokenParams { + var () return &RevokeOAuth2TokenParams{ + Context: ctx, } } // NewRevokeOAuth2TokenParamsWithHTTPClient creates a new RevokeOAuth2TokenParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewRevokeOAuth2TokenParamsWithHTTPClient(client *http.Client) *RevokeOAuth2TokenParams { + var () return &RevokeOAuth2TokenParams{ HTTPClient: client, } } -/* RevokeOAuth2TokenParams contains all the parameters to send to the API endpoint - for the revoke o auth2 token operation. - - Typically these are written to a http.Request. +/*RevokeOAuth2TokenParams contains all the parameters to send to the API endpoint +for the revoke o auth2 token operation typically these are written to a http.Request */ type RevokeOAuth2TokenParams struct { - // Token. + /*Token*/ Token string timeout time.Duration @@ -67,21 +68,6 @@ type RevokeOAuth2TokenParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the revoke o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeOAuth2TokenParams) WithDefaults() *RevokeOAuth2TokenParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the revoke o auth2 token params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RevokeOAuth2TokenParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the revoke o auth2 token params func (o *RevokeOAuth2TokenParams) WithTimeout(timeout time.Duration) *RevokeOAuth2TokenParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/revoke_o_auth2_token_responses.go b/internal/httpclient/client/public/revoke_o_auth2_token_responses.go index 3e34c0a0645..1e058d9b063 100644 --- a/internal/httpclient/client/public/revoke_o_auth2_token_responses.go +++ b/internal/httpclient/client/public/revoke_o_auth2_token_responses.go @@ -41,8 +41,9 @@ func (o *RevokeOAuth2TokenReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,9 +52,9 @@ func NewRevokeOAuth2TokenOK() *RevokeOAuth2TokenOK { return &RevokeOAuth2TokenOK{} } -/* RevokeOAuth2TokenOK describes a response with status code 200, with default header values. +/*RevokeOAuth2TokenOK handles this case with default header values. - Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is +Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. */ type RevokeOAuth2TokenOK struct { @@ -73,7 +74,7 @@ func NewRevokeOAuth2TokenUnauthorized() *RevokeOAuth2TokenUnauthorized { return &RevokeOAuth2TokenUnauthorized{} } -/* RevokeOAuth2TokenUnauthorized describes a response with status code 401, with default header values. +/*RevokeOAuth2TokenUnauthorized handles this case with default header values. jsonError */ @@ -84,6 +85,7 @@ type RevokeOAuth2TokenUnauthorized struct { func (o *RevokeOAuth2TokenUnauthorized) Error() string { return fmt.Sprintf("[POST /oauth2/revoke][%d] revokeOAuth2TokenUnauthorized %+v", 401, o.Payload) } + func (o *RevokeOAuth2TokenUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -105,7 +107,7 @@ func NewRevokeOAuth2TokenInternalServerError() *RevokeOAuth2TokenInternalServerE return &RevokeOAuth2TokenInternalServerError{} } -/* RevokeOAuth2TokenInternalServerError describes a response with status code 500, with default header values. +/*RevokeOAuth2TokenInternalServerError handles this case with default header values. jsonError */ @@ -116,6 +118,7 @@ type RevokeOAuth2TokenInternalServerError struct { func (o *RevokeOAuth2TokenInternalServerError) Error() string { return fmt.Sprintf("[POST /oauth2/revoke][%d] revokeOAuth2TokenInternalServerError %+v", 500, o.Payload) } + func (o *RevokeOAuth2TokenInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/userinfo_parameters.go b/internal/httpclient/client/public/userinfo_parameters.go index 03b3ad50f4b..f9028b8ec43 100644 --- a/internal/httpclient/client/public/userinfo_parameters.go +++ b/internal/httpclient/client/public/userinfo_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewUserinfoParams creates a new UserinfoParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewUserinfoParams creates a new UserinfoParams object +// with the default values initialized. func NewUserinfoParams() *UserinfoParams { + return &UserinfoParams{ + timeout: cr.DefaultTimeout, } } // NewUserinfoParamsWithTimeout creates a new UserinfoParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewUserinfoParamsWithTimeout(timeout time.Duration) *UserinfoParams { + return &UserinfoParams{ + timeout: timeout, } } // NewUserinfoParamsWithContext creates a new UserinfoParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewUserinfoParamsWithContext(ctx context.Context) *UserinfoParams { + return &UserinfoParams{ + Context: ctx, } } // NewUserinfoParamsWithHTTPClient creates a new UserinfoParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewUserinfoParamsWithHTTPClient(client *http.Client) *UserinfoParams { + return &UserinfoParams{ HTTPClient: client, } } -/* UserinfoParams contains all the parameters to send to the API endpoint - for the userinfo operation. - - Typically these are written to a http.Request. +/*UserinfoParams contains all the parameters to send to the API endpoint +for the userinfo operation typically these are written to a http.Request */ type UserinfoParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type UserinfoParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the userinfo params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UserinfoParams) WithDefaults() *UserinfoParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the userinfo params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UserinfoParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the userinfo params func (o *UserinfoParams) WithTimeout(timeout time.Duration) *UserinfoParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/userinfo_responses.go b/internal/httpclient/client/public/userinfo_responses.go index 7a7f9cd033b..14a27428726 100644 --- a/internal/httpclient/client/public/userinfo_responses.go +++ b/internal/httpclient/client/public/userinfo_responses.go @@ -41,8 +41,9 @@ func (o *UserinfoReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -51,7 +52,7 @@ func NewUserinfoOK() *UserinfoOK { return &UserinfoOK{} } -/* UserinfoOK describes a response with status code 200, with default header values. +/*UserinfoOK handles this case with default header values. userinfoResponse */ @@ -62,6 +63,7 @@ type UserinfoOK struct { func (o *UserinfoOK) Error() string { return fmt.Sprintf("[GET /userinfo][%d] userinfoOK %+v", 200, o.Payload) } + func (o *UserinfoOK) GetPayload() *models.UserinfoResponse { return o.Payload } @@ -83,7 +85,7 @@ func NewUserinfoUnauthorized() *UserinfoUnauthorized { return &UserinfoUnauthorized{} } -/* UserinfoUnauthorized describes a response with status code 401, with default header values. +/*UserinfoUnauthorized handles this case with default header values. jsonError */ @@ -94,6 +96,7 @@ type UserinfoUnauthorized struct { func (o *UserinfoUnauthorized) Error() string { return fmt.Sprintf("[GET /userinfo][%d] userinfoUnauthorized %+v", 401, o.Payload) } + func (o *UserinfoUnauthorized) GetPayload() *models.JSONError { return o.Payload } @@ -115,7 +118,7 @@ func NewUserinfoInternalServerError() *UserinfoInternalServerError { return &UserinfoInternalServerError{} } -/* UserinfoInternalServerError describes a response with status code 500, with default header values. +/*UserinfoInternalServerError handles this case with default header values. jsonError */ @@ -126,6 +129,7 @@ type UserinfoInternalServerError struct { func (o *UserinfoInternalServerError) Error() string { return fmt.Sprintf("[GET /userinfo][%d] userinfoInternalServerError %+v", 500, o.Payload) } + func (o *UserinfoInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/client/public/well_known_parameters.go b/internal/httpclient/client/public/well_known_parameters.go index b9b34518e5b..206f42be2d7 100644 --- a/internal/httpclient/client/public/well_known_parameters.go +++ b/internal/httpclient/client/public/well_known_parameters.go @@ -16,46 +16,47 @@ import ( "github.com/go-openapi/strfmt" ) -// NewWellKnownParams creates a new WellKnownParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. +// NewWellKnownParams creates a new WellKnownParams object +// with the default values initialized. func NewWellKnownParams() *WellKnownParams { + return &WellKnownParams{ + timeout: cr.DefaultTimeout, } } // NewWellKnownParamsWithTimeout creates a new WellKnownParams object -// with the ability to set a timeout on a request. +// with the default values initialized, and the ability to set a timeout on a request func NewWellKnownParamsWithTimeout(timeout time.Duration) *WellKnownParams { + return &WellKnownParams{ + timeout: timeout, } } // NewWellKnownParamsWithContext creates a new WellKnownParams object -// with the ability to set a context for a request. +// with the default values initialized, and the ability to set a context for a request func NewWellKnownParamsWithContext(ctx context.Context) *WellKnownParams { + return &WellKnownParams{ + Context: ctx, } } // NewWellKnownParamsWithHTTPClient creates a new WellKnownParams object -// with the ability to set a custom HTTPClient for a request. +// with the default values initialized, and the ability to set a custom HTTPClient for a request func NewWellKnownParamsWithHTTPClient(client *http.Client) *WellKnownParams { + return &WellKnownParams{ HTTPClient: client, } } -/* WellKnownParams contains all the parameters to send to the API endpoint - for the well known operation. - - Typically these are written to a http.Request. +/*WellKnownParams contains all the parameters to send to the API endpoint +for the well known operation typically these are written to a http.Request */ type WellKnownParams struct { timeout time.Duration @@ -63,21 +64,6 @@ type WellKnownParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the well known params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *WellKnownParams) WithDefaults() *WellKnownParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the well known params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *WellKnownParams) SetDefaults() { - // no default values defined for this parameter -} - // WithTimeout adds the timeout to the well known params func (o *WellKnownParams) WithTimeout(timeout time.Duration) *WellKnownParams { o.SetTimeout(timeout) diff --git a/internal/httpclient/client/public/well_known_responses.go b/internal/httpclient/client/public/well_known_responses.go index 2d0a35e587c..8182a40c516 100644 --- a/internal/httpclient/client/public/well_known_responses.go +++ b/internal/httpclient/client/public/well_known_responses.go @@ -35,8 +35,9 @@ func (o *WellKnownReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result + default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } @@ -45,7 +46,7 @@ func NewWellKnownOK() *WellKnownOK { return &WellKnownOK{} } -/* WellKnownOK describes a response with status code 200, with default header values. +/*WellKnownOK handles this case with default header values. JSONWebKeySet */ @@ -56,6 +57,7 @@ type WellKnownOK struct { func (o *WellKnownOK) Error() string { return fmt.Sprintf("[GET /.well-known/jwks.json][%d] wellKnownOK %+v", 200, o.Payload) } + func (o *WellKnownOK) GetPayload() *models.JSONWebKeySet { return o.Payload } @@ -77,7 +79,7 @@ func NewWellKnownInternalServerError() *WellKnownInternalServerError { return &WellKnownInternalServerError{} } -/* WellKnownInternalServerError describes a response with status code 500, with default header values. +/*WellKnownInternalServerError handles this case with default header values. jsonError */ @@ -88,6 +90,7 @@ type WellKnownInternalServerError struct { func (o *WellKnownInternalServerError) Error() string { return fmt.Sprintf("[GET /.well-known/jwks.json][%d] wellKnownInternalServerError %+v", 500, o.Payload) } + func (o *WellKnownInternalServerError) GetPayload() *models.JSONError { return o.Payload } diff --git a/internal/httpclient/models/accept_consent_request.go b/internal/httpclient/models/accept_consent_request.go index 699edfe1212..89d31c9c64a 100644 --- a/internal/httpclient/models/accept_consent_request.go +++ b/internal/httpclient/models/accept_consent_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -67,6 +65,7 @@ func (m *AcceptConsentRequest) Validate(formats strfmt.Registry) error { } func (m *AcceptConsentRequest) validateGrantAccessTokenAudience(formats strfmt.Registry) error { + if swag.IsZero(m.GrantAccessTokenAudience) { // not required return nil } @@ -74,8 +73,6 @@ func (m *AcceptConsentRequest) validateGrantAccessTokenAudience(formats strfmt.R if err := m.GrantAccessTokenAudience.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("grant_access_token_audience") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grant_access_token_audience") } return err } @@ -84,6 +81,7 @@ func (m *AcceptConsentRequest) validateGrantAccessTokenAudience(formats strfmt.R } func (m *AcceptConsentRequest) validateGrantScope(formats strfmt.Registry) error { + if swag.IsZero(m.GrantScope) { // not required return nil } @@ -91,8 +89,6 @@ func (m *AcceptConsentRequest) validateGrantScope(formats strfmt.Registry) error if err := m.GrantScope.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("grant_scope") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grant_scope") } return err } @@ -101,6 +97,7 @@ func (m *AcceptConsentRequest) validateGrantScope(formats strfmt.Registry) error } func (m *AcceptConsentRequest) validateHandledAt(formats strfmt.Registry) error { + if swag.IsZero(m.HandledAt) { // not required return nil } @@ -108,8 +105,6 @@ func (m *AcceptConsentRequest) validateHandledAt(formats strfmt.Registry) error if err := m.HandledAt.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("handled_at") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("handled_at") } return err } @@ -118,6 +113,7 @@ func (m *AcceptConsentRequest) validateHandledAt(formats strfmt.Registry) error } func (m *AcceptConsentRequest) validateSession(formats strfmt.Registry) error { + if swag.IsZero(m.Session) { // not required return nil } @@ -126,92 +122,6 @@ func (m *AcceptConsentRequest) validateSession(formats strfmt.Registry) error { if err := m.Session.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("session") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("session") - } - return err - } - } - - return nil -} - -// ContextValidate validate this accept consent request based on the context it is used -func (m *AcceptConsentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGrantAccessTokenAudience(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrantScope(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateHandledAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSession(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AcceptConsentRequest) contextValidateGrantAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GrantAccessTokenAudience.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_access_token_audience") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grant_access_token_audience") - } - return err - } - - return nil -} - -func (m *AcceptConsentRequest) contextValidateGrantScope(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GrantScope.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_scope") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grant_scope") - } - return err - } - - return nil -} - -func (m *AcceptConsentRequest) contextValidateHandledAt(ctx context.Context, formats strfmt.Registry) error { - - if err := m.HandledAt.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("handled_at") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("handled_at") - } - return err - } - - return nil -} - -func (m *AcceptConsentRequest) contextValidateSession(ctx context.Context, formats strfmt.Registry) error { - - if m.Session != nil { - if err := m.Session.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("session") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("session") } return err } diff --git a/internal/httpclient/models/accept_login_request.go b/internal/httpclient/models/accept_login_request.go index 321455d25c4..023af51363d 100644 --- a/internal/httpclient/models/accept_login_request.go +++ b/internal/httpclient/models/accept_login_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -81,6 +79,7 @@ func (m *AcceptLoginRequest) Validate(formats strfmt.Registry) error { } func (m *AcceptLoginRequest) validateAmr(formats strfmt.Registry) error { + if swag.IsZero(m.Amr) { // not required return nil } @@ -88,8 +87,6 @@ func (m *AcceptLoginRequest) validateAmr(formats strfmt.Registry) error { if err := m.Amr.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("amr") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("amr") } return err } @@ -106,34 +103,6 @@ func (m *AcceptLoginRequest) validateSubject(formats strfmt.Registry) error { return nil } -// ContextValidate validate this accept login request based on the context it is used -func (m *AcceptLoginRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAmr(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AcceptLoginRequest) contextValidateAmr(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Amr.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("amr") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("amr") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *AcceptLoginRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/completed_request.go b/internal/httpclient/models/completed_request.go index 2878fd455ba..ea54e898220 100644 --- a/internal/httpclient/models/completed_request.go +++ b/internal/httpclient/models/completed_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -47,11 +45,6 @@ func (m *CompletedRequest) validateRedirectTo(formats strfmt.Registry) error { return nil } -// ContextValidate validates this completed request based on context it is used -func (m *CompletedRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *CompletedRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/consent_request.go b/internal/httpclient/models/consent_request.go index a2211401a50..ca62a4a1456 100644 --- a/internal/httpclient/models/consent_request.go +++ b/internal/httpclient/models/consent_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -106,6 +104,7 @@ func (m *ConsentRequest) Validate(formats strfmt.Registry) error { } func (m *ConsentRequest) validateAmr(formats strfmt.Registry) error { + if swag.IsZero(m.Amr) { // not required return nil } @@ -113,8 +112,6 @@ func (m *ConsentRequest) validateAmr(formats strfmt.Registry) error { if err := m.Amr.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("amr") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("amr") } return err } @@ -132,6 +129,7 @@ func (m *ConsentRequest) validateChallenge(formats strfmt.Registry) error { } func (m *ConsentRequest) validateClient(formats strfmt.Registry) error { + if swag.IsZero(m.Client) { // not required return nil } @@ -140,8 +138,6 @@ func (m *ConsentRequest) validateClient(formats strfmt.Registry) error { if err := m.Client.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("client") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("client") } return err } @@ -151,6 +147,7 @@ func (m *ConsentRequest) validateClient(formats strfmt.Registry) error { } func (m *ConsentRequest) validateOidcContext(formats strfmt.Registry) error { + if swag.IsZero(m.OidcContext) { // not required return nil } @@ -159,8 +156,6 @@ func (m *ConsentRequest) validateOidcContext(formats strfmt.Registry) error { if err := m.OidcContext.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("oidc_context") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("oidc_context") } return err } @@ -170,6 +165,7 @@ func (m *ConsentRequest) validateOidcContext(formats strfmt.Registry) error { } func (m *ConsentRequest) validateRequestedAccessTokenAudience(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedAccessTokenAudience) { // not required return nil } @@ -177,8 +173,6 @@ func (m *ConsentRequest) validateRequestedAccessTokenAudience(formats strfmt.Reg if err := m.RequestedAccessTokenAudience.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("requested_access_token_audience") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requested_access_token_audience") } return err } @@ -187,6 +181,7 @@ func (m *ConsentRequest) validateRequestedAccessTokenAudience(formats strfmt.Reg } func (m *ConsentRequest) validateRequestedScope(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedScope) { // not required return nil } @@ -194,112 +189,6 @@ func (m *ConsentRequest) validateRequestedScope(formats strfmt.Registry) error { if err := m.RequestedScope.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("requested_scope") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requested_scope") - } - return err - } - - return nil -} - -// ContextValidate validate this consent request based on the context it is used -func (m *ConsentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAmr(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateClient(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOidcContext(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedAccessTokenAudience(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedScope(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConsentRequest) contextValidateAmr(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Amr.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("amr") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("amr") - } - return err - } - - return nil -} - -func (m *ConsentRequest) contextValidateClient(ctx context.Context, formats strfmt.Registry) error { - - if m.Client != nil { - if err := m.Client.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("client") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("client") - } - return err - } - } - - return nil -} - -func (m *ConsentRequest) contextValidateOidcContext(ctx context.Context, formats strfmt.Registry) error { - - if m.OidcContext != nil { - if err := m.OidcContext.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("oidc_context") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("oidc_context") - } - return err - } - } - - return nil -} - -func (m *ConsentRequest) contextValidateRequestedAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RequestedAccessTokenAudience.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requested_access_token_audience") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requested_access_token_audience") - } - return err - } - - return nil -} - -func (m *ConsentRequest) contextValidateRequestedScope(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RequestedScope.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requested_scope") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requested_scope") } return err } diff --git a/internal/httpclient/models/consent_request_session.go b/internal/httpclient/models/consent_request_session.go index eaab7a24543..0cd2ae45dac 100644 --- a/internal/httpclient/models/consent_request_session.go +++ b/internal/httpclient/models/consent_request_session.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -33,11 +31,6 @@ func (m *ConsentRequestSession) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this consent request session based on context it is used -func (m *ConsentRequestSession) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *ConsentRequestSession) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/container_wait_o_k_body_error.go b/internal/httpclient/models/container_wait_o_k_body_error.go index 70637b4ce65..cc8113bb2a5 100644 --- a/internal/httpclient/models/container_wait_o_k_body_error.go +++ b/internal/httpclient/models/container_wait_o_k_body_error.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -26,11 +24,6 @@ func (m *ContainerWaitOKBodyError) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this container wait o k body error based on context it is used -func (m *ContainerWaitOKBodyError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *ContainerWaitOKBodyError) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go b/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go index 42c82eff485..6bd161403a9 100644 --- a/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go +++ b/internal/httpclient/models/flush_inactive_o_auth2_tokens_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -40,6 +38,7 @@ func (m *FlushInactiveOAuth2TokensRequest) Validate(formats strfmt.Registry) err } func (m *FlushInactiveOAuth2TokensRequest) validateNotAfter(formats strfmt.Registry) error { + if swag.IsZero(m.NotAfter) { // not required return nil } @@ -51,11 +50,6 @@ func (m *FlushInactiveOAuth2TokensRequest) validateNotAfter(formats strfmt.Regis return nil } -// ContextValidate validates this flush inactive o auth2 tokens request based on context it is used -func (m *FlushInactiveOAuth2TokensRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *FlushInactiveOAuth2TokensRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/health_not_ready_status.go b/internal/httpclient/models/health_not_ready_status.go index bab6d3873e8..64626783ed4 100644 --- a/internal/httpclient/models/health_not_ready_status.go +++ b/internal/httpclient/models/health_not_ready_status.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -26,11 +24,6 @@ func (m *HealthNotReadyStatus) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this health not ready status based on context it is used -func (m *HealthNotReadyStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *HealthNotReadyStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/health_status.go b/internal/httpclient/models/health_status.go index 5525dbc20ea..60ba32416b0 100644 --- a/internal/httpclient/models/health_status.go +++ b/internal/httpclient/models/health_status.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -26,11 +24,6 @@ func (m *HealthStatus) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this health status based on context it is used -func (m *HealthStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *HealthStatus) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/json_error.go b/internal/httpclient/models/json_error.go index 5bd88f6e897..9819ea3551e 100644 --- a/internal/httpclient/models/json_error.go +++ b/internal/httpclient/models/json_error.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -20,19 +18,15 @@ import ( type JSONError struct { // Name is the error name. - // Example: The requested resource could not be found Error string `json:"error,omitempty"` // Debug contains debug information. This is usually not available and has to be enabled. - // Example: The database adapter was unable to find the element ErrorDebug string `json:"error_debug,omitempty"` // Description contains further information on the nature of the error. - // Example: Object with ID 12345 does not exist ErrorDescription string `json:"error_description,omitempty"` // Code represents the error status code (404, 403, 401, ...). - // Example: 404 StatusCode int64 `json:"status_code,omitempty"` } @@ -41,11 +35,6 @@ func (m *JSONError) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this json error based on context it is used -func (m *JSONError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *JSONError) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/json_web_key.go b/internal/httpclient/models/json_web_key.go index 53f9bca2f92..737cde8d02d 100644 --- a/internal/httpclient/models/json_web_key.go +++ b/internal/httpclient/models/json_web_key.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -26,32 +24,25 @@ type JSONWebKey struct { // IANA "JSON Web Signature and Encryption Algorithms" registry // established by [JWA] or be a value that contains a Collision- // Resistant Name. - // Example: RS256 // Required: true Alg *string `json:"alg"` // crv - // Example: P-256 Crv string `json:"crv,omitempty"` // d - // Example: T_N8I-6He3M8a7X1vWt6TGIx4xB_GP3Mb4SsZSA4v-orvJzzRiQhLlRR81naWYxfQAYt5isDI6_C2L9bdWo4FFPjGQFvNoRX-_sBJyBI_rl-TBgsZYoUlAj3J92WmY2inbA-PwyJfsaIIDceYBC-eX-xiCu6qMqkZi3MwQAFL6bMdPEM0z4JBcwFT3VdiWAIRUuACWQwrXMq672x7fMuaIaHi7XDGgt1ith23CLfaREmJku9PQcchbt_uEY-hqrFY6ntTtS4paWWQj86xLL94S-Tf6v6xkL918PfLSOTq6XCzxvlFwzBJqApnAhbwqLjpPhgUG04EDRrqrSBc5Y1BLevn6Ip5h1AhessBp3wLkQgz_roeckt-ybvzKTjESMuagnpqLvOT7Y9veIug2MwPJZI2VjczRc1vzMs25XrFQ8DpUy-bNdp89TmvAXwctUMiJdgHloJw23Cv03gIUAkDnsTqZmkpbIf-crpgNKFmQP_EDKoe8p_PXZZgfbRri3NoEVGP7Mk6yEu8LjJhClhZaBNjuWw2-KlBfOA3g79mhfBnkInee5KO9mGR50qPk1V-MorUYNTFMZIm0kFE6eYVWFBwJHLKYhHU34DoiK1VP-svZpC2uAMFNA_UJEwM9CQ2b8qe4-5e9aywMvwcuArRkAB5mBIfOaOJao3mfukKAE D string `json:"d,omitempty"` // dp - // Example: G4sPXkc6Ya9y8oJW9_ILj4xuppu0lzi_H7VTkS8xj5SdX3coE0oimYwxIi2emTAue0UOa5dpgFGyBJ4c8tQ2VF402XRugKDTP8akYhFo5tAA77Qe_NmtuYZc3C3m3I24G2GvR5sSDxUyAN2zq8Lfn9EUms6rY3Ob8YeiKkTiBj0 Dp string `json:"dp,omitempty"` // dq - // Example: s9lAH9fggBsoFR8Oac2R_E2gw282rT2kGOAhvIllETE1efrA6huUUvMfBcMpn8lqeW6vzznYY5SSQF7pMdC_agI3nG8Ibp1BUb0JUiraRNqUfLhcQb_d9GF4Dh7e74WbRsobRonujTYN1xCaP6TO61jvWrX-L18txXw494Q_cgk Dq string `json:"dq,omitempty"` // e - // Example: AQAB E string `json:"e,omitempty"` // k - // Example: GawgguFyGrWKav7AX4VKUg K string `json:"k,omitempty"` // The "kid" (key ID) parameter is used to match a specific key. This @@ -63,7 +54,6 @@ type JSONWebKey struct { // they have different "kty" (key type) values but are considered to be // equivalent alternatives by the application using them.) The "kid" // value is a case-sensitive string. - // Example: 1603dfe0af8f4596 // Required: true Kid *string `json:"kid"` @@ -72,36 +62,29 @@ type JSONWebKey struct { // either be registered in the IANA "JSON Web Key Types" registry // established by [JWA] or be a value that contains a Collision- // Resistant Name. The "kty" value is a case-sensitive string. - // Example: RSA // Required: true Kty *string `json:"kty"` // n - // Example: vTqrxUyQPl_20aqf5kXHwDZrel-KovIp8s7ewJod2EXHl8tWlRB3_Rem34KwBfqlKQGp1nqah-51H4Jzruqe0cFP58hPEIt6WqrvnmJCXxnNuIB53iX_uUUXXHDHBeaPCSRoNJzNysjoJ30TIUsKBiirhBa7f235PXbKiHducLevV6PcKxJ5cY8zO286qJLBWSPm-OIevwqsIsSIH44Qtm9sioFikhkbLwoqwWORGAY0nl6XvVOlhADdLjBSqSAeT1FPuCDCnXwzCDR8N9IFB_IjdStFkC-rVt2K5BYfPd0c3yFp_vHR15eRd0zJ8XQ7woBC8Vnsac6Et1pKS59pX6256DPWu8UDdEOolKAPgcd_g2NpA76cAaF_jcT80j9KrEzw8Tv0nJBGesuCjPNjGs_KzdkWTUXt23Hn9QJsdc1MZuaW0iqXBepHYfYoqNelzVte117t4BwVp0kUM6we0IqyXClaZgOI8S-WDBw2_Ovdm8e5NmhYAblEVoygcX8Y46oH6bKiaCQfKCFDMcRgChme7AoE1yZZYsPbaG_3IjPrC4LBMHQw8rM9dWjJ8ImjicvZ1pAm0dx-KHCP3y5PVKrxBDf1zSOsBRkOSjB8TPODnJMz6-jd5hTtZxpZPwPoIdCanTZ3ZD6uRBpTmDwtpRGm63UQs1m5FWPwb0T2IF0 N string `json:"n,omitempty"` // p - // Example: 6NbkXwDWUhi-eR55Cgbf27FkQDDWIamOaDr0rj1q0f1fFEz1W5A_09YvG09Fiv1AO2-D8Rl8gS1Vkz2i0zCSqnyy8A025XOcRviOMK7nIxE4OH_PEsko8dtIrb3TmE2hUXvCkmzw9EsTF1LQBOGC6iusLTXepIC1x9ukCKFZQvdgtEObQ5kzd9Nhq-cdqmSeMVLoxPLd1blviVT9Vm8-y12CtYpeJHOaIDtVPLlBhJiBoPKWg3vxSm4XxIliNOefqegIlsmTIa3MpS6WWlCK3yHhat0Q-rRxDxdyiVdG_wzJvp0Iw_2wms7pe-PgNPYvUWH9JphWP5K38YqEBiJFXQ P string `json:"p,omitempty"` // q - // Example: 0A1FmpOWR91_RAWpqreWSavNaZb9nXeKiBo0DQGBz32DbqKqQ8S4aBJmbRhJcctjCLjain-ivut477tAUMmzJwVJDDq2MZFwC9Q-4VYZmFU4HJityQuSzHYe64RjN-E_NQ02TWhG3QGW6roq6c57c99rrUsETwJJiwS8M5p15Miuz53DaOjv-uqqFAFfywN5WkxHbraBcjHtMiQuyQbQqkCFh-oanHkwYNeytsNhTu2mQmwR5DR2roZ2nPiFjC6nsdk-A7E3S3wMzYYFw7jvbWWoYWo9vB40_MY2Y0FYQSqcDzcBIcq_0tnnasf3VW4Fdx6m80RzOb2Fsnln7vKXAQ Q string `json:"q,omitempty"` // qi - // Example: GyM_p6JrXySiz1toFgKbWV-JdI3jQ4ypu9rbMWx3rQJBfmt0FoYzgUIZEVFEcOqwemRN81zoDAaa-Bk0KWNGDjJHZDdDmFhW3AN7lI-puxk_mHZGJ11rxyR8O55XLSe3SPmRfKwZI6yU24ZxvQKFYItdldUKGzO6Ia6zTKhAVRU Qi string `json:"qi,omitempty"` // Use ("public key use") identifies the intended use of // the public key. The "use" parameter is employed to indicate whether // a public key is used for encrypting data or verifying the signature // on data. Values are commonly "sig" (signature) or "enc" (encryption). - // Example: sig // Required: true Use *string `json:"use"` // x - // Example: f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU X string `json:"x,omitempty"` // The "x5c" (X.509 certificate chain) parameter contains a chain of one @@ -114,7 +97,6 @@ type JSONWebKey struct { X5c []string `json:"x5c"` // y - // Example: x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0 Y string `json:"y,omitempty"` } @@ -180,11 +162,6 @@ func (m *JSONWebKey) validateUse(formats strfmt.Registry) error { return nil } -// ContextValidate validates this JSON web key based on context it is used -func (m *JSONWebKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *JSONWebKey) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/json_web_key_set.go b/internal/httpclient/models/json_web_key_set.go index 2ddc4d5328e..87649fa82c9 100644 --- a/internal/httpclient/models/json_web_key_set.go +++ b/internal/httpclient/models/json_web_key_set.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -46,6 +45,7 @@ func (m *JSONWebKeySet) Validate(formats strfmt.Registry) error { } func (m *JSONWebKeySet) validateKeys(formats strfmt.Registry) error { + if swag.IsZero(m.Keys) { // not required return nil } @@ -59,42 +59,6 @@ func (m *JSONWebKeySet) validateKeys(formats strfmt.Registry) error { if err := m.Keys[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("keys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keys" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this JSON web key set based on the context it is used -func (m *JSONWebKeySet) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateKeys(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *JSONWebKeySet) contextValidateKeys(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Keys); i++ { - - if m.Keys[i] != nil { - if err := m.Keys[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("keys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("keys" + "." + strconv.Itoa(i)) } return err } diff --git a/internal/httpclient/models/json_web_key_set_generator_request.go b/internal/httpclient/models/json_web_key_set_generator_request.go index 3cad47f11d8..93f447138c0 100644 --- a/internal/httpclient/models/json_web_key_set_generator_request.go +++ b/internal/httpclient/models/json_web_key_set_generator_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -19,7 +17,7 @@ import ( // swagger:model jsonWebKeySetGeneratorRequest type JSONWebKeySetGeneratorRequest struct { - // The algorithm to be used for creating the key. Supports "RS256", "ES512", "HS512", and "HS256" + // The algorithm to be used for creating the key. Supports "RS256", "ES256", "ES512", "HS512", and "HS256" // Required: true Alg *string `json:"alg"` @@ -84,11 +82,6 @@ func (m *JSONWebKeySetGeneratorRequest) validateUse(formats strfmt.Registry) err return nil } -// ContextValidate validates this json web key set generator request based on context it is used -func (m *JSONWebKeySetGeneratorRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *JSONWebKeySetGeneratorRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/login_request.go b/internal/httpclient/models/login_request.go index b30cc34b379..4cf1b2d991b 100644 --- a/internal/httpclient/models/login_request.go +++ b/internal/httpclient/models/login_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -126,8 +124,6 @@ func (m *LoginRequest) validateClient(formats strfmt.Registry) error { if err := m.Client.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("client") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("client") } return err } @@ -137,6 +133,7 @@ func (m *LoginRequest) validateClient(formats strfmt.Registry) error { } func (m *LoginRequest) validateOidcContext(formats strfmt.Registry) error { + if swag.IsZero(m.OidcContext) { // not required return nil } @@ -145,8 +142,6 @@ func (m *LoginRequest) validateOidcContext(formats strfmt.Registry) error { if err := m.OidcContext.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("oidc_context") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("oidc_context") } return err } @@ -173,8 +168,6 @@ func (m *LoginRequest) validateRequestedAccessTokenAudience(formats strfmt.Regis if err := m.RequestedAccessTokenAudience.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("requested_access_token_audience") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requested_access_token_audience") } return err } @@ -191,8 +184,6 @@ func (m *LoginRequest) validateRequestedScope(formats strfmt.Registry) error { if err := m.RequestedScope.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("requested_scope") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requested_scope") } return err } @@ -218,92 +209,6 @@ func (m *LoginRequest) validateSubject(formats strfmt.Registry) error { return nil } -// ContextValidate validate this login request based on the context it is used -func (m *LoginRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateClient(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOidcContext(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedAccessTokenAudience(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedScope(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LoginRequest) contextValidateClient(ctx context.Context, formats strfmt.Registry) error { - - if m.Client != nil { - if err := m.Client.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("client") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("client") - } - return err - } - } - - return nil -} - -func (m *LoginRequest) contextValidateOidcContext(ctx context.Context, formats strfmt.Registry) error { - - if m.OidcContext != nil { - if err := m.OidcContext.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("oidc_context") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("oidc_context") - } - return err - } - } - - return nil -} - -func (m *LoginRequest) contextValidateRequestedAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RequestedAccessTokenAudience.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requested_access_token_audience") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requested_access_token_audience") - } - return err - } - - return nil -} - -func (m *LoginRequest) contextValidateRequestedScope(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RequestedScope.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requested_scope") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requested_scope") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *LoginRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/logout_request.go b/internal/httpclient/models/logout_request.go index c3aeaf0aba2..df025037502 100644 --- a/internal/httpclient/models/logout_request.go +++ b/internal/httpclient/models/logout_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -53,6 +51,7 @@ func (m *LogoutRequest) Validate(formats strfmt.Registry) error { } func (m *LogoutRequest) validateClient(formats strfmt.Registry) error { + if swag.IsZero(m.Client) { // not required return nil } @@ -61,38 +60,6 @@ func (m *LogoutRequest) validateClient(formats strfmt.Registry) error { if err := m.Client.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("client") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("client") - } - return err - } - } - - return nil -} - -// ContextValidate validate this logout request based on the context it is used -func (m *LogoutRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateClient(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LogoutRequest) contextValidateClient(ctx context.Context, formats strfmt.Registry) error { - - if m.Client != nil { - if err := m.Client.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("client") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("client") } return err } diff --git a/internal/httpclient/models/null_time.go b/internal/httpclient/models/null_time.go index 46130d04b0b..8e2e60607ff 100644 --- a/internal/httpclient/models/null_time.go +++ b/internal/httpclient/models/null_time.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -43,11 +41,6 @@ func (m NullTime) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this null time based on context it is used -func (m NullTime) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *NullTime) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/o_auth2_client.go b/internal/httpclient/models/o_auth2_client.go index 16a74b6d15e..0324fb28bef 100644 --- a/internal/httpclient/models/o_auth2_client.go +++ b/internal/httpclient/models/o_auth2_client.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -215,6 +213,7 @@ func (m *OAuth2Client) Validate(formats strfmt.Registry) error { } func (m *OAuth2Client) validateAllowedCorsOrigins(formats strfmt.Registry) error { + if swag.IsZero(m.AllowedCorsOrigins) { // not required return nil } @@ -222,8 +221,6 @@ func (m *OAuth2Client) validateAllowedCorsOrigins(formats strfmt.Registry) error if err := m.AllowedCorsOrigins.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("allowed_cors_origins") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("allowed_cors_origins") } return err } @@ -232,6 +229,7 @@ func (m *OAuth2Client) validateAllowedCorsOrigins(formats strfmt.Registry) error } func (m *OAuth2Client) validateAudience(formats strfmt.Registry) error { + if swag.IsZero(m.Audience) { // not required return nil } @@ -239,8 +237,6 @@ func (m *OAuth2Client) validateAudience(formats strfmt.Registry) error { if err := m.Audience.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("audience") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("audience") } return err } @@ -249,6 +245,7 @@ func (m *OAuth2Client) validateAudience(formats strfmt.Registry) error { } func (m *OAuth2Client) validateContacts(formats strfmt.Registry) error { + if swag.IsZero(m.Contacts) { // not required return nil } @@ -256,8 +253,6 @@ func (m *OAuth2Client) validateContacts(formats strfmt.Registry) error { if err := m.Contacts.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("contacts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("contacts") } return err } @@ -266,6 +261,7 @@ func (m *OAuth2Client) validateContacts(formats strfmt.Registry) error { } func (m *OAuth2Client) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required return nil } @@ -278,6 +274,7 @@ func (m *OAuth2Client) validateCreatedAt(formats strfmt.Registry) error { } func (m *OAuth2Client) validateGrantTypes(formats strfmt.Registry) error { + if swag.IsZero(m.GrantTypes) { // not required return nil } @@ -285,8 +282,6 @@ func (m *OAuth2Client) validateGrantTypes(formats strfmt.Registry) error { if err := m.GrantTypes.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("grant_types") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grant_types") } return err } @@ -295,6 +290,7 @@ func (m *OAuth2Client) validateGrantTypes(formats strfmt.Registry) error { } func (m *OAuth2Client) validatePostLogoutRedirectUris(formats strfmt.Registry) error { + if swag.IsZero(m.PostLogoutRedirectUris) { // not required return nil } @@ -302,8 +298,6 @@ func (m *OAuth2Client) validatePostLogoutRedirectUris(formats strfmt.Registry) e if err := m.PostLogoutRedirectUris.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("post_logout_redirect_uris") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("post_logout_redirect_uris") } return err } @@ -312,6 +306,7 @@ func (m *OAuth2Client) validatePostLogoutRedirectUris(formats strfmt.Registry) e } func (m *OAuth2Client) validateRedirectUris(formats strfmt.Registry) error { + if swag.IsZero(m.RedirectUris) { // not required return nil } @@ -319,8 +314,6 @@ func (m *OAuth2Client) validateRedirectUris(formats strfmt.Registry) error { if err := m.RedirectUris.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("redirect_uris") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("redirect_uris") } return err } @@ -329,6 +322,7 @@ func (m *OAuth2Client) validateRedirectUris(formats strfmt.Registry) error { } func (m *OAuth2Client) validateRequestUris(formats strfmt.Registry) error { + if swag.IsZero(m.RequestUris) { // not required return nil } @@ -336,8 +330,6 @@ func (m *OAuth2Client) validateRequestUris(formats strfmt.Registry) error { if err := m.RequestUris.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("request_uris") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("request_uris") } return err } @@ -346,6 +338,7 @@ func (m *OAuth2Client) validateRequestUris(formats strfmt.Registry) error { } func (m *OAuth2Client) validateResponseTypes(formats strfmt.Registry) error { + if swag.IsZero(m.ResponseTypes) { // not required return nil } @@ -353,8 +346,6 @@ func (m *OAuth2Client) validateResponseTypes(formats strfmt.Registry) error { if err := m.ResponseTypes.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("response_types") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("response_types") } return err } @@ -363,11 +354,12 @@ func (m *OAuth2Client) validateResponseTypes(formats strfmt.Registry) error { } func (m *OAuth2Client) validateScope(formats strfmt.Registry) error { + if swag.IsZero(m.Scope) { // not required return nil } - if err := validate.Pattern("scope", "body", m.Scope, `([a-zA-Z0-9\.\*]+\s?)+`); err != nil { + if err := validate.Pattern("scope", "body", string(m.Scope), `([a-zA-Z0-9\.\*]+\s?)+`); err != nil { return err } @@ -375,6 +367,7 @@ func (m *OAuth2Client) validateScope(formats strfmt.Registry) error { } func (m *OAuth2Client) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required return nil } @@ -386,160 +379,6 @@ func (m *OAuth2Client) validateUpdatedAt(formats strfmt.Registry) error { return nil } -// ContextValidate validate this o auth2 client based on the context it is used -func (m *OAuth2Client) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAllowedCorsOrigins(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAudience(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateContacts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrantTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePostLogoutRedirectUris(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRedirectUris(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestUris(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateResponseTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OAuth2Client) contextValidateAllowedCorsOrigins(ctx context.Context, formats strfmt.Registry) error { - - if err := m.AllowedCorsOrigins.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("allowed_cors_origins") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("allowed_cors_origins") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateAudience(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Audience.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("audience") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("audience") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateContacts(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Contacts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("contacts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("contacts") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateGrantTypes(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GrantTypes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_types") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grant_types") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidatePostLogoutRedirectUris(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PostLogoutRedirectUris.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("post_logout_redirect_uris") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("post_logout_redirect_uris") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateRedirectUris(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RedirectUris.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("redirect_uris") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("redirect_uris") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateRequestUris(ctx context.Context, formats strfmt.Registry) error { - - if err := m.RequestUris.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("request_uris") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("request_uris") - } - return err - } - - return nil -} - -func (m *OAuth2Client) contextValidateResponseTypes(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ResponseTypes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("response_types") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("response_types") - } - return err - } - - return nil -} - // MarshalBinary interface implementation func (m *OAuth2Client) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/o_auth2_token_introspection.go b/internal/httpclient/models/o_auth2_token_introspection.go index a881a0d3ed2..fb97d72d935 100644 --- a/internal/httpclient/models/o_auth2_token_introspection.go +++ b/internal/httpclient/models/o_auth2_token_introspection.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -107,11 +105,6 @@ func (m *OAuth2TokenIntrospection) validateActive(formats strfmt.Registry) error return nil } -// ContextValidate validates this o auth2 token introspection based on context it is used -func (m *OAuth2TokenIntrospection) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *OAuth2TokenIntrospection) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/oauth2_token_response.go b/internal/httpclient/models/oauth2_token_response.go index 542885008fe..4aec720a00f 100644 --- a/internal/httpclient/models/oauth2_token_response.go +++ b/internal/httpclient/models/oauth2_token_response.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -41,11 +39,6 @@ func (m *Oauth2TokenResponse) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this oauth2 token response based on context it is used -func (m *Oauth2TokenResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *Oauth2TokenResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/open_id_connect_context.go b/internal/httpclient/models/open_id_connect_context.go index 398840441e0..cbfdd337e40 100644 --- a/internal/httpclient/models/open_id_connect_context.go +++ b/internal/httpclient/models/open_id_connect_context.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -61,11 +59,6 @@ func (m *OpenIDConnectContext) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this open ID connect context based on context it is used -func (m *OpenIDConnectContext) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *OpenIDConnectContext) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/patch_document.go b/internal/httpclient/models/patch_document.go index 0f8b9cac0db..fb3ea3652ef 100644 --- a/internal/httpclient/models/patch_document.go +++ b/internal/httpclient/models/patch_document.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -23,12 +21,10 @@ type PatchDocument struct { From string `json:"from,omitempty"` // The operation to be performed - // Example: \"replace\ // Required: true Op *string `json:"op"` // A JSON-pointer - // Example: \"/name\ // Required: true Path *string `json:"path"` @@ -72,11 +68,6 @@ func (m *PatchDocument) validatePath(formats strfmt.Registry) error { return nil } -// ContextValidate validates this patch document based on context it is used -func (m *PatchDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PatchDocument) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/patch_request.go b/internal/httpclient/models/patch_request.go index 774b927fe92..df227f4b73e 100644 --- a/internal/httpclient/models/patch_request.go +++ b/internal/httpclient/models/patch_request.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -32,33 +31,6 @@ func (m PatchRequest) Validate(formats strfmt.Registry) error { if err := m[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this patch request based on the context it is used -func (m PatchRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) } return err } diff --git a/internal/httpclient/models/plugin_config.go b/internal/httpclient/models/plugin_config.go index 30a610e4c39..caaeea8e7d6 100644 --- a/internal/httpclient/models/plugin_config.go +++ b/internal/httpclient/models/plugin_config.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -162,8 +161,6 @@ func (m *PluginConfig) validateArgs(formats strfmt.Registry) error { if err := m.Args.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Args") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Args") } return err } @@ -214,8 +211,6 @@ func (m *PluginConfig) validateEnv(formats strfmt.Registry) error { if err := m.Env[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Env" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Env" + "." + strconv.Itoa(i)) } return err } @@ -236,8 +231,6 @@ func (m *PluginConfig) validateInterface(formats strfmt.Registry) error { if err := m.Interface.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Interface") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Interface") } return err } @@ -265,8 +258,6 @@ func (m *PluginConfig) validateLinux(formats strfmt.Registry) error { if err := m.Linux.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Linux") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Linux") } return err } @@ -290,8 +281,6 @@ func (m *PluginConfig) validateMounts(formats strfmt.Registry) error { if err := m.Mounts[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Mounts" + "." + strconv.Itoa(i)) } return err } @@ -312,8 +301,6 @@ func (m *PluginConfig) validateNetwork(formats strfmt.Registry) error { if err := m.Network.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Network") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Network") } return err } @@ -341,6 +328,7 @@ func (m *PluginConfig) validatePropagatedMount(formats strfmt.Registry) error { } func (m *PluginConfig) validateUser(formats strfmt.Registry) error { + if swag.IsZero(m.User) { // not required return nil } @@ -349,8 +337,6 @@ func (m *PluginConfig) validateUser(formats strfmt.Registry) error { if err := m.User.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("User") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("User") } return err } @@ -369,6 +355,7 @@ func (m *PluginConfig) validateWorkDir(formats strfmt.Registry) error { } func (m *PluginConfig) validateRootfs(formats strfmt.Registry) error { + if swag.IsZero(m.Rootfs) { // not required return nil } @@ -377,186 +364,6 @@ func (m *PluginConfig) validateRootfs(formats strfmt.Registry) error { if err := m.Rootfs.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("rootfs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rootfs") - } - return err - } - } - - return nil -} - -// ContextValidate validate this plugin config based on the context it is used -func (m *PluginConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateArgs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEnv(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateInterface(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLinux(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMounts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNetwork(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUser(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRootfs(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PluginConfig) contextValidateArgs(ctx context.Context, formats strfmt.Registry) error { - - if m.Args != nil { - if err := m.Args.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Args") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Args") - } - return err - } - } - - return nil -} - -func (m *PluginConfig) contextValidateEnv(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Env); i++ { - - if m.Env[i] != nil { - if err := m.Env[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Env" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Env" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PluginConfig) contextValidateInterface(ctx context.Context, formats strfmt.Registry) error { - - if m.Interface != nil { - if err := m.Interface.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Interface") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Interface") - } - return err - } - } - - return nil -} - -func (m *PluginConfig) contextValidateLinux(ctx context.Context, formats strfmt.Registry) error { - - if m.Linux != nil { - if err := m.Linux.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Linux") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Linux") - } - return err - } - } - - return nil -} - -func (m *PluginConfig) contextValidateMounts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Mounts); i++ { - - if m.Mounts[i] != nil { - if err := m.Mounts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Mounts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PluginConfig) contextValidateNetwork(ctx context.Context, formats strfmt.Registry) error { - - if m.Network != nil { - if err := m.Network.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Network") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Network") - } - return err - } - } - - return nil -} - -func (m *PluginConfig) contextValidateUser(ctx context.Context, formats strfmt.Registry) error { - - if m.User != nil { - if err := m.User.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("User") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("User") - } - return err - } - } - - return nil -} - -func (m *PluginConfig) contextValidateRootfs(ctx context.Context, formats strfmt.Registry) error { - - if m.Rootfs != nil { - if err := m.Rootfs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("rootfs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("rootfs") } return err } diff --git a/internal/httpclient/models/plugin_config_args.go b/internal/httpclient/models/plugin_config_args.go index 15a65d6994a..053450e0ae9 100644 --- a/internal/httpclient/models/plugin_config_args.go +++ b/internal/httpclient/models/plugin_config_args.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -98,11 +96,6 @@ func (m *PluginConfigArgs) validateValue(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin config args based on context it is used -func (m *PluginConfigArgs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginConfigArgs) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_interface.go b/internal/httpclient/models/plugin_config_interface.go index de34160f9a6..43b13c30c2e 100644 --- a/internal/httpclient/models/plugin_config_interface.go +++ b/internal/httpclient/models/plugin_config_interface.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -74,42 +73,6 @@ func (m *PluginConfigInterface) validateTypes(formats strfmt.Registry) error { if err := m.Types[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Types" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Types" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this plugin config interface based on the context it is used -func (m *PluginConfigInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PluginConfigInterface) contextValidateTypes(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Types); i++ { - - if m.Types[i] != nil { - if err := m.Types[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Types" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Types" + "." + strconv.Itoa(i)) } return err } diff --git a/internal/httpclient/models/plugin_config_linux_swagger.go b/internal/httpclient/models/plugin_config_linux_swagger.go index 8a6f7884fa7..5671eb4d28a 100644 --- a/internal/httpclient/models/plugin_config_linux_swagger.go +++ b/internal/httpclient/models/plugin_config_linux_swagger.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -88,42 +87,6 @@ func (m *PluginConfigLinux) validateDevices(formats strfmt.Registry) error { if err := m.Devices[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Devices" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Devices" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this plugin config linux based on the context it is used -func (m *PluginConfigLinux) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDevices(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PluginConfigLinux) contextValidateDevices(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Devices); i++ { - - if m.Devices[i] != nil { - if err := m.Devices[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Devices" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Devices" + "." + strconv.Itoa(i)) } return err } diff --git a/internal/httpclient/models/plugin_config_network.go b/internal/httpclient/models/plugin_config_network.go index 89fb2c56807..5649fd30a9b 100644 --- a/internal/httpclient/models/plugin_config_network.go +++ b/internal/httpclient/models/plugin_config_network.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -47,11 +45,6 @@ func (m *PluginConfigNetwork) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin config network based on context it is used -func (m *PluginConfigNetwork) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginConfigNetwork) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_rootfs.go b/internal/httpclient/models/plugin_config_rootfs.go index 64d545ac12b..4497e49a3fe 100644 --- a/internal/httpclient/models/plugin_config_rootfs.go +++ b/internal/httpclient/models/plugin_config_rootfs.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -29,11 +27,6 @@ func (m *PluginConfigRootfs) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin config rootfs based on context it is used -func (m *PluginConfigRootfs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginConfigRootfs) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_config_user.go b/internal/httpclient/models/plugin_config_user.go index 610727721e9..73574d68ff6 100644 --- a/internal/httpclient/models/plugin_config_user.go +++ b/internal/httpclient/models/plugin_config_user.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -29,11 +27,6 @@ func (m *PluginConfigUser) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin config user based on context it is used -func (m *PluginConfigUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginConfigUser) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_device.go b/internal/httpclient/models/plugin_device.go index 8818e2dd71a..7a3de422abc 100644 --- a/internal/httpclient/models/plugin_device.go +++ b/internal/httpclient/models/plugin_device.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -98,11 +96,6 @@ func (m *PluginDevice) validateSettable(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin device based on context it is used -func (m *PluginDevice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginDevice) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_env.go b/internal/httpclient/models/plugin_env.go index 00c2bcc6d69..6ed6644db68 100644 --- a/internal/httpclient/models/plugin_env.go +++ b/internal/httpclient/models/plugin_env.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -98,11 +96,6 @@ func (m *PluginEnv) validateValue(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin env based on context it is used -func (m *PluginEnv) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginEnv) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_interface_type.go b/internal/httpclient/models/plugin_interface_type.go index cb3185daba1..d66549040eb 100644 --- a/internal/httpclient/models/plugin_interface_type.go +++ b/internal/httpclient/models/plugin_interface_type.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -81,11 +79,6 @@ func (m *PluginInterfaceType) validateVersion(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin interface type based on context it is used -func (m *PluginInterfaceType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginInterfaceType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_mount.go b/internal/httpclient/models/plugin_mount.go index be79d1e16bd..41eadd58191 100644 --- a/internal/httpclient/models/plugin_mount.go +++ b/internal/httpclient/models/plugin_mount.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -149,11 +147,6 @@ func (m *PluginMount) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validates this plugin mount based on context it is used -func (m *PluginMount) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *PluginMount) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/plugin_settings.go b/internal/httpclient/models/plugin_settings.go index 3300aea491a..4e7d4ba9748 100644 --- a/internal/httpclient/models/plugin_settings.go +++ b/internal/httpclient/models/plugin_settings.go @@ -6,7 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" "strconv" "github.com/go-openapi/errors" @@ -87,8 +86,6 @@ func (m *PluginSettings) validateDevices(formats strfmt.Registry) error { if err := m.Devices[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Devices" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Devices" + "." + strconv.Itoa(i)) } return err } @@ -123,66 +120,6 @@ func (m *PluginSettings) validateMounts(formats strfmt.Registry) error { if err := m.Mounts[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("Mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Mounts" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this plugin settings based on the context it is used -func (m *PluginSettings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDevices(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMounts(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PluginSettings) contextValidateDevices(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Devices); i++ { - - if m.Devices[i] != nil { - if err := m.Devices[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Devices" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Devices" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PluginSettings) contextValidateMounts(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Mounts); i++ { - - if m.Mounts[i] != nil { - if err := m.Mounts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("Mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("Mounts" + "." + strconv.Itoa(i)) } return err } diff --git a/internal/httpclient/models/previous_consent_session.go b/internal/httpclient/models/previous_consent_session.go index dd3e370498e..b0b0616f356 100644 --- a/internal/httpclient/models/previous_consent_session.go +++ b/internal/httpclient/models/previous_consent_session.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -75,6 +73,7 @@ func (m *PreviousConsentSession) Validate(formats strfmt.Registry) error { } func (m *PreviousConsentSession) validateConsentRequest(formats strfmt.Registry) error { + if swag.IsZero(m.ConsentRequest) { // not required return nil } @@ -83,8 +82,6 @@ func (m *PreviousConsentSession) validateConsentRequest(formats strfmt.Registry) if err := m.ConsentRequest.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("consent_request") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("consent_request") } return err } @@ -94,6 +91,7 @@ func (m *PreviousConsentSession) validateConsentRequest(formats strfmt.Registry) } func (m *PreviousConsentSession) validateGrantAccessTokenAudience(formats strfmt.Registry) error { + if swag.IsZero(m.GrantAccessTokenAudience) { // not required return nil } @@ -101,8 +99,6 @@ func (m *PreviousConsentSession) validateGrantAccessTokenAudience(formats strfmt if err := m.GrantAccessTokenAudience.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("grant_access_token_audience") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grant_access_token_audience") } return err } @@ -111,6 +107,7 @@ func (m *PreviousConsentSession) validateGrantAccessTokenAudience(formats strfmt } func (m *PreviousConsentSession) validateGrantScope(formats strfmt.Registry) error { + if swag.IsZero(m.GrantScope) { // not required return nil } @@ -118,8 +115,6 @@ func (m *PreviousConsentSession) validateGrantScope(formats strfmt.Registry) err if err := m.GrantScope.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("grant_scope") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grant_scope") } return err } @@ -128,6 +123,7 @@ func (m *PreviousConsentSession) validateGrantScope(formats strfmt.Registry) err } func (m *PreviousConsentSession) validateHandledAt(formats strfmt.Registry) error { + if swag.IsZero(m.HandledAt) { // not required return nil } @@ -135,8 +131,6 @@ func (m *PreviousConsentSession) validateHandledAt(formats strfmt.Registry) erro if err := m.HandledAt.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("handled_at") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("handled_at") } return err } @@ -145,6 +139,7 @@ func (m *PreviousConsentSession) validateHandledAt(formats strfmt.Registry) erro } func (m *PreviousConsentSession) validateSession(formats strfmt.Registry) error { + if swag.IsZero(m.Session) { // not required return nil } @@ -153,112 +148,6 @@ func (m *PreviousConsentSession) validateSession(formats strfmt.Registry) error if err := m.Session.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("session") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("session") - } - return err - } - } - - return nil -} - -// ContextValidate validate this previous consent session based on the context it is used -func (m *PreviousConsentSession) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConsentRequest(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrantAccessTokenAudience(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrantScope(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateHandledAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSession(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PreviousConsentSession) contextValidateConsentRequest(ctx context.Context, formats strfmt.Registry) error { - - if m.ConsentRequest != nil { - if err := m.ConsentRequest.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("consent_request") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("consent_request") - } - return err - } - } - - return nil -} - -func (m *PreviousConsentSession) contextValidateGrantAccessTokenAudience(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GrantAccessTokenAudience.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_access_token_audience") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grant_access_token_audience") - } - return err - } - - return nil -} - -func (m *PreviousConsentSession) contextValidateGrantScope(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GrantScope.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grant_scope") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grant_scope") - } - return err - } - - return nil -} - -func (m *PreviousConsentSession) contextValidateHandledAt(ctx context.Context, formats strfmt.Registry) error { - - if err := m.HandledAt.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("handled_at") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("handled_at") - } - return err - } - - return nil -} - -func (m *PreviousConsentSession) contextValidateSession(ctx context.Context, formats strfmt.Registry) error { - - if m.Session != nil { - if err := m.Session.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("session") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("session") } return err } diff --git a/internal/httpclient/models/reject_request.go b/internal/httpclient/models/reject_request.go index 42cf41b5228..37c02f35926 100644 --- a/internal/httpclient/models/reject_request.go +++ b/internal/httpclient/models/reject_request.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -43,11 +41,6 @@ func (m *RejectRequest) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this reject request based on context it is used -func (m *RejectRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *RejectRequest) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/request_was_handled_response.go b/internal/httpclient/models/request_was_handled_response.go index 5430cd2ef03..1a224f2b3e8 100644 --- a/internal/httpclient/models/request_was_handled_response.go +++ b/internal/httpclient/models/request_was_handled_response.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -47,11 +45,6 @@ func (m *RequestWasHandledResponse) validateRedirectTo(formats strfmt.Registry) return nil } -// ContextValidate validates this request was handled response based on context it is used -func (m *RequestWasHandledResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *RequestWasHandledResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/string_slice_pipe_delimiter.go b/internal/httpclient/models/string_slice_pipe_delimiter.go index 76d7a757791..c7bc80e83c0 100644 --- a/internal/httpclient/models/string_slice_pipe_delimiter.go +++ b/internal/httpclient/models/string_slice_pipe_delimiter.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" ) @@ -20,8 +18,3 @@ type StringSlicePipeDelimiter []string func (m StringSlicePipeDelimiter) Validate(formats strfmt.Registry) error { return nil } - -// ContextValidate validates this string slice pipe delimiter based on context it is used -func (m StringSlicePipeDelimiter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/internal/httpclient/models/userinfo_response.go b/internal/httpclient/models/userinfo_response.go index a78e76c3204..9b5fb8685fb 100644 --- a/internal/httpclient/models/userinfo_response.go +++ b/internal/httpclient/models/userinfo_response.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -80,11 +78,6 @@ func (m *UserinfoResponse) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this userinfo response based on context it is used -func (m *UserinfoResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *UserinfoResponse) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/version.go b/internal/httpclient/models/version.go index 2a92642e537..8e687bcb20d 100644 --- a/internal/httpclient/models/version.go +++ b/internal/httpclient/models/version.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -26,11 +24,6 @@ func (m *Version) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this version based on context it is used -func (m *Version) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *Version) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/volume.go b/internal/httpclient/models/volume.go index 45f6ce7bae6..d777e291958 100644 --- a/internal/httpclient/models/volume.go +++ b/internal/httpclient/models/volume.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -108,10 +106,6 @@ func (m *Volume) validateDriver(formats strfmt.Registry) error { func (m *Volume) validateLabels(formats strfmt.Registry) error { - if err := validate.Required("Labels", "body", m.Labels); err != nil { - return err - } - return nil } @@ -135,10 +129,6 @@ func (m *Volume) validateName(formats strfmt.Registry) error { func (m *Volume) validateOptions(formats strfmt.Registry) error { - if err := validate.Required("Options", "body", m.Options); err != nil { - return err - } - return nil } @@ -152,6 +142,7 @@ func (m *Volume) validateScope(formats strfmt.Registry) error { } func (m *Volume) validateUsageData(formats strfmt.Registry) error { + if swag.IsZero(m.UsageData) { // not required return nil } @@ -160,38 +151,6 @@ func (m *Volume) validateUsageData(formats strfmt.Registry) error { if err := m.UsageData.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("UsageData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("UsageData") - } - return err - } - } - - return nil -} - -// ContextValidate validate this volume based on the context it is used -func (m *Volume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUsageData(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Volume) contextValidateUsageData(ctx context.Context, formats strfmt.Registry) error { - - if m.UsageData != nil { - if err := m.UsageData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("UsageData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("UsageData") } return err } diff --git a/internal/httpclient/models/volume_usage_data.go b/internal/httpclient/models/volume_usage_data.go index bfae17367cf..886190c490b 100644 --- a/internal/httpclient/models/volume_usage_data.go +++ b/internal/httpclient/models/volume_usage_data.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -69,11 +67,6 @@ func (m *VolumeUsageData) validateSize(formats strfmt.Registry) error { return nil } -// ContextValidate validates this volume usage data based on context it is used -func (m *VolumeUsageData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *VolumeUsageData) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/internal/httpclient/models/well_known.go b/internal/httpclient/models/well_known.go index d06e5d74034..7641cc66a44 100644 --- a/internal/httpclient/models/well_known.go +++ b/internal/httpclient/models/well_known.go @@ -6,8 +6,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "context" - "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" @@ -23,7 +21,6 @@ import ( type WellKnown struct { // URL of the OP's OAuth 2.0 Authorization Endpoint. - // Example: https://playground.ory.sh/ory-hydra/public/oauth2/auth // Required: true AuthorizationEndpoint *string `json:"authorization_endpoint"` @@ -67,7 +64,6 @@ type WellKnown struct { // URL using the https scheme with no query or fragment component that the OP asserts as its IssuerURL Identifier. // If IssuerURL discovery is supported , this value MUST be identical to the issuer value returned // by WebFinger. This also MUST be identical to the iss Claim value in ID Tokens issued from this IssuerURL. - // Example: https://playground.ory.sh/ory-hydra/public/ // Required: true Issuer *string `json:"issuer"` @@ -78,12 +74,10 @@ type WellKnown struct { // Although some algorithms allow the same key to be used for both signatures and encryption, doing so is // NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509 representations of // keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate. - // Example: https://playground.ory.sh/ory-hydra/public/.well-known/jwks.json // Required: true JwksURI *string `json:"jwks_uri"` // URL of the OP's Dynamic Client Registration Endpoint. - // Example: https://playground.ory.sh/ory-hydra/admin/client RegistrationEndpoint string `json:"registration_endpoint,omitempty"` // JSON array containing a list of the JWS signing algorithms (alg values) supported by the OP for Request Objects, @@ -123,7 +117,6 @@ type WellKnown struct { SubjectTypesSupported []string `json:"subject_types_supported"` // URL of the OP's OAuth 2.0 Token Endpoint - // Example: https://playground.ory.sh/ory-hydra/public/oauth2/token // Required: true TokenEndpoint *string `json:"token_endpoint"` @@ -239,11 +232,6 @@ func (m *WellKnown) validateTokenEndpoint(formats strfmt.Registry) error { return nil } -// ContextValidate validates this well known based on context it is used -func (m *WellKnown) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - // MarshalBinary interface implementation func (m *WellKnown) MarshalBinary() ([]byte, error) { if m == nil {