diff --git a/examples/authenticated-api/echo/api/api.gen.go b/examples/authenticated-api/echo/api/api.gen.go index e3c5d2591a..ab063c2b77 100644 --- a/examples/authenticated-api/echo/api/api.gen.go +++ b/examples/authenticated-api/echo/api/api.gen.go @@ -50,7 +50,7 @@ type bearerAuthContextKey string // AddThingJSONRequestBody defines body for AddThing for application/json ContentType. type AddThingJSONRequestBody = Thing -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -123,15 +123,23 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // ListThings request + + // ListThings performs a GET /things (the `ListThings` operationId) request. + ListThings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // AddThingWithBody request with any body + // AddThingWithBody performs a POST /things (the `AddThing` operationId) request, + // with any type of body and a specified content type. + AddThingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // AddThing performs a POST /things (the `AddThing` operationId) request, + // Takes a body for the `application/json` content type. AddThing(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// ListThings performs a GET /things (the `ListThings` operationId) request. + func (c *Client) ListThings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListThingsRequest(c.Server) if err != nil { @@ -144,6 +152,9 @@ func (c *Client) ListThings(ctx context.Context, reqEditors ...RequestEditorFn) return c.Client.Do(req) } +// AddThingWithBody performs a POST /things (the `AddThing` operationId) request, +// with any type of body and a specified content type. + func (c *Client) AddThingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAddThingRequestWithBody(c.Server, contentType, body) if err != nil { @@ -156,6 +167,8 @@ func (c *Client) AddThingWithBody(ctx context.Context, contentType string, body return c.Client.Do(req) } +// AddThing performs a POST /things (the `AddThing` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) AddThing(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAddThingRequest(c.Server, body) if err != nil { @@ -168,7 +181,7 @@ func (c *Client) AddThing(ctx context.Context, body AddThingJSONRequestBody, req return c.Client.Do(req) } -// NewListThingsRequest generates requests for ListThings +// NewListThingsRequest constructs an http.Request for the ListThings method func NewListThingsRequest(server string) (*http.Request, error) { var err error @@ -206,7 +219,7 @@ func NewAddThingRequest(server string, body AddThingJSONRequestBody) (*http.Requ return NewAddThingRequestWithBody(server, "application/json", bodyReader) } -// NewAddThingRequestWithBody generates requests for AddThing with any type of body +// NewAddThingRequestWithBody constructs an http.Request for the AddThing method, with any body, and a specified content type func NewAddThingRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -278,12 +291,22 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // ListThingsWithResponse request + + // ListThingsWithResponse performs a GET /things (the `ListThings` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ListThingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListThingsResponse, error) - // AddThingWithBodyWithResponse request with any body + // AddThingWithBodyWithResponse performs a POST /things (the `AddThing` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + AddThingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddThingResponse, error) + // AddThingWithResponse performs a POST /things (the `AddThing` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). AddThingWithResponse(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*AddThingResponse, error) } @@ -293,7 +316,7 @@ type ListThingsResponse struct { JSON200 *[]ThingWithID } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ListThingsResponse) GetJSON200() *[]ThingWithID { return r.JSON200 } @@ -333,7 +356,7 @@ type AddThingResponse struct { JSON201 *[]ThingWithID } -// GetJSON201 returns JSON201 +// GetJSON201 returns the response for an HTTP 201 `application/json` response func (r AddThingResponse) GetJSON201() *[]ThingWithID { return r.JSON201 } @@ -367,7 +390,10 @@ func (r AddThingResponse) ContentType() string { return "" } -// ListThingsWithResponse request returning *ListThingsResponse +// ListThingsWithResponse performs a GET /things (the `ListThings` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) ListThingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListThingsResponse, error) { rsp, err := c.ListThings(ctx, reqEditors...) if err != nil { @@ -376,7 +402,11 @@ func (c *ClientWithResponses) ListThingsWithResponse(ctx context.Context, reqEdi return ParseListThingsResponse(rsp) } -// AddThingWithBodyWithResponse request with arbitrary body returning *AddThingResponse +// AddThingWithBodyWithResponse performs a POST /things (the `AddThing` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) AddThingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddThingResponse, error) { rsp, err := c.AddThingWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -385,6 +415,8 @@ func (c *ClientWithResponses) AddThingWithBodyWithResponse(ctx context.Context, return ParseAddThingResponse(rsp) } +// AddThingWithResponse performs a POST /things (the `AddThing` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) AddThingWithResponse(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*AddThingResponse, error) { rsp, err := c.AddThing(ctx, body, reqEditors...) if err != nil { diff --git a/examples/authenticated-api/stdhttp/api/api.gen.go b/examples/authenticated-api/stdhttp/api/api.gen.go index 979cd32020..3549608396 100644 --- a/examples/authenticated-api/stdhttp/api/api.gen.go +++ b/examples/authenticated-api/stdhttp/api/api.gen.go @@ -51,7 +51,7 @@ type bearerAuthContextKey string // AddThingJSONRequestBody defines body for AddThing for application/json ContentType. type AddThingJSONRequestBody = Thing -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -124,15 +124,23 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // ListThings request + + // ListThings performs a GET /things (the `ListThings` operationId) request. + ListThings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // AddThingWithBody request with any body + // AddThingWithBody performs a POST /things (the `AddThing` operationId) request, + // with any type of body and a specified content type. + AddThingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // AddThing performs a POST /things (the `AddThing` operationId) request, + // Takes a body for the `application/json` content type. AddThing(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// ListThings performs a GET /things (the `ListThings` operationId) request. + func (c *Client) ListThings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListThingsRequest(c.Server) if err != nil { @@ -145,6 +153,9 @@ func (c *Client) ListThings(ctx context.Context, reqEditors ...RequestEditorFn) return c.Client.Do(req) } +// AddThingWithBody performs a POST /things (the `AddThing` operationId) request, +// with any type of body and a specified content type. + func (c *Client) AddThingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAddThingRequestWithBody(c.Server, contentType, body) if err != nil { @@ -157,6 +168,8 @@ func (c *Client) AddThingWithBody(ctx context.Context, contentType string, body return c.Client.Do(req) } +// AddThing performs a POST /things (the `AddThing` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) AddThing(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAddThingRequest(c.Server, body) if err != nil { @@ -169,7 +182,7 @@ func (c *Client) AddThing(ctx context.Context, body AddThingJSONRequestBody, req return c.Client.Do(req) } -// NewListThingsRequest generates requests for ListThings +// NewListThingsRequest constructs an http.Request for the ListThings method func NewListThingsRequest(server string) (*http.Request, error) { var err error @@ -207,7 +220,7 @@ func NewAddThingRequest(server string, body AddThingJSONRequestBody) (*http.Requ return NewAddThingRequestWithBody(server, "application/json", bodyReader) } -// NewAddThingRequestWithBody generates requests for AddThing with any type of body +// NewAddThingRequestWithBody constructs an http.Request for the AddThing method, with any body, and a specified content type func NewAddThingRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -279,12 +292,22 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // ListThingsWithResponse request + + // ListThingsWithResponse performs a GET /things (the `ListThings` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ListThingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListThingsResponse, error) - // AddThingWithBodyWithResponse request with any body + // AddThingWithBodyWithResponse performs a POST /things (the `AddThing` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + AddThingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddThingResponse, error) + // AddThingWithResponse performs a POST /things (the `AddThing` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). AddThingWithResponse(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*AddThingResponse, error) } @@ -294,7 +317,7 @@ type ListThingsResponse struct { JSON200 *[]ThingWithID } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ListThingsResponse) GetJSON200() *[]ThingWithID { return r.JSON200 } @@ -334,7 +357,7 @@ type AddThingResponse struct { JSON201 *[]ThingWithID } -// GetJSON201 returns JSON201 +// GetJSON201 returns the response for an HTTP 201 `application/json` response func (r AddThingResponse) GetJSON201() *[]ThingWithID { return r.JSON201 } @@ -368,7 +391,10 @@ func (r AddThingResponse) ContentType() string { return "" } -// ListThingsWithResponse request returning *ListThingsResponse +// ListThingsWithResponse performs a GET /things (the `ListThings` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) ListThingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListThingsResponse, error) { rsp, err := c.ListThings(ctx, reqEditors...) if err != nil { @@ -377,7 +403,11 @@ func (c *ClientWithResponses) ListThingsWithResponse(ctx context.Context, reqEdi return ParseListThingsResponse(rsp) } -// AddThingWithBodyWithResponse request with arbitrary body returning *AddThingResponse +// AddThingWithBodyWithResponse performs a POST /things (the `AddThing` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) AddThingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddThingResponse, error) { rsp, err := c.AddThingWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -386,6 +416,8 @@ func (c *ClientWithResponses) AddThingWithBodyWithResponse(ctx context.Context, return ParseAddThingResponse(rsp) } +// AddThingWithResponse performs a POST /things (the `AddThing` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) AddThingWithResponse(ctx context.Context, body AddThingJSONRequestBody, reqEditors ...RequestEditorFn) (*AddThingResponse, error) { rsp, err := c.AddThing(ctx, body, reqEditors...) if err != nil { diff --git a/examples/client/client.gen.go b/examples/client/client.gen.go index 430496de89..bd5cb45bd9 100644 --- a/examples/client/client.gen.go +++ b/examples/client/client.gen.go @@ -18,7 +18,7 @@ type ClientType struct { Name string `json:"name"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -91,13 +91,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetClient request + + // GetClient performs a GET /client (the `GetClient` operationId) request. + GetClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // UpdateClient request + // UpdateClient performs a PUT /client (the `UpdateClient` operationId) request. + UpdateClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetClient performs a GET /client (the `GetClient` operationId) request. + func (c *Client) GetClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetClientRequest(c.Server) if err != nil { @@ -110,6 +115,8 @@ func (c *Client) GetClient(ctx context.Context, reqEditors ...RequestEditorFn) ( return c.Client.Do(req) } +// UpdateClient performs a PUT /client (the `UpdateClient` operationId) request. + func (c *Client) UpdateClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateClientRequest(c.Server) if err != nil { @@ -122,7 +129,7 @@ func (c *Client) UpdateClient(ctx context.Context, reqEditors ...RequestEditorFn return c.Client.Do(req) } -// NewGetClientRequest generates requests for GetClient +// NewGetClientRequest constructs an http.Request for the GetClient method func NewGetClientRequest(server string) (*http.Request, error) { var err error @@ -149,7 +156,7 @@ func NewGetClientRequest(server string) (*http.Request, error) { return req, nil } -// NewUpdateClientRequest generates requests for UpdateClient +// NewUpdateClientRequest constructs an http.Request for the UpdateClient method func NewUpdateClientRequest(server string) (*http.Request, error) { var err error @@ -219,10 +226,17 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetClientWithResponse request + + // GetClientWithResponse performs a GET /client (the `GetClient` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetClientResponse, error) - // UpdateClientWithResponse request + // UpdateClientWithResponse performs a PUT /client (the `UpdateClient` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + UpdateClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*UpdateClientResponse, error) } @@ -232,7 +246,7 @@ type GetClientResponse struct { JSON200 *ClientType } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetClientResponse) GetJSON200() *ClientType { return r.JSON200 } @@ -274,7 +288,7 @@ type UpdateClientResponse struct { } } -// GetJSON400 returns JSON400 +// GetJSON400 returns the response for an HTTP 400 `application/json` response func (r UpdateClientResponse) GetJSON400() *struct { Code string `json:"code"` } { @@ -310,7 +324,10 @@ func (r UpdateClientResponse) ContentType() string { return "" } -// GetClientWithResponse request returning *GetClientResponse +// GetClientWithResponse performs a GET /client (the `GetClient` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetClientResponse, error) { rsp, err := c.GetClient(ctx, reqEditors...) if err != nil { @@ -319,7 +336,10 @@ func (c *ClientWithResponses) GetClientWithResponse(ctx context.Context, reqEdit return ParseGetClientResponse(rsp) } -// UpdateClientWithResponse request returning *UpdateClientResponse +// UpdateClientWithResponse performs a PUT /client (the `UpdateClient` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) UpdateClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*UpdateClientResponse, error) { rsp, err := c.UpdateClient(ctx, reqEditors...) if err != nil { diff --git a/examples/clienttypenameclash/client.gen.go b/examples/clienttypenameclash/client.gen.go index 99ab3e36a2..f759fc9855 100644 --- a/examples/clienttypenameclash/client.gen.go +++ b/examples/clienttypenameclash/client.gen.go @@ -18,7 +18,7 @@ type UpdateClientResponse struct { Name string `json:"name"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -91,10 +91,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // UpdateClient request + + // UpdateClient performs a PUT /client (the `UpdateClient` operationId) request. + UpdateClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// UpdateClient performs a PUT /client (the `UpdateClient` operationId) request. + func (c *Client) UpdateClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateClientRequest(c.Server) if err != nil { @@ -107,7 +111,7 @@ func (c *Client) UpdateClient(ctx context.Context, reqEditors ...RequestEditorFn return c.Client.Do(req) } -// NewUpdateClientRequest generates requests for UpdateClient +// NewUpdateClientRequest constructs an http.Request for the UpdateClient method func NewUpdateClientRequest(server string) (*http.Request, error) { var err error @@ -177,7 +181,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // UpdateClientWithResponse request + + // UpdateClientWithResponse performs a PUT /client (the `UpdateClient` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + UpdateClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*UpdateClientResp, error) } @@ -187,7 +195,7 @@ type UpdateClientResp struct { JSON400 *UpdateClientResponse } -// GetJSON400 returns JSON400 +// GetJSON400 returns the response for an HTTP 400 `application/json` response func (r UpdateClientResp) GetJSON400() *UpdateClientResponse { return r.JSON400 } @@ -221,7 +229,10 @@ func (r UpdateClientResp) ContentType() string { return "" } -// UpdateClientWithResponse request returning *UpdateClientResp +// UpdateClientWithResponse performs a PUT /client (the `UpdateClient` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) UpdateClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*UpdateClientResp, error) { rsp, err := c.UpdateClient(ctx, reqEditors...) if err != nil { diff --git a/examples/custom-client-type/custom-client-type.gen.go b/examples/custom-client-type/custom-client-type.gen.go index adbb290453..8866c69d8b 100644 --- a/examples/custom-client-type/custom-client-type.gen.go +++ b/examples/custom-client-type/custom-client-type.gen.go @@ -18,7 +18,7 @@ type Client struct { Name string `json:"name"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -91,10 +91,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetClient request + + // GetClient performs a GET /client (the `GetClient` operationId) request. + GetClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetClient performs a GET /client (the `GetClient` operationId) request. + func (c *CustomClientType) GetClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetClientRequest(c.Server) if err != nil { @@ -107,7 +111,7 @@ func (c *CustomClientType) GetClient(ctx context.Context, reqEditors ...RequestE return c.Client.Do(req) } -// NewGetClientRequest generates requests for GetClient +// NewGetClientRequest constructs an http.Request for the GetClient method func NewGetClientRequest(server string) (*http.Request, error) { var err error @@ -177,7 +181,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetClientWithResponse request + + // GetClientWithResponse performs a GET /client (the `GetClient` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetClientResponse, error) } @@ -187,7 +195,7 @@ type GetClientResponse struct { JSON200 *Client } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetClientResponse) GetJSON200() *Client { return r.JSON200 } @@ -221,7 +229,10 @@ func (r GetClientResponse) ContentType() string { return "" } -// GetClientWithResponse request returning *GetClientResponse +// GetClientWithResponse performs a GET /client (the `GetClient` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetClientResponse, error) { rsp, err := c.GetClient(ctx, reqEditors...) if err != nil { diff --git a/examples/import-mapping/multiplepackages/admin/server.gen.go b/examples/import-mapping/multiplepackages/admin/server.gen.go index 3235142110..ba4869f151 100644 --- a/examples/import-mapping/multiplepackages/admin/server.gen.go +++ b/examples/import-mapping/multiplepackages/admin/server.gen.go @@ -14,7 +14,7 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Get a user's details + // GetUserById Get a user's details // (GET /admin/user/{id}) GetUserById(w http.ResponseWriter, r *http.Request, id openapi_types.UUID) } @@ -23,7 +23,7 @@ type ServerInterface interface { type Unimplemented struct{} -// Get a user's details +// GetUserById Get a user's details // (GET /admin/user/{id}) func (_ Unimplemented) GetUserById(w http.ResponseWriter, r *http.Request, id openapi_types.UUID) { w.WriteHeader(http.StatusNotImplemented) diff --git a/examples/import-mapping/samepackage/server.gen.go b/examples/import-mapping/samepackage/server.gen.go index 22710b98d8..f0dd6d85bf 100644 --- a/examples/import-mapping/samepackage/server.gen.go +++ b/examples/import-mapping/samepackage/server.gen.go @@ -17,7 +17,7 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Get a user's details + // GetUserById Get a user's details // (GET /admin/user/{id}) GetUserById(w http.ResponseWriter, r *http.Request, id openapi_types.UUID) } @@ -26,7 +26,7 @@ type ServerInterface interface { type Unimplemented struct{} -// Get a user's details +// GetUserById Get a user's details // (GET /admin/user/{id}) func (_ Unimplemented) GetUserById(w http.ResponseWriter, r *http.Request, id openapi_types.UUID) { w.WriteHeader(http.StatusNotImplemented) @@ -211,7 +211,7 @@ func (response GetUserById200JSONResponse) VisitGetUserByIdResponse(w http.Respo // StrictServerInterface represents all server handlers. type StrictServerInterface interface { - // Get a user's details + // GetUserById Get a user's details // (GET /admin/user/{id}) GetUserById(ctx context.Context, request GetUserByIdRequestObject) (GetUserByIdResponseObject, error) } diff --git a/examples/petstore-expanded/chi/api/petstore.gen.go b/examples/petstore-expanded/chi/api/petstore.gen.go index 338c39e73f..b2894b3228 100644 --- a/examples/petstore-expanded/chi/api/petstore.gen.go +++ b/examples/petstore-expanded/chi/api/petstore.gen.go @@ -63,16 +63,16 @@ type AddPetJSONRequestBody = NewPet // ServerInterface represents all server handlers. type ServerInterface interface { - // Returns all pets + // FindPets Returns all pets // (GET /pets) FindPets(w http.ResponseWriter, r *http.Request, params FindPetsParams) - // Creates a new pet + // AddPet Creates a new pet // (POST /pets) AddPet(w http.ResponseWriter, r *http.Request) - // Deletes a pet by ID + // DeletePet Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(w http.ResponseWriter, r *http.Request, id int64) - // Returns a pet by ID + // FindPetByID Returns a pet by ID // (GET /pets/{id}) FindPetByID(w http.ResponseWriter, r *http.Request, id int64) } @@ -81,25 +81,25 @@ type ServerInterface interface { type Unimplemented struct{} -// Returns all pets +// FindPets Returns all pets // (GET /pets) func (_ Unimplemented) FindPets(w http.ResponseWriter, r *http.Request, params FindPetsParams) { w.WriteHeader(http.StatusNotImplemented) } -// Creates a new pet +// AddPet Creates a new pet // (POST /pets) func (_ Unimplemented) AddPet(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } -// Deletes a pet by ID +// DeletePet Deletes a pet by ID // (DELETE /pets/{id}) func (_ Unimplemented) DeletePet(w http.ResponseWriter, r *http.Request, id int64) { w.WriteHeader(http.StatusNotImplemented) } -// Returns a pet by ID +// FindPetByID Returns a pet by ID // (GET /pets/{id}) func (_ Unimplemented) FindPetByID(w http.ResponseWriter, r *http.Request, id int64) { w.WriteHeader(http.StatusNotImplemented) diff --git a/examples/petstore-expanded/echo-v5/api/petstore-server.gen.go b/examples/petstore-expanded/echo-v5/api/petstore-server.gen.go index 557c96abf5..c2d46ce196 100644 --- a/examples/petstore-expanded/echo-v5/api/petstore-server.gen.go +++ b/examples/petstore-expanded/echo-v5/api/petstore-server.gen.go @@ -21,16 +21,16 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Returns all pets + // FindPets Returns all pets // (GET /pets) FindPets(ctx *echo.Context, params FindPetsParams) error - // Creates a new pet + // AddPet Creates a new pet // (POST /pets) AddPet(ctx *echo.Context) error - // Deletes a pet by ID + // DeletePet Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(ctx *echo.Context, id int64) error - // Returns a pet by ID + // FindPetByID Returns a pet by ID // (GET /pets/{id}) FindPetByID(ctx *echo.Context, id int64) error } diff --git a/examples/petstore-expanded/echo/api/petstore-server.gen.go b/examples/petstore-expanded/echo/api/petstore-server.gen.go index 8a65c64304..c06f99f202 100644 --- a/examples/petstore-expanded/echo/api/petstore-server.gen.go +++ b/examples/petstore-expanded/echo/api/petstore-server.gen.go @@ -21,16 +21,16 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Returns all pets + // FindPets Returns all pets // (GET /pets) FindPets(ctx echo.Context, params FindPetsParams) error - // Creates a new pet + // AddPet Creates a new pet // (POST /pets) AddPet(ctx echo.Context) error - // Deletes a pet by ID + // DeletePet Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(ctx echo.Context, id int64) error - // Returns a pet by ID + // FindPetByID Returns a pet by ID // (GET /pets/{id}) FindPetByID(ctx echo.Context, id int64) error } diff --git a/examples/petstore-expanded/echo/pkg_codegen_petstore_test.go b/examples/petstore-expanded/echo/pkg_codegen_petstore_test.go index 1f13ce4784..2cb4ad3cbf 100644 --- a/examples/petstore-expanded/echo/pkg_codegen_petstore_test.go +++ b/examples/petstore-expanded/echo/pkg_codegen_petstore_test.go @@ -60,7 +60,7 @@ func TestExamplePetStoreCodeGeneration(t *testing.T) { assert.Contains(t, code, "// Id Unique id of the pet") // Check that the summary comment contains newlines - assert.Contains(t, code, `// Deletes a pet by ID + assert.Contains(t, code, `// DeletePet Deletes a pet by ID // (DELETE /pets/{id}) `) diff --git a/examples/petstore-expanded/fiber/api/petstore-server.gen.go b/examples/petstore-expanded/fiber/api/petstore-server.gen.go index fe76a2fba4..e0141c08ca 100644 --- a/examples/petstore-expanded/fiber/api/petstore-server.gen.go +++ b/examples/petstore-expanded/fiber/api/petstore-server.gen.go @@ -19,16 +19,16 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Returns all pets + // FindPets Returns all pets // (GET /pets) FindPets(c *fiber.Ctx, params FindPetsParams) error - // Creates a new pet + // AddPet Creates a new pet // (POST /pets) AddPet(c *fiber.Ctx) error - // Deletes a pet by ID + // DeletePet Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(c *fiber.Ctx, id int64) error - // Returns a pet by ID + // FindPetByID Returns a pet by ID // (GET /pets/{id}) FindPetByID(c *fiber.Ctx, id int64) error } diff --git a/examples/petstore-expanded/gin/api/petstore-server.gen.go b/examples/petstore-expanded/gin/api/petstore-server.gen.go index 4a2d6f9e5c..fb23730304 100644 --- a/examples/petstore-expanded/gin/api/petstore-server.gen.go +++ b/examples/petstore-expanded/gin/api/petstore-server.gen.go @@ -20,16 +20,16 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Returns all pets + // FindPets Returns all pets // (GET /pets) FindPets(c *gin.Context, params FindPetsParams) - // Creates a new pet + // AddPet Creates a new pet // (POST /pets) AddPet(c *gin.Context) - // Deletes a pet by ID + // DeletePet Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(c *gin.Context, id int64) - // Returns a pet by ID + // FindPetByID Returns a pet by ID // (GET /pets/{id}) FindPetByID(c *gin.Context, id int64) } diff --git a/examples/petstore-expanded/gorilla/api/petstore.gen.go b/examples/petstore-expanded/gorilla/api/petstore.gen.go index 3ed8b4c27e..9c6941918c 100644 --- a/examples/petstore-expanded/gorilla/api/petstore.gen.go +++ b/examples/petstore-expanded/gorilla/api/petstore.gen.go @@ -63,16 +63,16 @@ type AddPetJSONRequestBody = NewPet // ServerInterface represents all server handlers. type ServerInterface interface { - // Returns all pets + // FindPets Returns all pets // (GET /pets) FindPets(w http.ResponseWriter, r *http.Request, params FindPetsParams) - // Creates a new pet + // AddPet Creates a new pet // (POST /pets) AddPet(w http.ResponseWriter, r *http.Request) - // Deletes a pet by ID + // DeletePet Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(w http.ResponseWriter, r *http.Request, id int64) - // Returns a pet by ID + // FindPetByID Returns a pet by ID // (GET /pets/{id}) FindPetByID(w http.ResponseWriter, r *http.Request, id int64) } diff --git a/examples/petstore-expanded/iris/api/petstore-server.gen.go b/examples/petstore-expanded/iris/api/petstore-server.gen.go index f5bcd2cb29..f80b7520e5 100644 --- a/examples/petstore-expanded/iris/api/petstore-server.gen.go +++ b/examples/petstore-expanded/iris/api/petstore-server.gen.go @@ -20,16 +20,16 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Returns all pets + // FindPets Returns all pets // (GET /pets) FindPets(ctx iris.Context, params FindPetsParams) - // Creates a new pet + // AddPet Creates a new pet // (POST /pets) AddPet(ctx iris.Context) - // Deletes a pet by ID + // DeletePet Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(ctx iris.Context, id int64) - // Returns a pet by ID + // FindPetByID Returns a pet by ID // (GET /pets/{id}) FindPetByID(ctx iris.Context, id int64) } diff --git a/examples/petstore-expanded/petstore-client.gen.go b/examples/petstore-expanded/petstore-client.gen.go index 0b77852791..15dd441e3c 100644 --- a/examples/petstore-expanded/petstore-client.gen.go +++ b/examples/petstore-expanded/petstore-client.gen.go @@ -58,7 +58,7 @@ type FindPetsParams struct { // AddPetJSONRequestBody defines body for AddPet for application/json ContentType. type AddPetJSONRequestBody = NewPet -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -131,21 +131,45 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // FindPets request + + // FindPets Returns all pets + // + // Corresponds with GET /pets (the `FindPets` operationId). + FindPets(ctx context.Context, params *FindPetsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // AddPetWithBody request with any body + // AddPetWithBody Creates a new pet + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /pets (the `AddPet` operationId). + AddPetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // AddPet Creates a new pet + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /pets (the `AddPet` operationId). AddPet(ctx context.Context, body AddPetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeletePet request + // DeletePet Deletes a pet by ID + // + // Corresponds with DELETE /pets/{id} (the `DeletePet` operationId). + DeletePet(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error) - // FindPetByID request + // FindPetByID Returns a pet by ID + // + // Corresponds with GET /pets/{id} (the `FindPetByID` operationId). + FindPetByID(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error) } +// FindPets Returns all pets +// +// Corresponds with GET /pets (the `FindPets` operationId). + func (c *Client) FindPets(ctx context.Context, params *FindPetsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewFindPetsRequest(c.Server, params) if err != nil { @@ -158,6 +182,12 @@ func (c *Client) FindPets(ctx context.Context, params *FindPetsParams, reqEditor return c.Client.Do(req) } +// AddPetWithBody Creates a new pet +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /pets (the `AddPet` operationId). + func (c *Client) AddPetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAddPetRequestWithBody(c.Server, contentType, body) if err != nil { @@ -170,6 +200,11 @@ func (c *Client) AddPetWithBody(ctx context.Context, contentType string, body io return c.Client.Do(req) } +// AddPet Creates a new pet +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /pets (the `AddPet` operationId). func (c *Client) AddPet(ctx context.Context, body AddPetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAddPetRequest(c.Server, body) if err != nil { @@ -182,6 +217,10 @@ func (c *Client) AddPet(ctx context.Context, body AddPetJSONRequestBody, reqEdit return c.Client.Do(req) } +// DeletePet Deletes a pet by ID +// +// Corresponds with DELETE /pets/{id} (the `DeletePet` operationId). + func (c *Client) DeletePet(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeletePetRequest(c.Server, id) if err != nil { @@ -194,6 +233,10 @@ func (c *Client) DeletePet(ctx context.Context, id int64, reqEditors ...RequestE return c.Client.Do(req) } +// FindPetByID Returns a pet by ID +// +// Corresponds with GET /pets/{id} (the `FindPetByID` operationId). + func (c *Client) FindPetByID(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewFindPetByIDRequest(c.Server, id) if err != nil { @@ -206,7 +249,7 @@ func (c *Client) FindPetByID(ctx context.Context, id int64, reqEditors ...Reques return c.Client.Do(req) } -// NewFindPetsRequest generates requests for FindPets +// NewFindPetsRequest constructs an http.Request for the FindPets method func NewFindPetsRequest(server string, params *FindPetsParams) (*http.Request, error) { var err error @@ -283,7 +326,7 @@ func NewAddPetRequest(server string, body AddPetJSONRequestBody) (*http.Request, return NewAddPetRequestWithBody(server, "application/json", bodyReader) } -// NewAddPetRequestWithBody generates requests for AddPet with any type of body +// NewAddPetRequestWithBody constructs an http.Request for the AddPet method, with any body, and a specified content type func NewAddPetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -312,7 +355,7 @@ func NewAddPetRequestWithBody(server string, contentType string, body io.Reader) return req, nil } -// NewDeletePetRequest generates requests for DeletePet +// NewDeletePetRequest constructs an http.Request for the DeletePet method func NewDeletePetRequest(server string, id int64) (*http.Request, error) { var err error @@ -346,7 +389,7 @@ func NewDeletePetRequest(server string, id int64) (*http.Request, error) { return req, nil } -// NewFindPetByIDRequest generates requests for FindPetByID +// NewFindPetByIDRequest constructs an http.Request for the FindPetByID method func NewFindPetByIDRequest(server string, id int64) (*http.Request, error) { var err error @@ -423,18 +466,44 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // FindPetsWithResponse request + + // FindPetsWithResponse Returns all pets + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /pets (the `FindPets` operationId). + FindPetsWithResponse(ctx context.Context, params *FindPetsParams, reqEditors ...RequestEditorFn) (*FindPetsResponse, error) - // AddPetWithBodyWithResponse request with any body + // AddPetWithBodyWithResponse Creates a new pet + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /pets (the `AddPet` operationId). + AddPetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddPetResponse, error) + // AddPetWithResponse Creates a new pet + // + // Takes a body for the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /pets (the `AddPet` operationId). AddPetWithResponse(ctx context.Context, body AddPetJSONRequestBody, reqEditors ...RequestEditorFn) (*AddPetResponse, error) - // DeletePetWithResponse request + // DeletePetWithResponse Deletes a pet by ID + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /pets/{id} (the `DeletePet` operationId). + DeletePetWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*DeletePetResponse, error) - // FindPetByIDWithResponse request + // FindPetByIDWithResponse Returns a pet by ID + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /pets/{id} (the `FindPetByID` operationId). + FindPetByIDWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*FindPetByIDResponse, error) } @@ -445,12 +514,12 @@ type FindPetsResponse struct { JSONDefault *Error } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r FindPetsResponse) GetJSON200() *[]Pet { return r.JSON200 } -// GetJSONDefault returns JSONDefault +// GetJSONDefault returns the response for an HTTP default `application/json` response func (r FindPetsResponse) GetJSONDefault() *Error { return r.JSONDefault } @@ -491,12 +560,12 @@ type AddPetResponse struct { JSONDefault *Error } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r AddPetResponse) GetJSON200() *Pet { return r.JSON200 } -// GetJSONDefault returns JSONDefault +// GetJSONDefault returns the response for an HTTP default `application/json` response func (r AddPetResponse) GetJSONDefault() *Error { return r.JSONDefault } @@ -536,7 +605,7 @@ type DeletePetResponse struct { JSONDefault *Error } -// GetJSONDefault returns JSONDefault +// GetJSONDefault returns the response for an HTTP default `application/json` response func (r DeletePetResponse) GetJSONDefault() *Error { return r.JSONDefault } @@ -577,12 +646,12 @@ type FindPetByIDResponse struct { JSONDefault *Error } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r FindPetByIDResponse) GetJSON200() *Pet { return r.JSON200 } -// GetJSONDefault returns JSONDefault +// GetJSONDefault returns the response for an HTTP default `application/json` response func (r FindPetByIDResponse) GetJSONDefault() *Error { return r.JSONDefault } @@ -616,7 +685,12 @@ func (r FindPetByIDResponse) ContentType() string { return "" } -// FindPetsWithResponse request returning *FindPetsResponse +// FindPetsWithResponse Returns all pets +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /pets (the `FindPets` operationId). + func (c *ClientWithResponses) FindPetsWithResponse(ctx context.Context, params *FindPetsParams, reqEditors ...RequestEditorFn) (*FindPetsResponse, error) { rsp, err := c.FindPets(ctx, params, reqEditors...) if err != nil { @@ -625,7 +699,12 @@ func (c *ClientWithResponses) FindPetsWithResponse(ctx context.Context, params * return ParseFindPetsResponse(rsp) } -// AddPetWithBodyWithResponse request with arbitrary body returning *AddPetResponse +// AddPetWithBodyWithResponse Creates a new pet +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /pets (the `AddPet` operationId). + func (c *ClientWithResponses) AddPetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddPetResponse, error) { rsp, err := c.AddPetWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -634,6 +713,11 @@ func (c *ClientWithResponses) AddPetWithBodyWithResponse(ctx context.Context, co return ParseAddPetResponse(rsp) } +// AddPetWithResponse Creates a new pet +// +// Takes a body for the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /pets (the `AddPet` operationId). func (c *ClientWithResponses) AddPetWithResponse(ctx context.Context, body AddPetJSONRequestBody, reqEditors ...RequestEditorFn) (*AddPetResponse, error) { rsp, err := c.AddPet(ctx, body, reqEditors...) if err != nil { @@ -642,7 +726,12 @@ func (c *ClientWithResponses) AddPetWithResponse(ctx context.Context, body AddPe return ParseAddPetResponse(rsp) } -// DeletePetWithResponse request returning *DeletePetResponse +// DeletePetWithResponse Deletes a pet by ID +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /pets/{id} (the `DeletePet` operationId). + func (c *ClientWithResponses) DeletePetWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*DeletePetResponse, error) { rsp, err := c.DeletePet(ctx, id, reqEditors...) if err != nil { @@ -651,7 +740,12 @@ func (c *ClientWithResponses) DeletePetWithResponse(ctx context.Context, id int6 return ParseDeletePetResponse(rsp) } -// FindPetByIDWithResponse request returning *FindPetByIDResponse +// FindPetByIDWithResponse Returns a pet by ID +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /pets/{id} (the `FindPetByID` operationId). + func (c *ClientWithResponses) FindPetByIDWithResponse(ctx context.Context, id int64, reqEditors ...RequestEditorFn) (*FindPetByIDResponse, error) { rsp, err := c.FindPetByID(ctx, id, reqEditors...) if err != nil { diff --git a/examples/petstore-expanded/stdhttp/api/petstore.gen.go b/examples/petstore-expanded/stdhttp/api/petstore.gen.go index 9ae158e3fd..d7671daffe 100644 --- a/examples/petstore-expanded/stdhttp/api/petstore.gen.go +++ b/examples/petstore-expanded/stdhttp/api/petstore.gen.go @@ -64,16 +64,16 @@ type AddPetJSONRequestBody = NewPet // ServerInterface represents all server handlers. type ServerInterface interface { - // Returns all pets + // FindPets Returns all pets // (GET /pets) FindPets(w http.ResponseWriter, r *http.Request, params FindPetsParams) - // Creates a new pet + // AddPet Creates a new pet // (POST /pets) AddPet(w http.ResponseWriter, r *http.Request) - // Deletes a pet by ID + // DeletePet Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(w http.ResponseWriter, r *http.Request, id int64) - // Returns a pet by ID + // FindPetByID Returns a pet by ID // (GET /pets/{id}) FindPetByID(w http.ResponseWriter, r *http.Request, id int64) } diff --git a/examples/petstore-expanded/strict/api/petstore-server.gen.go b/examples/petstore-expanded/strict/api/petstore-server.gen.go index e35edad725..f269490cda 100644 --- a/examples/petstore-expanded/strict/api/petstore-server.gen.go +++ b/examples/petstore-expanded/strict/api/petstore-server.gen.go @@ -23,16 +23,16 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Returns all pets + // FindPets Returns all pets // (GET /pets) FindPets(w http.ResponseWriter, r *http.Request, params FindPetsParams) - // Creates a new pet + // AddPet Creates a new pet // (POST /pets) AddPet(w http.ResponseWriter, r *http.Request) - // Deletes a pet by ID + // DeletePet Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(w http.ResponseWriter, r *http.Request, id int64) - // Returns a pet by ID + // FindPetByID Returns a pet by ID // (GET /pets/{id}) FindPetByID(w http.ResponseWriter, r *http.Request, id int64) } @@ -41,25 +41,25 @@ type ServerInterface interface { type Unimplemented struct{} -// Returns all pets +// FindPets Returns all pets // (GET /pets) func (_ Unimplemented) FindPets(w http.ResponseWriter, r *http.Request, params FindPetsParams) { w.WriteHeader(http.StatusNotImplemented) } -// Creates a new pet +// AddPet Creates a new pet // (POST /pets) func (_ Unimplemented) AddPet(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } -// Deletes a pet by ID +// DeletePet Deletes a pet by ID // (DELETE /pets/{id}) func (_ Unimplemented) DeletePet(w http.ResponseWriter, r *http.Request, id int64) { w.WriteHeader(http.StatusNotImplemented) } -// Returns a pet by ID +// FindPetByID Returns a pet by ID // (GET /pets/{id}) func (_ Unimplemented) FindPetByID(w http.ResponseWriter, r *http.Request, id int64) { w.WriteHeader(http.StatusNotImplemented) @@ -467,16 +467,16 @@ func (response FindPetByIDdefaultJSONResponse) VisitFindPetByIDResponse(w http.R // StrictServerInterface represents all server handlers. type StrictServerInterface interface { - // Returns all pets + // FindPets Returns all pets // (GET /pets) FindPets(ctx context.Context, request FindPetsRequestObject) (FindPetsResponseObject, error) - // Creates a new pet + // AddPet Creates a new pet // (POST /pets) AddPet(ctx context.Context, request AddPetRequestObject) (AddPetResponseObject, error) - // Deletes a pet by ID + // DeletePet Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(ctx context.Context, request DeletePetRequestObject) (DeletePetResponseObject, error) - // Returns a pet by ID + // FindPetByID Returns a pet by ID // (GET /pets/{id}) FindPetByID(ctx context.Context, request FindPetByIDRequestObject) (FindPetByIDResponseObject, error) } diff --git a/examples/streaming/client/sse/streaming.gen.go b/examples/streaming/client/sse/streaming.gen.go index 31b195d7e2..8defcecace 100644 --- a/examples/streaming/client/sse/streaming.gen.go +++ b/examples/streaming/client/sse/streaming.gen.go @@ -12,7 +12,7 @@ import ( "strings" ) -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -85,10 +85,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetStream request + + // GetStream JSON Lines Stream + // + // Corresponds with GET / (the `GetStream` operationId). + GetStream(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetStream JSON Lines Stream +// +// Corresponds with GET / (the `GetStream` operationId). + func (c *Client) GetStream(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetStreamRequest(c.Server) if err != nil { @@ -101,7 +109,7 @@ func (c *Client) GetStream(ctx context.Context, reqEditors ...RequestEditorFn) ( return c.Client.Do(req) } -// NewGetStreamRequest generates requests for GetStream +// NewGetStreamRequest constructs an http.Request for the GetStream method func NewGetStreamRequest(server string) (*http.Request, error) { var err error @@ -171,7 +179,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetStreamWithResponse request + + // GetStreamWithResponse JSON Lines Stream + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET / (the `GetStream` operationId). + GetStreamWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStreamResponse, error) } @@ -209,7 +223,12 @@ func (r GetStreamResponse) ContentType() string { return "" } -// GetStreamWithResponse request returning *GetStreamResponse +// GetStreamWithResponse JSON Lines Stream +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET / (the `GetStream` operationId). + func (c *ClientWithResponses) GetStreamWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStreamResponse, error) { rsp, err := c.GetStream(ctx, reqEditors...) if err != nil { diff --git a/examples/streaming/stdhttp/sse/streaming.gen.go b/examples/streaming/stdhttp/sse/streaming.gen.go index cd2a15e01c..01e0792dfc 100644 --- a/examples/streaming/stdhttp/sse/streaming.gen.go +++ b/examples/streaming/stdhttp/sse/streaming.gen.go @@ -22,7 +22,7 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // JSON Lines Stream + // GetStream JSON Lines Stream // (GET /) GetStream(w http.ResponseWriter, r *http.Request) } @@ -227,7 +227,7 @@ func (response GetStream200ApplicationjsonlResponse) VisitGetStreamResponse(w ht // StrictServerInterface represents all server handlers. type StrictServerInterface interface { - // JSON Lines Stream + // GetStream JSON Lines Stream // (GET /) GetStream(ctx context.Context, request GetStreamRequestObject) (GetStreamResponseObject, error) } diff --git a/internal/test/anonymous_inner_hoisting/client.gen.go b/internal/test/anonymous_inner_hoisting/client.gen.go index f022093572..9564ade310 100644 --- a/internal/test/anonymous_inner_hoisting/client.gen.go +++ b/internal/test/anonymous_inner_hoisting/client.gen.go @@ -477,7 +477,7 @@ func (t *GetResponseRootOneOf200JSONResponseBody) UnmarshalJSON(b []byte) error return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -550,29 +550,45 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // PostBodyPropertyOneOfWithBody request with any body + + // PostBodyPropertyOneOfWithBody performs a POST /body-property-oneof (the `PostBodyPropertyOneOf` operationId) request, + // with any type of body and a specified content type. + PostBodyPropertyOneOfWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostBodyPropertyOneOf performs a POST /body-property-oneof (the `PostBodyPropertyOneOf` operationId) request, + // Takes a body for the `application/json` content type. PostBodyPropertyOneOf(ctx context.Context, body PostBodyPropertyOneOfJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostBodyRootOneOfWithBody request with any body + // PostBodyRootOneOfWithBody performs a POST /body-root-oneof (the `PostBodyRootOneOf` operationId) request, + // with any type of body and a specified content type. + PostBodyRootOneOfWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostBodyRootOneOf performs a POST /body-root-oneof (the `PostBodyRootOneOf` operationId) request, + // Takes a body for the `application/json` content type. PostBodyRootOneOf(ctx context.Context, body PostBodyRootOneOfJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetResponseDeepNested request + // GetResponseDeepNested performs a GET /response-deep-nested (the `GetResponseDeepNested` operationId) request. + GetResponseDeepNested(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetResponseItemsOneOf request + // GetResponseItemsOneOf performs a GET /response-items-oneof (the `GetResponseItemsOneOf` operationId) request. + GetResponseItemsOneOf(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetResponseRootAnyOf request + // GetResponseRootAnyOf performs a GET /response-root-anyof (the `GetResponseRootAnyOf` operationId) request. + GetResponseRootAnyOf(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetResponseRootOneOf request + // GetResponseRootOneOf performs a GET /response-root-oneof (the `GetResponseRootOneOf` operationId) request. + GetResponseRootOneOf(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// PostBodyPropertyOneOfWithBody performs a POST /body-property-oneof (the `PostBodyPropertyOneOf` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostBodyPropertyOneOfWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostBodyPropertyOneOfRequestWithBody(c.Server, contentType, body) if err != nil { @@ -585,6 +601,8 @@ func (c *Client) PostBodyPropertyOneOfWithBody(ctx context.Context, contentType return c.Client.Do(req) } +// PostBodyPropertyOneOf performs a POST /body-property-oneof (the `PostBodyPropertyOneOf` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) PostBodyPropertyOneOf(ctx context.Context, body PostBodyPropertyOneOfJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostBodyPropertyOneOfRequest(c.Server, body) if err != nil { @@ -597,6 +615,9 @@ func (c *Client) PostBodyPropertyOneOf(ctx context.Context, body PostBodyPropert return c.Client.Do(req) } +// PostBodyRootOneOfWithBody performs a POST /body-root-oneof (the `PostBodyRootOneOf` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostBodyRootOneOfWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostBodyRootOneOfRequestWithBody(c.Server, contentType, body) if err != nil { @@ -609,6 +630,8 @@ func (c *Client) PostBodyRootOneOfWithBody(ctx context.Context, contentType stri return c.Client.Do(req) } +// PostBodyRootOneOf performs a POST /body-root-oneof (the `PostBodyRootOneOf` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) PostBodyRootOneOf(ctx context.Context, body PostBodyRootOneOfJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostBodyRootOneOfRequest(c.Server, body) if err != nil { @@ -621,6 +644,8 @@ func (c *Client) PostBodyRootOneOf(ctx context.Context, body PostBodyRootOneOfJS return c.Client.Do(req) } +// GetResponseDeepNested performs a GET /response-deep-nested (the `GetResponseDeepNested` operationId) request. + func (c *Client) GetResponseDeepNested(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetResponseDeepNestedRequest(c.Server) if err != nil { @@ -633,6 +658,8 @@ func (c *Client) GetResponseDeepNested(ctx context.Context, reqEditors ...Reques return c.Client.Do(req) } +// GetResponseItemsOneOf performs a GET /response-items-oneof (the `GetResponseItemsOneOf` operationId) request. + func (c *Client) GetResponseItemsOneOf(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetResponseItemsOneOfRequest(c.Server) if err != nil { @@ -645,6 +672,8 @@ func (c *Client) GetResponseItemsOneOf(ctx context.Context, reqEditors ...Reques return c.Client.Do(req) } +// GetResponseRootAnyOf performs a GET /response-root-anyof (the `GetResponseRootAnyOf` operationId) request. + func (c *Client) GetResponseRootAnyOf(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetResponseRootAnyOfRequest(c.Server) if err != nil { @@ -657,6 +686,8 @@ func (c *Client) GetResponseRootAnyOf(ctx context.Context, reqEditors ...Request return c.Client.Do(req) } +// GetResponseRootOneOf performs a GET /response-root-oneof (the `GetResponseRootOneOf` operationId) request. + func (c *Client) GetResponseRootOneOf(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetResponseRootOneOfRequest(c.Server) if err != nil { @@ -680,7 +711,7 @@ func NewPostBodyPropertyOneOfRequest(server string, body PostBodyPropertyOneOfJS return NewPostBodyPropertyOneOfRequestWithBody(server, "application/json", bodyReader) } -// NewPostBodyPropertyOneOfRequestWithBody generates requests for PostBodyPropertyOneOf with any type of body +// NewPostBodyPropertyOneOfRequestWithBody constructs an http.Request for the PostBodyPropertyOneOf method, with any body, and a specified content type func NewPostBodyPropertyOneOfRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -720,7 +751,7 @@ func NewPostBodyRootOneOfRequest(server string, body PostBodyRootOneOfJSONReques return NewPostBodyRootOneOfRequestWithBody(server, "application/json", bodyReader) } -// NewPostBodyRootOneOfRequestWithBody generates requests for PostBodyRootOneOf with any type of body +// NewPostBodyRootOneOfRequestWithBody constructs an http.Request for the PostBodyRootOneOf method, with any body, and a specified content type func NewPostBodyRootOneOfRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -749,7 +780,7 @@ func NewPostBodyRootOneOfRequestWithBody(server string, contentType string, body return req, nil } -// NewGetResponseDeepNestedRequest generates requests for GetResponseDeepNested +// NewGetResponseDeepNestedRequest constructs an http.Request for the GetResponseDeepNested method func NewGetResponseDeepNestedRequest(server string) (*http.Request, error) { var err error @@ -776,7 +807,7 @@ func NewGetResponseDeepNestedRequest(server string) (*http.Request, error) { return req, nil } -// NewGetResponseItemsOneOfRequest generates requests for GetResponseItemsOneOf +// NewGetResponseItemsOneOfRequest constructs an http.Request for the GetResponseItemsOneOf method func NewGetResponseItemsOneOfRequest(server string) (*http.Request, error) { var err error @@ -803,7 +834,7 @@ func NewGetResponseItemsOneOfRequest(server string) (*http.Request, error) { return req, nil } -// NewGetResponseRootAnyOfRequest generates requests for GetResponseRootAnyOf +// NewGetResponseRootAnyOfRequest constructs an http.Request for the GetResponseRootAnyOf method func NewGetResponseRootAnyOfRequest(server string) (*http.Request, error) { var err error @@ -830,7 +861,7 @@ func NewGetResponseRootAnyOfRequest(server string) (*http.Request, error) { return req, nil } -// NewGetResponseRootOneOfRequest generates requests for GetResponseRootOneOf +// NewGetResponseRootOneOfRequest constructs an http.Request for the GetResponseRootOneOf method func NewGetResponseRootOneOfRequest(server string) (*http.Request, error) { var err error @@ -900,26 +931,51 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // PostBodyPropertyOneOfWithBodyWithResponse request with any body + + // PostBodyPropertyOneOfWithBodyWithResponse performs a POST /body-property-oneof (the `PostBodyPropertyOneOf` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostBodyPropertyOneOfWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostBodyPropertyOneOfResponse, error) + // PostBodyPropertyOneOfWithResponse performs a POST /body-property-oneof (the `PostBodyPropertyOneOf` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). PostBodyPropertyOneOfWithResponse(ctx context.Context, body PostBodyPropertyOneOfJSONRequestBody, reqEditors ...RequestEditorFn) (*PostBodyPropertyOneOfResponse, error) - // PostBodyRootOneOfWithBodyWithResponse request with any body + // PostBodyRootOneOfWithBodyWithResponse performs a POST /body-root-oneof (the `PostBodyRootOneOf` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostBodyRootOneOfWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostBodyRootOneOfResponse, error) + // PostBodyRootOneOfWithResponse performs a POST /body-root-oneof (the `PostBodyRootOneOf` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). PostBodyRootOneOfWithResponse(ctx context.Context, body PostBodyRootOneOfJSONRequestBody, reqEditors ...RequestEditorFn) (*PostBodyRootOneOfResponse, error) - // GetResponseDeepNestedWithResponse request + // GetResponseDeepNestedWithResponse performs a GET /response-deep-nested (the `GetResponseDeepNested` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetResponseDeepNestedWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetResponseDeepNestedResponse, error) - // GetResponseItemsOneOfWithResponse request + // GetResponseItemsOneOfWithResponse performs a GET /response-items-oneof (the `GetResponseItemsOneOf` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetResponseItemsOneOfWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetResponseItemsOneOfResponse, error) - // GetResponseRootAnyOfWithResponse request + // GetResponseRootAnyOfWithResponse performs a GET /response-root-anyof (the `GetResponseRootAnyOf` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetResponseRootAnyOfWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetResponseRootAnyOfResponse, error) - // GetResponseRootOneOfWithResponse request + // GetResponseRootOneOfWithResponse performs a GET /response-root-oneof (the `GetResponseRootOneOf` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetResponseRootOneOfWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetResponseRootOneOfResponse, error) } @@ -1001,7 +1057,7 @@ type GetResponseDeepNestedResponse struct { } } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetResponseDeepNestedResponse) GetJSON200() *struct { Wrapper *struct { Inner *GetResponseDeepNested200JSONResponseBody_Wrapper_Inner `json:"inner,omitempty"` @@ -1047,7 +1103,7 @@ type GetResponseItemsOneOfResponse struct { } } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetResponseItemsOneOfResponse) GetJSON200() *struct { Items []GetResponseItemsOneOf200JSONResponseBody_Items_Item `json:"items"` } { @@ -1089,7 +1145,7 @@ type GetResponseRootAnyOfResponse struct { JSON200 *GetResponseRootAnyOf200JSONResponseBody } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetResponseRootAnyOfResponse) GetJSON200() *GetResponseRootAnyOf200JSONResponseBody { return r.JSON200 } @@ -1129,7 +1185,7 @@ type GetResponseRootOneOfResponse struct { JSON200 *GetResponseRootOneOf200JSONResponseBody } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetResponseRootOneOfResponse) GetJSON200() *GetResponseRootOneOf200JSONResponseBody { return r.JSON200 } @@ -1163,7 +1219,11 @@ func (r GetResponseRootOneOfResponse) ContentType() string { return "" } -// PostBodyPropertyOneOfWithBodyWithResponse request with arbitrary body returning *PostBodyPropertyOneOfResponse +// PostBodyPropertyOneOfWithBodyWithResponse performs a POST /body-property-oneof (the `PostBodyPropertyOneOf` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostBodyPropertyOneOfWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostBodyPropertyOneOfResponse, error) { rsp, err := c.PostBodyPropertyOneOfWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -1172,6 +1232,8 @@ func (c *ClientWithResponses) PostBodyPropertyOneOfWithBodyWithResponse(ctx cont return ParsePostBodyPropertyOneOfResponse(rsp) } +// PostBodyPropertyOneOfWithResponse performs a POST /body-property-oneof (the `PostBodyPropertyOneOf` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostBodyPropertyOneOfWithResponse(ctx context.Context, body PostBodyPropertyOneOfJSONRequestBody, reqEditors ...RequestEditorFn) (*PostBodyPropertyOneOfResponse, error) { rsp, err := c.PostBodyPropertyOneOf(ctx, body, reqEditors...) if err != nil { @@ -1180,7 +1242,11 @@ func (c *ClientWithResponses) PostBodyPropertyOneOfWithResponse(ctx context.Cont return ParsePostBodyPropertyOneOfResponse(rsp) } -// PostBodyRootOneOfWithBodyWithResponse request with arbitrary body returning *PostBodyRootOneOfResponse +// PostBodyRootOneOfWithBodyWithResponse performs a POST /body-root-oneof (the `PostBodyRootOneOf` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostBodyRootOneOfWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostBodyRootOneOfResponse, error) { rsp, err := c.PostBodyRootOneOfWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -1189,6 +1255,8 @@ func (c *ClientWithResponses) PostBodyRootOneOfWithBodyWithResponse(ctx context. return ParsePostBodyRootOneOfResponse(rsp) } +// PostBodyRootOneOfWithResponse performs a POST /body-root-oneof (the `PostBodyRootOneOf` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostBodyRootOneOfWithResponse(ctx context.Context, body PostBodyRootOneOfJSONRequestBody, reqEditors ...RequestEditorFn) (*PostBodyRootOneOfResponse, error) { rsp, err := c.PostBodyRootOneOf(ctx, body, reqEditors...) if err != nil { @@ -1197,7 +1265,10 @@ func (c *ClientWithResponses) PostBodyRootOneOfWithResponse(ctx context.Context, return ParsePostBodyRootOneOfResponse(rsp) } -// GetResponseDeepNestedWithResponse request returning *GetResponseDeepNestedResponse +// GetResponseDeepNestedWithResponse performs a GET /response-deep-nested (the `GetResponseDeepNested` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetResponseDeepNestedWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetResponseDeepNestedResponse, error) { rsp, err := c.GetResponseDeepNested(ctx, reqEditors...) if err != nil { @@ -1206,7 +1277,10 @@ func (c *ClientWithResponses) GetResponseDeepNestedWithResponse(ctx context.Cont return ParseGetResponseDeepNestedResponse(rsp) } -// GetResponseItemsOneOfWithResponse request returning *GetResponseItemsOneOfResponse +// GetResponseItemsOneOfWithResponse performs a GET /response-items-oneof (the `GetResponseItemsOneOf` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetResponseItemsOneOfWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetResponseItemsOneOfResponse, error) { rsp, err := c.GetResponseItemsOneOf(ctx, reqEditors...) if err != nil { @@ -1215,7 +1289,10 @@ func (c *ClientWithResponses) GetResponseItemsOneOfWithResponse(ctx context.Cont return ParseGetResponseItemsOneOfResponse(rsp) } -// GetResponseRootAnyOfWithResponse request returning *GetResponseRootAnyOfResponse +// GetResponseRootAnyOfWithResponse performs a GET /response-root-anyof (the `GetResponseRootAnyOf` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetResponseRootAnyOfWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetResponseRootAnyOfResponse, error) { rsp, err := c.GetResponseRootAnyOf(ctx, reqEditors...) if err != nil { @@ -1224,7 +1301,10 @@ func (c *ClientWithResponses) GetResponseRootAnyOfWithResponse(ctx context.Conte return ParseGetResponseRootAnyOfResponse(rsp) } -// GetResponseRootOneOfWithResponse request returning *GetResponseRootOneOfResponse +// GetResponseRootOneOfWithResponse performs a GET /response-root-oneof (the `GetResponseRootOneOf` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetResponseRootOneOfWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetResponseRootOneOfResponse, error) { rsp, err := c.GetResponseRootOneOf(ctx, reqEditors...) if err != nil { diff --git a/internal/test/any_of/codegen/inline/openapi.gen.go b/internal/test/any_of/codegen/inline/openapi.gen.go index e1bb5cfbd7..cc20587e8d 100644 --- a/internal/test/any_of/codegen/inline/openapi.gen.go +++ b/internal/test/any_of/codegen/inline/openapi.gen.go @@ -142,7 +142,7 @@ func (t *GetPets200JSONResponseBody_Data_Item) UnmarshalJSON(b []byte) error { return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -215,10 +215,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetPets request + + // GetPets Get a list of pets + // + // Corresponds with GET /pets (the `GetPets` operationId). + GetPets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetPets Get a list of pets +// +// Corresponds with GET /pets (the `GetPets` operationId). + func (c *Client) GetPets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetPetsRequest(c.Server) if err != nil { @@ -231,7 +239,7 @@ func (c *Client) GetPets(ctx context.Context, reqEditors ...RequestEditorFn) (*h return c.Client.Do(req) } -// NewGetPetsRequest generates requests for GetPets +// NewGetPetsRequest constructs an http.Request for the GetPets method func NewGetPetsRequest(server string) (*http.Request, error) { var err error @@ -301,7 +309,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetPetsWithResponse request + + // GetPetsWithResponse Get a list of pets + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /pets (the `GetPets` operationId). + GetPetsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPetsResponse, error) } @@ -313,7 +327,7 @@ type GetPetsResponse struct { } } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetPetsResponse) GetJSON200() *struct { Data *[]GetPets200JSONResponseBody_Data_Item `json:"data,omitempty"` } { @@ -349,7 +363,12 @@ func (r GetPetsResponse) ContentType() string { return "" } -// GetPetsWithResponse request returning *GetPetsResponse +// GetPetsWithResponse Get a list of pets +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /pets (the `GetPets` operationId). + func (c *ClientWithResponses) GetPetsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPetsResponse, error) { rsp, err := c.GetPets(ctx, reqEditors...) if err != nil { @@ -388,7 +407,7 @@ func ParseGetPetsResponse(rsp *http.Response) (*GetPetsResponse, error) { // ServerInterface represents all server handlers. type ServerInterface interface { - // Get a list of pets + // GetPets Get a list of pets // (GET /pets) GetPets(ctx echo.Context) error } diff --git a/internal/test/any_of/codegen/ref_schema/openapi.gen.go b/internal/test/any_of/codegen/ref_schema/openapi.gen.go index c69077123e..809e3366ca 100644 --- a/internal/test/any_of/codegen/ref_schema/openapi.gen.go +++ b/internal/test/any_of/codegen/ref_schema/openapi.gen.go @@ -147,7 +147,7 @@ func (t *GetPetsDto_Data) UnmarshalJSON(b []byte) error { return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -220,10 +220,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetPets request + + // GetPets Get a list of pets + // + // Corresponds with GET /pets (the `GetPets` operationId). + GetPets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetPets Get a list of pets +// +// Corresponds with GET /pets (the `GetPets` operationId). + func (c *Client) GetPets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetPetsRequest(c.Server) if err != nil { @@ -236,7 +244,7 @@ func (c *Client) GetPets(ctx context.Context, reqEditors ...RequestEditorFn) (*h return c.Client.Do(req) } -// NewGetPetsRequest generates requests for GetPets +// NewGetPetsRequest constructs an http.Request for the GetPets method func NewGetPetsRequest(server string) (*http.Request, error) { var err error @@ -306,7 +314,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetPetsWithResponse request + + // GetPetsWithResponse Get a list of pets + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /pets (the `GetPets` operationId). + GetPetsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPetsResponse, error) } @@ -316,7 +330,7 @@ type GetPetsResponse struct { JSON200 *GetPetsDto } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetPetsResponse) GetJSON200() *GetPetsDto { return r.JSON200 } @@ -350,7 +364,12 @@ func (r GetPetsResponse) ContentType() string { return "" } -// GetPetsWithResponse request returning *GetPetsResponse +// GetPetsWithResponse Get a list of pets +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /pets (the `GetPets` operationId). + func (c *ClientWithResponses) GetPetsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPetsResponse, error) { rsp, err := c.GetPets(ctx, reqEditors...) if err != nil { @@ -387,7 +406,7 @@ func ParseGetPetsResponse(rsp *http.Response) (*GetPetsResponse, error) { // ServerInterface represents all server handlers. type ServerInterface interface { - // Get a list of pets + // GetPets Get a list of pets // (GET /pets) GetPets(ctx echo.Context) error } diff --git a/internal/test/any_of/param/param.gen.go b/internal/test/any_of/param/param.gen.go index 69e50dd32e..b7900a017c 100644 --- a/internal/test/any_of/param/param.gen.go +++ b/internal/test/any_of/param/param.gen.go @@ -173,7 +173,7 @@ func (t *Test2) UnmarshalJSON(b []byte) error { return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -246,10 +246,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetTest request + + // GetTest performs a GET /test (the `GetTest` operationId) request. + GetTest(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetTest performs a GET /test (the `GetTest` operationId) request. + func (c *Client) GetTest(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetTestRequest(c.Server, params) if err != nil { @@ -262,7 +266,7 @@ func (c *Client) GetTest(ctx context.Context, params *GetTestParams, reqEditors return c.Client.Do(req) } -// NewGetTestRequest generates requests for GetTest +// NewGetTestRequest constructs an http.Request for the GetTest method func NewGetTestRequest(server string, params *GetTestParams) (*http.Request, error) { var err error @@ -371,7 +375,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetTestWithResponse request + + // GetTestWithResponse performs a GET /test (the `GetTest` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetTestWithResponse(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*GetTestResponse, error) } @@ -409,7 +417,10 @@ func (r GetTestResponse) ContentType() string { return "" } -// GetTestWithResponse request returning *GetTestResponse +// GetTestWithResponse performs a GET /test (the `GetTest` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetTestWithResponse(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*GetTestResponse, error) { rsp, err := c.GetTest(ctx, params, reqEditors...) if err != nil { diff --git a/internal/test/client/client.gen.go b/internal/test/client/client.gen.go index aa6d0a4c7d..3f092c742c 100644 --- a/internal/test/client/client.gen.go +++ b/internal/test/client/client.gen.go @@ -39,7 +39,7 @@ type PostJsonJSONRequestBody = SchemaObject // PostVendorJsonApplicationVndAPIPlusJSONRequestBody defines body for PostVendorJson for application/vnd.api+json ContentType. type PostVendorJsonApplicationVndAPIPlusJSONRequestBody = PostVendorJsonApplicationVndAPIPlusJSONBody -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -112,37 +112,59 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // PostBothWithBody request with any body + + // PostBothWithBody performs a POST /with_both_bodies (the `PostBoth` operationId) request, + // with any type of body and a specified content type. + PostBothWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostBoth performs a POST /with_both_bodies (the `PostBoth` operationId) request, + // Takes a body for the `application/json` content type. PostBoth(ctx context.Context, body PostBothJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetBoth request + // GetBoth performs a GET /with_both_responses (the `GetBoth` operationId) request. + GetBoth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostJsonWithBody request with any body + // PostJsonWithBody performs a POST /with_json_body (the `PostJson` operationId) request, + // with any type of body and a specified content type. + PostJsonWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostJson performs a POST /with_json_body (the `PostJson` operationId) request, + // Takes a body for the `application/json` content type. PostJson(ctx context.Context, body PostJsonJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetJson request + // GetJson performs a GET /with_json_response (the `GetJson` operationId) request. + GetJson(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostOtherWithBody request with any body + // PostOtherWithBody performs a POST /with_other_body (the `PostOther` operationId) request, + // with any type of body and a specified content type. + PostOtherWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetOther request + // GetOther performs a GET /with_other_response (the `GetOther` operationId) request. + GetOther(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetJsonWithTrailingSlash request + // GetJsonWithTrailingSlash performs a GET /with_trailing_slash/ (the `GetJsonWithTrailingSlash` operationId) request. + GetJsonWithTrailingSlash(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostVendorJsonWithBody request with any body + // PostVendorJsonWithBody performs a POST /with_vendor_json (the `PostVendorJson` operationId) request, + // with any type of body and a specified content type. + PostVendorJsonWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostVendorJson performs a POST /with_vendor_json (the `PostVendorJson` operationId) request, + // Takes a body for the `application/vnd.api+json` content type. PostVendorJsonWithApplicationVndAPIPlusJSONBody(ctx context.Context, body PostVendorJsonApplicationVndAPIPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// PostBothWithBody performs a POST /with_both_bodies (the `PostBoth` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostBothWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostBothRequestWithBody(c.Server, contentType, body) if err != nil { @@ -155,6 +177,8 @@ func (c *Client) PostBothWithBody(ctx context.Context, contentType string, body return c.Client.Do(req) } +// PostBoth performs a POST /with_both_bodies (the `PostBoth` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) PostBoth(ctx context.Context, body PostBothJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostBothRequest(c.Server, body) if err != nil { @@ -167,6 +191,8 @@ func (c *Client) PostBoth(ctx context.Context, body PostBothJSONRequestBody, req return c.Client.Do(req) } +// GetBoth performs a GET /with_both_responses (the `GetBoth` operationId) request. + func (c *Client) GetBoth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetBothRequest(c.Server) if err != nil { @@ -179,6 +205,9 @@ func (c *Client) GetBoth(ctx context.Context, reqEditors ...RequestEditorFn) (*h return c.Client.Do(req) } +// PostJsonWithBody performs a POST /with_json_body (the `PostJson` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostJsonWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostJsonRequestWithBody(c.Server, contentType, body) if err != nil { @@ -191,6 +220,8 @@ func (c *Client) PostJsonWithBody(ctx context.Context, contentType string, body return c.Client.Do(req) } +// PostJson performs a POST /with_json_body (the `PostJson` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) PostJson(ctx context.Context, body PostJsonJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostJsonRequest(c.Server, body) if err != nil { @@ -203,6 +234,8 @@ func (c *Client) PostJson(ctx context.Context, body PostJsonJSONRequestBody, req return c.Client.Do(req) } +// GetJson performs a GET /with_json_response (the `GetJson` operationId) request. + func (c *Client) GetJson(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetJsonRequest(c.Server) if err != nil { @@ -215,6 +248,9 @@ func (c *Client) GetJson(ctx context.Context, reqEditors ...RequestEditorFn) (*h return c.Client.Do(req) } +// PostOtherWithBody performs a POST /with_other_body (the `PostOther` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostOtherWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostOtherRequestWithBody(c.Server, contentType, body) if err != nil { @@ -227,6 +263,8 @@ func (c *Client) PostOtherWithBody(ctx context.Context, contentType string, body return c.Client.Do(req) } +// GetOther performs a GET /with_other_response (the `GetOther` operationId) request. + func (c *Client) GetOther(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetOtherRequest(c.Server) if err != nil { @@ -239,6 +277,8 @@ func (c *Client) GetOther(ctx context.Context, reqEditors ...RequestEditorFn) (* return c.Client.Do(req) } +// GetJsonWithTrailingSlash performs a GET /with_trailing_slash/ (the `GetJsonWithTrailingSlash` operationId) request. + func (c *Client) GetJsonWithTrailingSlash(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetJsonWithTrailingSlashRequest(c.Server) if err != nil { @@ -251,6 +291,9 @@ func (c *Client) GetJsonWithTrailingSlash(ctx context.Context, reqEditors ...Req return c.Client.Do(req) } +// PostVendorJsonWithBody performs a POST /with_vendor_json (the `PostVendorJson` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostVendorJsonWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostVendorJsonRequestWithBody(c.Server, contentType, body) if err != nil { @@ -263,6 +306,8 @@ func (c *Client) PostVendorJsonWithBody(ctx context.Context, contentType string, return c.Client.Do(req) } +// PostVendorJson performs a POST /with_vendor_json (the `PostVendorJson` operationId) request, +// Takes a body for the `application/vnd.api+json` content type. func (c *Client) PostVendorJsonWithApplicationVndAPIPlusJSONBody(ctx context.Context, body PostVendorJsonApplicationVndAPIPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostVendorJsonRequestWithApplicationVndAPIPlusJSONBody(c.Server, body) if err != nil { @@ -286,7 +331,7 @@ func NewPostBothRequest(server string, body PostBothJSONRequestBody) (*http.Requ return NewPostBothRequestWithBody(server, "application/json", bodyReader) } -// NewPostBothRequestWithBody generates requests for PostBoth with any type of body +// NewPostBothRequestWithBody constructs an http.Request for the PostBoth method, with any body, and a specified content type func NewPostBothRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -315,7 +360,7 @@ func NewPostBothRequestWithBody(server string, contentType string, body io.Reade return req, nil } -// NewGetBothRequest generates requests for GetBoth +// NewGetBothRequest constructs an http.Request for the GetBoth method func NewGetBothRequest(server string) (*http.Request, error) { var err error @@ -353,7 +398,7 @@ func NewPostJsonRequest(server string, body PostJsonJSONRequestBody) (*http.Requ return NewPostJsonRequestWithBody(server, "application/json", bodyReader) } -// NewPostJsonRequestWithBody generates requests for PostJson with any type of body +// NewPostJsonRequestWithBody constructs an http.Request for the PostJson method, with any body, and a specified content type func NewPostJsonRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -382,7 +427,7 @@ func NewPostJsonRequestWithBody(server string, contentType string, body io.Reade return req, nil } -// NewGetJsonRequest generates requests for GetJson +// NewGetJsonRequest constructs an http.Request for the GetJson method func NewGetJsonRequest(server string) (*http.Request, error) { var err error @@ -409,7 +454,7 @@ func NewGetJsonRequest(server string) (*http.Request, error) { return req, nil } -// NewPostOtherRequestWithBody generates requests for PostOther with any type of body +// NewPostOtherRequestWithBody constructs an http.Request for the PostOther method, with any body, and a specified content type func NewPostOtherRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -438,7 +483,7 @@ func NewPostOtherRequestWithBody(server string, contentType string, body io.Read return req, nil } -// NewGetOtherRequest generates requests for GetOther +// NewGetOtherRequest constructs an http.Request for the GetOther method func NewGetOtherRequest(server string) (*http.Request, error) { var err error @@ -465,7 +510,7 @@ func NewGetOtherRequest(server string) (*http.Request, error) { return req, nil } -// NewGetJsonWithTrailingSlashRequest generates requests for GetJsonWithTrailingSlash +// NewGetJsonWithTrailingSlashRequest constructs an http.Request for the GetJsonWithTrailingSlash method func NewGetJsonWithTrailingSlashRequest(server string) (*http.Request, error) { var err error @@ -503,7 +548,7 @@ func NewPostVendorJsonRequestWithApplicationVndAPIPlusJSONBody(server string, bo return NewPostVendorJsonRequestWithBody(server, "application/vnd.api+json", bodyReader) } -// NewPostVendorJsonRequestWithBody generates requests for PostVendorJson with any type of body +// NewPostVendorJsonRequestWithBody constructs an http.Request for the PostVendorJson method, with any body, and a specified content type func NewPostVendorJsonRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -575,34 +620,69 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // PostBothWithBodyWithResponse request with any body + + // PostBothWithBodyWithResponse performs a POST /with_both_bodies (the `PostBoth` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostBothWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostBothResponse, error) + // PostBothWithResponse performs a POST /with_both_bodies (the `PostBoth` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). PostBothWithResponse(ctx context.Context, body PostBothJSONRequestBody, reqEditors ...RequestEditorFn) (*PostBothResponse, error) - // GetBothWithResponse request + // GetBothWithResponse performs a GET /with_both_responses (the `GetBoth` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetBothWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetBothResponse, error) - // PostJsonWithBodyWithResponse request with any body + // PostJsonWithBodyWithResponse performs a POST /with_json_body (the `PostJson` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostJsonWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostJsonResponse, error) + // PostJsonWithResponse performs a POST /with_json_body (the `PostJson` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). PostJsonWithResponse(ctx context.Context, body PostJsonJSONRequestBody, reqEditors ...RequestEditorFn) (*PostJsonResponse, error) - // GetJsonWithResponse request + // GetJsonWithResponse performs a GET /with_json_response (the `GetJson` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetJsonWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetJsonResponse, error) - // PostOtherWithBodyWithResponse request with any body + // PostOtherWithBodyWithResponse performs a POST /with_other_body (the `PostOther` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostOtherWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostOtherResponse, error) - // GetOtherWithResponse request + // GetOtherWithResponse performs a GET /with_other_response (the `GetOther` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetOtherWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOtherResponse, error) - // GetJsonWithTrailingSlashWithResponse request + // GetJsonWithTrailingSlashWithResponse performs a GET /with_trailing_slash/ (the `GetJsonWithTrailingSlash` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetJsonWithTrailingSlashWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetJsonWithTrailingSlashResponse, error) - // PostVendorJsonWithBodyWithResponse request with any body + // PostVendorJsonWithBodyWithResponse performs a POST /with_vendor_json (the `PostVendorJson` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostVendorJsonWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostVendorJsonResponse, error) + // PostVendorJsonWithResponse performs a POST /with_vendor_json (the `PostVendorJson` operationId) request, + // Takes a body of the `application/vnd.api+json` content type, and returns a wrapper object for the known response body format(s). PostVendorJsonWithApplicationVndAPIPlusJSONBodyWithResponse(ctx context.Context, body PostVendorJsonApplicationVndAPIPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostVendorJsonResponse, error) } @@ -878,7 +958,11 @@ func (r PostVendorJsonResponse) ContentType() string { return "" } -// PostBothWithBodyWithResponse request with arbitrary body returning *PostBothResponse +// PostBothWithBodyWithResponse performs a POST /with_both_bodies (the `PostBoth` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostBothWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostBothResponse, error) { rsp, err := c.PostBothWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -887,6 +971,8 @@ func (c *ClientWithResponses) PostBothWithBodyWithResponse(ctx context.Context, return ParsePostBothResponse(rsp) } +// PostBothWithResponse performs a POST /with_both_bodies (the `PostBoth` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostBothWithResponse(ctx context.Context, body PostBothJSONRequestBody, reqEditors ...RequestEditorFn) (*PostBothResponse, error) { rsp, err := c.PostBoth(ctx, body, reqEditors...) if err != nil { @@ -895,7 +981,10 @@ func (c *ClientWithResponses) PostBothWithResponse(ctx context.Context, body Pos return ParsePostBothResponse(rsp) } -// GetBothWithResponse request returning *GetBothResponse +// GetBothWithResponse performs a GET /with_both_responses (the `GetBoth` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetBothWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetBothResponse, error) { rsp, err := c.GetBoth(ctx, reqEditors...) if err != nil { @@ -904,7 +993,11 @@ func (c *ClientWithResponses) GetBothWithResponse(ctx context.Context, reqEditor return ParseGetBothResponse(rsp) } -// PostJsonWithBodyWithResponse request with arbitrary body returning *PostJsonResponse +// PostJsonWithBodyWithResponse performs a POST /with_json_body (the `PostJson` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostJsonWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostJsonResponse, error) { rsp, err := c.PostJsonWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -913,6 +1006,8 @@ func (c *ClientWithResponses) PostJsonWithBodyWithResponse(ctx context.Context, return ParsePostJsonResponse(rsp) } +// PostJsonWithResponse performs a POST /with_json_body (the `PostJson` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostJsonWithResponse(ctx context.Context, body PostJsonJSONRequestBody, reqEditors ...RequestEditorFn) (*PostJsonResponse, error) { rsp, err := c.PostJson(ctx, body, reqEditors...) if err != nil { @@ -921,7 +1016,10 @@ func (c *ClientWithResponses) PostJsonWithResponse(ctx context.Context, body Pos return ParsePostJsonResponse(rsp) } -// GetJsonWithResponse request returning *GetJsonResponse +// GetJsonWithResponse performs a GET /with_json_response (the `GetJson` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetJsonWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetJsonResponse, error) { rsp, err := c.GetJson(ctx, reqEditors...) if err != nil { @@ -930,7 +1028,11 @@ func (c *ClientWithResponses) GetJsonWithResponse(ctx context.Context, reqEditor return ParseGetJsonResponse(rsp) } -// PostOtherWithBodyWithResponse request with arbitrary body returning *PostOtherResponse +// PostOtherWithBodyWithResponse performs a POST /with_other_body (the `PostOther` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostOtherWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostOtherResponse, error) { rsp, err := c.PostOtherWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -939,7 +1041,10 @@ func (c *ClientWithResponses) PostOtherWithBodyWithResponse(ctx context.Context, return ParsePostOtherResponse(rsp) } -// GetOtherWithResponse request returning *GetOtherResponse +// GetOtherWithResponse performs a GET /with_other_response (the `GetOther` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetOtherWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOtherResponse, error) { rsp, err := c.GetOther(ctx, reqEditors...) if err != nil { @@ -948,7 +1053,10 @@ func (c *ClientWithResponses) GetOtherWithResponse(ctx context.Context, reqEdito return ParseGetOtherResponse(rsp) } -// GetJsonWithTrailingSlashWithResponse request returning *GetJsonWithTrailingSlashResponse +// GetJsonWithTrailingSlashWithResponse performs a GET /with_trailing_slash/ (the `GetJsonWithTrailingSlash` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetJsonWithTrailingSlashWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetJsonWithTrailingSlashResponse, error) { rsp, err := c.GetJsonWithTrailingSlash(ctx, reqEditors...) if err != nil { @@ -957,7 +1065,11 @@ func (c *ClientWithResponses) GetJsonWithTrailingSlashWithResponse(ctx context.C return ParseGetJsonWithTrailingSlashResponse(rsp) } -// PostVendorJsonWithBodyWithResponse request with arbitrary body returning *PostVendorJsonResponse +// PostVendorJsonWithBodyWithResponse performs a POST /with_vendor_json (the `PostVendorJson` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostVendorJsonWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostVendorJsonResponse, error) { rsp, err := c.PostVendorJsonWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -966,6 +1078,8 @@ func (c *ClientWithResponses) PostVendorJsonWithBodyWithResponse(ctx context.Con return ParsePostVendorJsonResponse(rsp) } +// PostVendorJsonWithResponse performs a POST /with_vendor_json (the `PostVendorJson` operationId) request, +// Takes a body of the `application/vnd.api+json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostVendorJsonWithApplicationVndAPIPlusJSONBodyWithResponse(ctx context.Context, body PostVendorJsonApplicationVndAPIPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostVendorJsonResponse, error) { rsp, err := c.PostVendorJsonWithApplicationVndAPIPlusJSONBody(ctx, body, reqEditors...) if err != nil { diff --git a/internal/test/extensions/param-ref-sibling-omitempty/issue.gen.go b/internal/test/extensions/param-ref-sibling-omitempty/issue.gen.go index 3ee44a323d..593fc30a31 100644 --- a/internal/test/extensions/param-ref-sibling-omitempty/issue.gen.go +++ b/internal/test/extensions/param-ref-sibling-omitempty/issue.gen.go @@ -22,7 +22,7 @@ type ListThingsParams struct { Filter *FilterValue `form:"filter" json:"filter"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -95,10 +95,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // ListThings request + + // ListThings performs a GET /things (the `ListThings` operationId) request. + ListThings(ctx context.Context, params *ListThingsParams, reqEditors ...RequestEditorFn) (*http.Response, error) } +// ListThings performs a GET /things (the `ListThings` operationId) request. + func (c *Client) ListThings(ctx context.Context, params *ListThingsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListThingsRequest(c.Server, params) if err != nil { @@ -111,7 +115,7 @@ func (c *Client) ListThings(ctx context.Context, params *ListThingsParams, reqEd return c.Client.Do(req) } -// NewListThingsRequest generates requests for ListThings +// NewListThingsRequest constructs an http.Request for the ListThings method func NewListThingsRequest(server string, params *ListThingsParams) (*http.Request, error) { var err error @@ -208,7 +212,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // ListThingsWithResponse request + + // ListThingsWithResponse performs a GET /things (the `ListThings` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ListThingsWithResponse(ctx context.Context, params *ListThingsParams, reqEditors ...RequestEditorFn) (*ListThingsResponse, error) } @@ -246,7 +254,10 @@ func (r ListThingsResponse) ContentType() string { return "" } -// ListThingsWithResponse request returning *ListThingsResponse +// ListThingsWithResponse performs a GET /things (the `ListThings` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) ListThingsWithResponse(ctx context.Context, params *ListThingsParams, reqEditors ...RequestEditorFn) (*ListThingsResponse, error) { rsp, err := c.ListThings(ctx, params, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1039/client.gen.go b/internal/test/issues/issue-1039/client.gen.go index 9e9696094e..a42856c6d3 100644 --- a/internal/test/issues/issue-1039/client.gen.go +++ b/internal/test/issues/issue-1039/client.gen.go @@ -14,7 +14,7 @@ import ( "strings" ) -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -87,12 +87,20 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // ExamplePatchWithBody request with any body + + // ExamplePatchWithBody performs a PATCH /example (the `ExamplePatch` operationId) request, + // with any type of body and a specified content type. + ExamplePatchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // ExamplePatch performs a PATCH /example (the `ExamplePatch` operationId) request, + // Takes a body for the `application/json` content type. ExamplePatch(ctx context.Context, body ExamplePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// ExamplePatchWithBody performs a PATCH /example (the `ExamplePatch` operationId) request, +// with any type of body and a specified content type. + func (c *Client) ExamplePatchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewExamplePatchRequestWithBody(c.Server, contentType, body) if err != nil { @@ -105,6 +113,8 @@ func (c *Client) ExamplePatchWithBody(ctx context.Context, contentType string, b return c.Client.Do(req) } +// ExamplePatch performs a PATCH /example (the `ExamplePatch` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) ExamplePatch(ctx context.Context, body ExamplePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewExamplePatchRequest(c.Server, body) if err != nil { @@ -128,7 +138,7 @@ func NewExamplePatchRequest(server string, body ExamplePatchJSONRequestBody) (*h return NewExamplePatchRequestWithBody(server, "application/json", bodyReader) } -// NewExamplePatchRequestWithBody generates requests for ExamplePatch with any type of body +// NewExamplePatchRequestWithBody constructs an http.Request for the ExamplePatch method, with any body, and a specified content type func NewExamplePatchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -200,9 +210,16 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // ExamplePatchWithBodyWithResponse request with any body + + // ExamplePatchWithBodyWithResponse performs a PATCH /example (the `ExamplePatch` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + ExamplePatchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExamplePatchResponse, error) + // ExamplePatchWithResponse performs a PATCH /example (the `ExamplePatch` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). ExamplePatchWithResponse(ctx context.Context, body ExamplePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*ExamplePatchResponse, error) } @@ -240,7 +257,11 @@ func (r ExamplePatchResponse) ContentType() string { return "" } -// ExamplePatchWithBodyWithResponse request with arbitrary body returning *ExamplePatchResponse +// ExamplePatchWithBodyWithResponse performs a PATCH /example (the `ExamplePatch` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) ExamplePatchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExamplePatchResponse, error) { rsp, err := c.ExamplePatchWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -249,6 +270,8 @@ func (c *ClientWithResponses) ExamplePatchWithBodyWithResponse(ctx context.Conte return ParseExamplePatchResponse(rsp) } +// ExamplePatchWithResponse performs a PATCH /example (the `ExamplePatch` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) ExamplePatchWithResponse(ctx context.Context, body ExamplePatchJSONRequestBody, reqEditors ...RequestEditorFn) (*ExamplePatchResponse, error) { rsp, err := c.ExamplePatch(ctx, body, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1087/api.gen.go b/internal/test/issues/issue-1087/api.gen.go index 527ceb2e45..5d041e849f 100644 --- a/internal/test/issues/issue-1087/api.gen.go +++ b/internal/test/issues/issue-1087/api.gen.go @@ -36,7 +36,7 @@ type ThingResponse = ThingList // bearerAuthWebhookContextKey is the context key for bearerAuthWebhook security scheme type bearerAuthWebhookContextKey string -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -109,10 +109,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetThings request + + // GetThings list things + // + // Corresponds with GET /api/my/path (the `GetThings` operationId). + GetThings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetThings list things +// +// Corresponds with GET /api/my/path (the `GetThings` operationId). + func (c *Client) GetThings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetThingsRequest(c.Server) if err != nil { @@ -125,7 +133,7 @@ func (c *Client) GetThings(ctx context.Context, reqEditors ...RequestEditorFn) ( return c.Client.Do(req) } -// NewGetThingsRequest generates requests for GetThings +// NewGetThingsRequest constructs an http.Request for the GetThings method func NewGetThingsRequest(server string) (*http.Request, error) { var err error @@ -195,7 +203,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetThingsWithResponse request + + // GetThingsWithResponse list things + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /api/my/path (the `GetThings` operationId). + GetThingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetThingsResponse, error) } @@ -209,27 +223,27 @@ type GetThingsResponse struct { JSON500 *externalRef0.DefaultError } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetThingsResponse) GetJSON200() *ThingResponse { return r.JSON200 } -// GetJSON401 returns JSON401 +// GetJSON401 returns the response for an HTTP 401 `application/json` response func (r GetThingsResponse) GetJSON401() *externalRef0.N401 { return r.JSON401 } -// GetJSON403 returns JSON403 +// GetJSON403 returns the response for an HTTP 403 `application/json` response func (r GetThingsResponse) GetJSON403() *externalRef0.N403 { return r.JSON403 } -// GetJSON404 returns JSON404 +// GetJSON404 returns the response for an HTTP 404 `application/json` response func (r GetThingsResponse) GetJSON404() *N404 { return r.JSON404 } -// GetJSON500 returns JSON500 +// GetJSON500 returns the response for an HTTP 500 `application/json` response func (r GetThingsResponse) GetJSON500() *externalRef0.DefaultError { return r.JSON500 } @@ -263,7 +277,12 @@ func (r GetThingsResponse) ContentType() string { return "" } -// GetThingsWithResponse request returning *GetThingsResponse +// GetThingsWithResponse list things +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /api/my/path (the `GetThings` operationId). + func (c *ClientWithResponses) GetThingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetThingsResponse, error) { rsp, err := c.GetThings(ctx, reqEditors...) if err != nil { @@ -334,7 +353,7 @@ func ParseGetThingsResponse(rsp *http.Response) (*GetThingsResponse, error) { // ServerInterface represents all server handlers. type ServerInterface interface { - // list things + // GetThings list things // (GET /api/my/path) GetThings(w http.ResponseWriter, r *http.Request) } @@ -343,7 +362,7 @@ type ServerInterface interface { type Unimplemented struct{} -// list things +// GetThings list things // (GET /api/my/path) func (_ Unimplemented) GetThings(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) diff --git a/internal/test/issues/issue-1180/issue.gen.go b/internal/test/issues/issue-1180/issue.gen.go index 11fe0948f7..d0c0861a85 100644 --- a/internal/test/issues/issue-1180/issue.gen.go +++ b/internal/test/issues/issue-1180/issue.gen.go @@ -20,7 +20,7 @@ import ( "github.com/oapi-codegen/runtime" ) -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -93,10 +93,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetSimplePrimitive request + + // GetSimplePrimitive performs a GET /simplePrimitive/{param} (the `GetSimplePrimitive` operationId) request. + GetSimplePrimitive(ctx context.Context, param string, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetSimplePrimitive performs a GET /simplePrimitive/{param} (the `GetSimplePrimitive` operationId) request. + func (c *Client) GetSimplePrimitive(ctx context.Context, param string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSimplePrimitiveRequest(c.Server, param) if err != nil { @@ -109,7 +113,7 @@ func (c *Client) GetSimplePrimitive(ctx context.Context, param string, reqEditor return c.Client.Do(req) } -// NewGetSimplePrimitiveRequest generates requests for GetSimplePrimitive +// NewGetSimplePrimitiveRequest constructs an http.Request for the GetSimplePrimitive method func NewGetSimplePrimitiveRequest(server string, param string) (*http.Request, error) { var err error @@ -186,7 +190,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetSimplePrimitiveWithResponse request + + // GetSimplePrimitiveWithResponse performs a GET /simplePrimitive/{param} (the `GetSimplePrimitive` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetSimplePrimitiveWithResponse(ctx context.Context, param string, reqEditors ...RequestEditorFn) (*GetSimplePrimitiveResponse, error) } @@ -224,7 +232,10 @@ func (r GetSimplePrimitiveResponse) ContentType() string { return "" } -// GetSimplePrimitiveWithResponse request returning *GetSimplePrimitiveResponse +// GetSimplePrimitiveWithResponse performs a GET /simplePrimitive/{param} (the `GetSimplePrimitive` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetSimplePrimitiveWithResponse(ctx context.Context, param string, reqEditors ...RequestEditorFn) (*GetSimplePrimitiveResponse, error) { rsp, err := c.GetSimplePrimitive(ctx, param, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1182/pkg1/pkg1.gen.go b/internal/test/issues/issue-1182/pkg1/pkg1.gen.go index e02ca358c2..276ea70deb 100644 --- a/internal/test/issues/issue-1182/pkg1/pkg1.gen.go +++ b/internal/test/issues/issue-1182/pkg1/pkg1.gen.go @@ -20,7 +20,7 @@ import ( externalRef0 "github.com/oapi-codegen/oapi-codegen/v2/internal/test/issues/issue-1182/pkg2" ) -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -93,10 +93,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // TestGet request + + // TestGet get test response + // + // Corresponds with GET /test (the `TestGet` operationId). + TestGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// TestGet get test response +// +// Corresponds with GET /test (the `TestGet` operationId). + func (c *Client) TestGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestGetRequest(c.Server) if err != nil { @@ -109,7 +117,7 @@ func (c *Client) TestGet(ctx context.Context, reqEditors ...RequestEditorFn) (*h return c.Client.Do(req) } -// NewTestGetRequest generates requests for TestGet +// NewTestGetRequest constructs an http.Request for the TestGet method func NewTestGetRequest(server string) (*http.Request, error) { var err error @@ -179,7 +187,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // TestGetWithResponse request + + // TestGetWithResponse get test response + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /test (the `TestGet` operationId). + TestGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestGetResponse, error) } @@ -217,7 +231,12 @@ func (r TestGetResponse) ContentType() string { return "" } -// TestGetWithResponse request returning *TestGetResponse +// TestGetWithResponse get test response +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /test (the `TestGet` operationId). + func (c *ClientWithResponses) TestGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestGetResponse, error) { rsp, err := c.TestGet(ctx, reqEditors...) if err != nil { @@ -244,7 +263,7 @@ func ParseTestGetResponse(rsp *http.Response) (*TestGetResponse, error) { // ServerInterface represents all server handlers. type ServerInterface interface { - // get test response + // TestGet get test response // (GET /test) TestGet(ctx echo.Context) error } @@ -330,7 +349,7 @@ func (response TestGet200Response) VisitTestGetResponse(w http.ResponseWriter) e // StrictServerInterface represents all server handlers. type StrictServerInterface interface { - // get test response + // TestGet get test response // (GET /test) TestGet(ctx context.Context, request TestGetRequestObject) (TestGetResponseObject, error) } diff --git a/internal/test/issues/issue-1182/pkg2/pkg2.gen.go b/internal/test/issues/issue-1182/pkg2/pkg2.gen.go index 21ba74e586..3e3bb13056 100644 --- a/internal/test/issues/issue-1182/pkg2/pkg2.gen.go +++ b/internal/test/issues/issue-1182/pkg2/pkg2.gen.go @@ -18,7 +18,7 @@ import ( "github.com/labstack/echo/v4" ) -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. diff --git a/internal/test/issues/issue-1189/issue1189.gen.go b/internal/test/issues/issue-1189/issue1189.gen.go index 0296cf0d90..77644c7c0d 100644 --- a/internal/test/issues/issue-1189/issue1189.gen.go +++ b/internal/test/issues/issue-1189/issue1189.gen.go @@ -231,7 +231,7 @@ func (t *Test_FieldC) UnmarshalJSON(b []byte) error { return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -304,10 +304,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // Test request + + // Test performs a GET /test (the `Test` operationId) request. + Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// Test performs a GET /test (the `Test` operationId) request. + func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestRequest(c.Server) if err != nil { @@ -320,7 +324,7 @@ func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http return c.Client.Do(req) } -// NewTestRequest generates requests for Test +// NewTestRequest constructs an http.Request for the Test method func NewTestRequest(server string) (*http.Request, error) { var err error @@ -390,7 +394,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // TestWithResponse request + + // TestWithResponse performs a GET /test (the `Test` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) } @@ -400,7 +408,7 @@ type TestResponse struct { JSON200 *Test } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r TestResponse) GetJSON200() *Test { return r.JSON200 } @@ -434,7 +442,10 @@ func (r TestResponse) ContentType() string { return "" } -// TestWithResponse request returning *TestResponse +// TestWithResponse performs a GET /test (the `Test` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) { rsp, err := c.Test(ctx, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1208-1209/issue-multi-json.gen.go b/internal/test/issues/issue-1208-1209/issue-multi-json.gen.go index cbd99a6ec8..0d93e2c79a 100644 --- a/internal/test/issues/issue-1208-1209/issue-multi-json.gen.go +++ b/internal/test/issues/issue-1208-1209/issue-multi-json.gen.go @@ -36,7 +36,7 @@ type BazApplicationBarPlusJSON = Bar // BazApplicationFooPlusJSON defines model for baz. type BazApplicationFooPlusJSON = Foo -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -109,10 +109,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // Test request + + // Test performs a GET /test (the `Test` operationId) request. + Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// Test performs a GET /test (the `Test` operationId) request. + func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestRequest(c.Server) if err != nil { @@ -125,7 +129,7 @@ func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http return c.Client.Do(req) } -// NewTestRequest generates requests for Test +// NewTestRequest constructs an http.Request for the Test method func NewTestRequest(server string) (*http.Request, error) { var err error @@ -195,7 +199,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // TestWithResponse request + + // TestWithResponse performs a GET /test (the `Test` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) } @@ -208,22 +216,22 @@ type TestResponse struct { ApplicationfooJSON201 *BazApplicationFooPlusJSON } -// GetApplicationbarJSON200 returns ApplicationbarJSON200 +// GetApplicationbarJSON200 returns the response for an HTTP 200 `application/bar+json` response func (r TestResponse) GetApplicationbarJSON200() *Bar { return r.ApplicationbarJSON200 } -// GetApplicationfooJSON200 returns ApplicationfooJSON200 +// GetApplicationfooJSON200 returns the response for an HTTP 200 `application/foo+json` response func (r TestResponse) GetApplicationfooJSON200() *Foo { return r.ApplicationfooJSON200 } -// GetApplicationbarJSON201 returns ApplicationbarJSON201 +// GetApplicationbarJSON201 returns the response for an HTTP 201 `application/bar+json` response func (r TestResponse) GetApplicationbarJSON201() *BazApplicationBarPlusJSON { return r.ApplicationbarJSON201 } -// GetApplicationfooJSON201 returns ApplicationfooJSON201 +// GetApplicationfooJSON201 returns the response for an HTTP 201 `application/foo+json` response func (r TestResponse) GetApplicationfooJSON201() *BazApplicationFooPlusJSON { return r.ApplicationfooJSON201 } @@ -257,7 +265,10 @@ func (r TestResponse) ContentType() string { return "" } -// TestWithResponse request returning *TestResponse +// TestWithResponse performs a GET /test (the `Test` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) { rsp, err := c.Test(ctx, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1212/pkg1/pkg1.gen.go b/internal/test/issues/issue-1212/pkg1/pkg1.gen.go index 23d6c7db96..8651fcfb84 100644 --- a/internal/test/issues/issue-1212/pkg1/pkg1.gen.go +++ b/internal/test/issues/issue-1212/pkg1/pkg1.gen.go @@ -22,7 +22,7 @@ import ( externalRef0 "github.com/oapi-codegen/oapi-codegen/v2/internal/test/issues/issue-1212/pkg2" ) -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -95,10 +95,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // Test request + + // Test performs a GET /test (the `Test` operationId) request. + Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// Test performs a GET /test (the `Test` operationId) request. + func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestRequest(c.Server) if err != nil { @@ -111,7 +115,7 @@ func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http return c.Client.Do(req) } -// NewTestRequest generates requests for Test +// NewTestRequest constructs an http.Request for the Test method func NewTestRequest(server string) (*http.Request, error) { var err error @@ -181,7 +185,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // TestWithResponse request + + // TestWithResponse performs a GET /test (the `Test` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) } @@ -219,7 +227,10 @@ func (r TestResponse) ContentType() string { return "" } -// TestWithResponse request returning *TestResponse +// TestWithResponse performs a GET /test (the `Test` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) { rsp, err := c.Test(ctx, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1212/pkg2/pkg2.gen.go b/internal/test/issues/issue-1212/pkg2/pkg2.gen.go index 778ed9cbfd..410c82eb2c 100644 --- a/internal/test/issues/issue-1212/pkg2/pkg2.gen.go +++ b/internal/test/issues/issue-1212/pkg2/pkg2.gen.go @@ -29,7 +29,7 @@ type Foo struct { Field1 *string `json:"field1,omitempty"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. diff --git a/internal/test/issues/issue-1277/content-array.gen.go b/internal/test/issues/issue-1277/content-array.gen.go index e2e7846119..6b6818c58b 100644 --- a/internal/test/issues/issue-1277/content-array.gen.go +++ b/internal/test/issues/issue-1277/content-array.gen.go @@ -106,7 +106,7 @@ func (a Test200JSONResponseBody_Item) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -179,10 +179,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // Test request + + // Test performs a GET /test (the `Test` operationId) request. + Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// Test performs a GET /test (the `Test` operationId) request. + func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestRequest(c.Server) if err != nil { @@ -195,7 +199,7 @@ func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http return c.Client.Do(req) } -// NewTestRequest generates requests for Test +// NewTestRequest constructs an http.Request for the Test method func NewTestRequest(server string) (*http.Request, error) { var err error @@ -265,7 +269,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // TestWithResponse request + + // TestWithResponse performs a GET /test (the `Test` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) } @@ -275,7 +283,7 @@ type TestResponse struct { JSON200 *[]Test200JSONResponseBody_Item } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r TestResponse) GetJSON200() *[]Test200JSONResponseBody_Item { return r.JSON200 } @@ -309,7 +317,10 @@ func (r TestResponse) ContentType() string { return "" } -// TestWithResponse request returning *TestResponse +// TestWithResponse performs a GET /test (the `Test` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) { rsp, err := c.Test(ctx, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1298/issue1298.gen.go b/internal/test/issues/issue-1298/issue1298.gen.go index a3229d9c86..fa4af76f10 100644 --- a/internal/test/issues/issue-1298/issue1298.gen.go +++ b/internal/test/issues/issue-1298/issue1298.gen.go @@ -26,7 +26,7 @@ type Test struct { // TestApplicationTestPlusJSONRequestBody defines body for Test for application/test+json ContentType. type TestApplicationTestPlusJSONRequestBody = Test -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -99,12 +99,20 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // TestWithBody request with any body + + // TestWithBody performs a GET /test (the `Test` operationId) request, + // with any type of body and a specified content type. + TestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // Test performs a GET /test (the `Test` operationId) request, + // Takes a body for the `application/test+json` content type. TestWithApplicationTestPlusJSONBody(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// TestWithBody performs a GET /test (the `Test` operationId) request, +// with any type of body and a specified content type. + func (c *Client) TestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestRequestWithBody(c.Server, contentType, body) if err != nil { @@ -117,6 +125,8 @@ func (c *Client) TestWithBody(ctx context.Context, contentType string, body io.R return c.Client.Do(req) } +// Test performs a GET /test (the `Test` operationId) request, +// Takes a body for the `application/test+json` content type. func (c *Client) TestWithApplicationTestPlusJSONBody(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestRequestWithApplicationTestPlusJSONBody(c.Server, body) if err != nil { @@ -140,7 +150,7 @@ func NewTestRequestWithApplicationTestPlusJSONBody(server string, body TestAppli return NewTestRequestWithBody(server, "application/test+json", bodyReader) } -// NewTestRequestWithBody generates requests for Test with any type of body +// NewTestRequestWithBody constructs an http.Request for the Test method, with any body, and a specified content type func NewTestRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -212,9 +222,16 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // TestWithBodyWithResponse request with any body + + // TestWithBodyWithResponse performs a GET /test (the `Test` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + TestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TestResponse, error) + // TestWithResponse performs a GET /test (the `Test` operationId) request, + // Takes a body of the `application/test+json` content type, and returns a wrapper object for the known response body format(s). TestWithApplicationTestPlusJSONBodyWithResponse(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*TestResponse, error) } @@ -252,7 +269,11 @@ func (r TestResponse) ContentType() string { return "" } -// TestWithBodyWithResponse request with arbitrary body returning *TestResponse +// TestWithBodyWithResponse performs a GET /test (the `Test` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) TestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TestResponse, error) { rsp, err := c.TestWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -261,6 +282,8 @@ func (c *ClientWithResponses) TestWithBodyWithResponse(ctx context.Context, cont return ParseTestResponse(rsp) } +// TestWithResponse performs a GET /test (the `Test` operationId) request, +// Takes a body of the `application/test+json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) TestWithApplicationTestPlusJSONBodyWithResponse(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*TestResponse, error) { rsp, err := c.TestWithApplicationTestPlusJSONBody(ctx, body, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1397/issue1397.gen.go b/internal/test/issues/issue-1397/issue1397.gen.go index 4ff816ae40..a56b168453 100644 --- a/internal/test/issues/issue-1397/issue1397.gen.go +++ b/internal/test/issues/issue-1397/issue1397.gen.go @@ -68,7 +68,7 @@ type MyTestRequest struct { // TestApplicationTestPlusJSONRequestBody defines body for Test for application/test+json ContentType. type TestApplicationTestPlusJSONRequestBody = Test -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -141,12 +141,20 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // TestWithBody request with any body + + // TestWithBody performs a GET /test (the `Test` operationId) request, + // with any type of body and a specified content type. + TestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // Test performs a GET /test (the `Test` operationId) request, + // Takes a body for the `application/test+json` content type. TestWithApplicationTestPlusJSONBody(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// TestWithBody performs a GET /test (the `Test` operationId) request, +// with any type of body and a specified content type. + func (c *Client) TestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestRequestWithBody(c.Server, contentType, body) if err != nil { @@ -159,6 +167,8 @@ func (c *Client) TestWithBody(ctx context.Context, contentType string, body io.R return c.Client.Do(req) } +// Test performs a GET /test (the `Test` operationId) request, +// Takes a body for the `application/test+json` content type. func (c *Client) TestWithApplicationTestPlusJSONBody(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestRequestWithApplicationTestPlusJSONBody(c.Server, body) if err != nil { @@ -182,7 +192,7 @@ func NewTestRequestWithApplicationTestPlusJSONBody(server string, body TestAppli return NewTestRequestWithBody(server, "application/test+json", bodyReader) } -// NewTestRequestWithBody generates requests for Test with any type of body +// NewTestRequestWithBody constructs an http.Request for the Test method, with any body, and a specified content type func NewTestRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -254,9 +264,16 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // TestWithBodyWithResponse request with any body + + // TestWithBodyWithResponse performs a GET /test (the `Test` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + TestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TestResponse, error) + // TestWithResponse performs a GET /test (the `Test` operationId) request, + // Takes a body of the `application/test+json` content type, and returns a wrapper object for the known response body format(s). TestWithApplicationTestPlusJSONBodyWithResponse(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*TestResponse, error) } @@ -294,7 +311,11 @@ func (r TestResponse) ContentType() string { return "" } -// TestWithBodyWithResponse request with arbitrary body returning *TestResponse +// TestWithBodyWithResponse performs a GET /test (the `Test` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) TestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TestResponse, error) { rsp, err := c.TestWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -303,6 +324,8 @@ func (c *ClientWithResponses) TestWithBodyWithResponse(ctx context.Context, cont return ParseTestResponse(rsp) } +// TestWithResponse performs a GET /test (the `Test` operationId) request, +// Takes a body of the `application/test+json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) TestWithApplicationTestPlusJSONBodyWithResponse(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*TestResponse, error) { rsp, err := c.TestWithApplicationTestPlusJSONBody(ctx, body, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1529/strict-echo/issue1529.gen.go b/internal/test/issues/issue-1529/strict-echo/issue1529.gen.go index 349d34a553..19b8ac331f 100644 --- a/internal/test/issues/issue-1529/strict-echo/issue1529.gen.go +++ b/internal/test/issues/issue-1529/strict-echo/issue1529.gen.go @@ -23,7 +23,7 @@ import ( // Test defines model for Test. type Test = map[string]interface{} -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -96,10 +96,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // Test request + + // Test performs a GET /test (the `Test` operationId) request. + Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// Test performs a GET /test (the `Test` operationId) request. + func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestRequest(c.Server) if err != nil { @@ -112,7 +116,7 @@ func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http return c.Client.Do(req) } -// NewTestRequest generates requests for Test +// NewTestRequest constructs an http.Request for the Test method func NewTestRequest(server string) (*http.Request, error) { var err error @@ -182,7 +186,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // TestWithResponse request + + // TestWithResponse performs a GET /test (the `Test` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) } @@ -194,17 +202,17 @@ type TestResponse struct { ApplicationjsonProfileFoo200 *Test } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r TestResponse) GetJSON200() *Test { return r.JSON200 } -// GetApplicationjsonProfileBar200 returns ApplicationjsonProfileBar200 +// GetApplicationjsonProfileBar200 returns the response for an HTTP 200 `application/json; profile="Bar"` response func (r TestResponse) GetApplicationjsonProfileBar200() *Test { return r.ApplicationjsonProfileBar200 } -// GetApplicationjsonProfileFoo200 returns ApplicationjsonProfileFoo200 +// GetApplicationjsonProfileFoo200 returns the response for an HTTP 200 `application/json; profile="Foo"` response func (r TestResponse) GetApplicationjsonProfileFoo200() *Test { return r.ApplicationjsonProfileFoo200 } @@ -238,7 +246,10 @@ func (r TestResponse) ContentType() string { return "" } -// TestWithResponse request returning *TestResponse +// TestWithResponse performs a GET /test (the `Test` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) { rsp, err := c.Test(ctx, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1529/strict-fiber/issue1529.gen.go b/internal/test/issues/issue-1529/strict-fiber/issue1529.gen.go index 81bb0fad22..eb4a22e37a 100644 --- a/internal/test/issues/issue-1529/strict-fiber/issue1529.gen.go +++ b/internal/test/issues/issue-1529/strict-fiber/issue1529.gen.go @@ -23,7 +23,7 @@ import ( // Test defines model for Test. type Test = map[string]interface{} -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -96,10 +96,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // Test request + + // Test performs a GET /test (the `Test` operationId) request. + Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// Test performs a GET /test (the `Test` operationId) request. + func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestRequest(c.Server) if err != nil { @@ -112,7 +116,7 @@ func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http return c.Client.Do(req) } -// NewTestRequest generates requests for Test +// NewTestRequest constructs an http.Request for the Test method func NewTestRequest(server string) (*http.Request, error) { var err error @@ -182,7 +186,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // TestWithResponse request + + // TestWithResponse performs a GET /test (the `Test` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) } @@ -194,17 +202,17 @@ type TestResponse struct { ApplicationjsonProfileFoo200 *Test } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r TestResponse) GetJSON200() *Test { return r.JSON200 } -// GetApplicationjsonProfileBar200 returns ApplicationjsonProfileBar200 +// GetApplicationjsonProfileBar200 returns the response for an HTTP 200 `application/json; profile="Bar"` response func (r TestResponse) GetApplicationjsonProfileBar200() *Test { return r.ApplicationjsonProfileBar200 } -// GetApplicationjsonProfileFoo200 returns ApplicationjsonProfileFoo200 +// GetApplicationjsonProfileFoo200 returns the response for an HTTP 200 `application/json; profile="Foo"` response func (r TestResponse) GetApplicationjsonProfileFoo200() *Test { return r.ApplicationjsonProfileFoo200 } @@ -238,7 +246,10 @@ func (r TestResponse) ContentType() string { return "" } -// TestWithResponse request returning *TestResponse +// TestWithResponse performs a GET /test (the `Test` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) { rsp, err := c.Test(ctx, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1529/strict-iris/issue1529.gen.go b/internal/test/issues/issue-1529/strict-iris/issue1529.gen.go index 69478c9163..ea1baa9437 100644 --- a/internal/test/issues/issue-1529/strict-iris/issue1529.gen.go +++ b/internal/test/issues/issue-1529/strict-iris/issue1529.gen.go @@ -23,7 +23,7 @@ import ( // Test defines model for Test. type Test = map[string]interface{} -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -96,10 +96,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // Test request + + // Test performs a GET /test (the `Test` operationId) request. + Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// Test performs a GET /test (the `Test` operationId) request. + func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTestRequest(c.Server) if err != nil { @@ -112,7 +116,7 @@ func (c *Client) Test(ctx context.Context, reqEditors ...RequestEditorFn) (*http return c.Client.Do(req) } -// NewTestRequest generates requests for Test +// NewTestRequest constructs an http.Request for the Test method func NewTestRequest(server string) (*http.Request, error) { var err error @@ -182,7 +186,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // TestWithResponse request + + // TestWithResponse performs a GET /test (the `Test` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) } @@ -194,17 +202,17 @@ type TestResponse struct { ApplicationjsonProfileFoo200 *Test } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r TestResponse) GetJSON200() *Test { return r.JSON200 } -// GetApplicationjsonProfileBar200 returns ApplicationjsonProfileBar200 +// GetApplicationjsonProfileBar200 returns the response for an HTTP 200 `application/json; profile="Bar"` response func (r TestResponse) GetApplicationjsonProfileBar200() *Test { return r.ApplicationjsonProfileBar200 } -// GetApplicationjsonProfileFoo200 returns ApplicationjsonProfileFoo200 +// GetApplicationjsonProfileFoo200 returns the response for an HTTP 200 `application/json; profile="Foo"` response func (r TestResponse) GetApplicationjsonProfileFoo200() *Test { return r.ApplicationjsonProfileFoo200 } @@ -238,7 +246,10 @@ func (r TestResponse) ContentType() string { return "" } -// TestWithResponse request returning *TestResponse +// TestWithResponse performs a GET /test (the `Test` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error) { rsp, err := c.Test(ctx, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-1914/client.gen.go b/internal/test/issues/issue-1914/client.gen.go index 4417fe5a8d..da97cc5997 100644 --- a/internal/test/issues/issue-1914/client.gen.go +++ b/internal/test/issues/issue-1914/client.gen.go @@ -26,7 +26,7 @@ type PostPetTextRequestBody = PostPetTextBody // PostPet1234TextRequestBody defines body for PostPet1234 for text/plain ContentType. type PostPet1234TextRequestBody = PostPet1234TextBody -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -99,17 +99,29 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // PostPetWithBody request with any body + + // PostPetWithBody performs a POST /pet (the `PostPet` operationId) request, + // with any type of body and a specified content type. + PostPetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostPet performs a POST /pet (the `PostPet` operationId) request, + // Takes a body for the `text/plain` content type. PostPetWithTextBody(ctx context.Context, body PostPetTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostPet1234WithBody request with any body + // PostPet1234WithBody performs a POST /pet/1234 (the `PostPet1234` operationId) request, + // with any type of body and a specified content type. + PostPet1234WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostPet1234 performs a POST /pet/1234 (the `PostPet1234` operationId) request, + // Takes a body for the `text/plain` content type. PostPet1234WithTextBody(ctx context.Context, body PostPet1234TextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// PostPetWithBody performs a POST /pet (the `PostPet` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostPetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostPetRequestWithBody(c.Server, contentType, body) if err != nil { @@ -122,6 +134,8 @@ func (c *Client) PostPetWithBody(ctx context.Context, contentType string, body i return c.Client.Do(req) } +// PostPet performs a POST /pet (the `PostPet` operationId) request, +// Takes a body for the `text/plain` content type. func (c *Client) PostPetWithTextBody(ctx context.Context, body PostPetTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostPetRequestWithTextBody(c.Server, body) if err != nil { @@ -134,6 +148,9 @@ func (c *Client) PostPetWithTextBody(ctx context.Context, body PostPetTextReques return c.Client.Do(req) } +// PostPet1234WithBody performs a POST /pet/1234 (the `PostPet1234` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostPet1234WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostPet1234RequestWithBody(c.Server, contentType, body) if err != nil { @@ -146,6 +163,8 @@ func (c *Client) PostPet1234WithBody(ctx context.Context, contentType string, bo return c.Client.Do(req) } +// PostPet1234 performs a POST /pet/1234 (the `PostPet1234` operationId) request, +// Takes a body for the `text/plain` content type. func (c *Client) PostPet1234WithTextBody(ctx context.Context, body PostPet1234TextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostPet1234RequestWithTextBody(c.Server, body) if err != nil { @@ -169,7 +188,7 @@ func NewPostPetRequestWithTextBody(server string, body PostPetTextRequestBody) ( return NewPostPetRequestWithBody(server, "text/plain", bodyReader) } -// NewPostPetRequestWithBody generates requests for PostPet with any type of body +// NewPostPetRequestWithBody constructs an http.Request for the PostPet method, with any body, and a specified content type func NewPostPetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -209,7 +228,7 @@ func NewPostPet1234RequestWithTextBody(server string, body PostPet1234TextReques return NewPostPet1234RequestWithBody(server, "text/plain", bodyReader) } -// NewPostPet1234RequestWithBody generates requests for PostPet1234 with any type of body +// NewPostPet1234RequestWithBody constructs an http.Request for the PostPet1234 method, with any body, and a specified content type func NewPostPet1234RequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -281,14 +300,27 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // PostPetWithBodyWithResponse request with any body + + // PostPetWithBodyWithResponse performs a POST /pet (the `PostPet` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostPetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPetResponse, error) + // PostPetWithResponse performs a POST /pet (the `PostPet` operationId) request, + // Takes a body of the `text/plain` content type, and returns a wrapper object for the known response body format(s). PostPetWithTextBodyWithResponse(ctx context.Context, body PostPetTextRequestBody, reqEditors ...RequestEditorFn) (*PostPetResponse, error) - // PostPet1234WithBodyWithResponse request with any body + // PostPet1234WithBodyWithResponse performs a POST /pet/1234 (the `PostPet1234` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostPet1234WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPet1234Response, error) + // PostPet1234WithResponse performs a POST /pet/1234 (the `PostPet1234` operationId) request, + // Takes a body of the `text/plain` content type, and returns a wrapper object for the known response body format(s). PostPet1234WithTextBodyWithResponse(ctx context.Context, body PostPet1234TextRequestBody, reqEditors ...RequestEditorFn) (*PostPet1234Response, error) } @@ -360,7 +392,11 @@ func (r PostPet1234Response) ContentType() string { return "" } -// PostPetWithBodyWithResponse request with arbitrary body returning *PostPetResponse +// PostPetWithBodyWithResponse performs a POST /pet (the `PostPet` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostPetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPetResponse, error) { rsp, err := c.PostPetWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -369,6 +405,8 @@ func (c *ClientWithResponses) PostPetWithBodyWithResponse(ctx context.Context, c return ParsePostPetResponse(rsp) } +// PostPetWithResponse performs a POST /pet (the `PostPet` operationId) request, +// Takes a body of the `text/plain` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostPetWithTextBodyWithResponse(ctx context.Context, body PostPetTextRequestBody, reqEditors ...RequestEditorFn) (*PostPetResponse, error) { rsp, err := c.PostPetWithTextBody(ctx, body, reqEditors...) if err != nil { @@ -377,7 +415,11 @@ func (c *ClientWithResponses) PostPetWithTextBodyWithResponse(ctx context.Contex return ParsePostPetResponse(rsp) } -// PostPet1234WithBodyWithResponse request with arbitrary body returning *PostPet1234Response +// PostPet1234WithBodyWithResponse performs a POST /pet/1234 (the `PostPet1234` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostPet1234WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPet1234Response, error) { rsp, err := c.PostPet1234WithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -386,6 +428,8 @@ func (c *ClientWithResponses) PostPet1234WithBodyWithResponse(ctx context.Contex return ParsePostPet1234Response(rsp) } +// PostPet1234WithResponse performs a POST /pet/1234 (the `PostPet1234` operationId) request, +// Takes a body of the `text/plain` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostPet1234WithTextBodyWithResponse(ctx context.Context, body PostPet1234TextRequestBody, reqEditors ...RequestEditorFn) (*PostPet1234Response, error) { rsp, err := c.PostPet1234WithTextBody(ctx, body, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-2031/prefer/issue2031.gen.go b/internal/test/issues/issue-2031/prefer/issue2031.gen.go index e37c69d6a1..001f9d3c67 100644 --- a/internal/test/issues/issue-2031/prefer/issue2031.gen.go +++ b/internal/test/issues/issue-2031/prefer/issue2031.gen.go @@ -19,7 +19,7 @@ type GetTestParams struct { UserIds []int `form:"user_ids[],omitempty" json:"user_ids[],omitempty"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -92,10 +92,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetTest request + + // GetTest performs a GET /test (the `GetTest` operationId) request. + GetTest(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetTest performs a GET /test (the `GetTest` operationId) request. + func (c *Client) GetTest(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetTestRequest(c.Server, params) if err != nil { @@ -108,7 +112,7 @@ func (c *Client) GetTest(ctx context.Context, params *GetTestParams, reqEditors return c.Client.Do(req) } -// NewGetTestRequest generates requests for GetTest +// NewGetTestRequest constructs an http.Request for the GetTest method func NewGetTestRequest(server string, params *GetTestParams) (*http.Request, error) { var err error @@ -205,7 +209,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetTestWithResponse request + + // GetTestWithResponse performs a GET /test (the `GetTest` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetTestWithResponse(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*GetTestResponse, error) } @@ -243,7 +251,10 @@ func (r GetTestResponse) ContentType() string { return "" } -// GetTestWithResponse request returning *GetTestResponse +// GetTestWithResponse performs a GET /test (the `GetTest` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetTestWithResponse(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*GetTestResponse, error) { rsp, err := c.GetTest(ctx, params, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-2190/issue2190.gen.go b/internal/test/issues/issue-2190/issue2190.gen.go index cddf869b5d..8a7c55515c 100644 --- a/internal/test/issues/issue-2190/issue2190.gen.go +++ b/internal/test/issues/issue-2190/issue2190.gen.go @@ -19,7 +19,7 @@ import ( // Success defines model for Success. type Success = string -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -92,10 +92,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetTest request + + // GetTest performs a GET /v1/test (the `GetTest` operationId) request. + GetTest(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetTest performs a GET /v1/test (the `GetTest` operationId) request. + func (c *Client) GetTest(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetTestRequest(c.Server) if err != nil { @@ -108,7 +112,7 @@ func (c *Client) GetTest(ctx context.Context, reqEditors ...RequestEditorFn) (*h return c.Client.Do(req) } -// NewGetTestRequest generates requests for GetTest +// NewGetTestRequest constructs an http.Request for the GetTest method func NewGetTestRequest(server string) (*http.Request, error) { var err error @@ -178,7 +182,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetTestWithResponse request + + // GetTestWithResponse performs a GET /v1/test (the `GetTest` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetTestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTestResponse, error) } @@ -188,7 +196,7 @@ type GetTestResponse struct { JSON200 *Success } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetTestResponse) GetJSON200() *Success { return r.JSON200 } @@ -222,7 +230,10 @@ func (r GetTestResponse) ContentType() string { return "" } -// GetTestWithResponse request returning *GetTestResponse +// GetTestWithResponse performs a GET /v1/test (the `GetTest` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetTestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTestResponse, error) { rsp, err := c.GetTest(ctx, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-2238/issue2238.gen.go b/internal/test/issues/issue-2238/issue2238.gen.go index 11d329f7d4..5fcf71ebf2 100644 --- a/internal/test/issues/issue-2238/issue2238.gen.go +++ b/internal/test/issues/issue-2238/issue2238.gen.go @@ -20,7 +20,7 @@ type GetTestParams struct { Tags []string `form:"tags,omitempty" json:"tags,omitempty"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -93,10 +93,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetTest request + + // GetTest performs a GET /test (the `GetTest` operationId) request. + GetTest(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetTest performs a GET /test (the `GetTest` operationId) request. + func (c *Client) GetTest(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetTestRequest(c.Server, params) if err != nil { @@ -109,7 +113,7 @@ func (c *Client) GetTest(ctx context.Context, params *GetTestParams, reqEditors return c.Client.Do(req) } -// NewGetTestRequest generates requests for GetTest +// NewGetTestRequest constructs an http.Request for the GetTest method func NewGetTestRequest(server string, params *GetTestParams) (*http.Request, error) { var err error @@ -211,7 +215,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetTestWithResponse request + + // GetTestWithResponse performs a GET /test (the `GetTest` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetTestWithResponse(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*GetTestResponse, error) } @@ -249,7 +257,10 @@ func (r GetTestResponse) ContentType() string { return "" } -// GetTestWithResponse request returning *GetTestResponse +// GetTestWithResponse performs a GET /test (the `GetTest` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetTestWithResponse(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*GetTestResponse, error) { rsp, err := c.GetTest(ctx, params, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-2329/issue2329.gen.go b/internal/test/issues/issue-2329/issue2329.gen.go index 0248c2fd11..9464bd9a88 100644 --- a/internal/test/issues/issue-2329/issue2329.gen.go +++ b/internal/test/issues/issue-2329/issue2329.gen.go @@ -115,7 +115,7 @@ func (a Thing) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -188,15 +188,23 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // ListThings request + + // ListThings performs a GET /things (the `ListThings` operationId) request. + ListThings(ctx context.Context, params *ListThingsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateThingWithBody request with any body + // CreateThingWithBody performs a POST /things (the `CreateThing` operationId) request, + // with any type of body and a specified content type. + CreateThingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateThing performs a POST /things (the `CreateThing` operationId) request, + // Takes a body for the `application/json` content type. CreateThing(ctx context.Context, body CreateThingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// ListThings performs a GET /things (the `ListThings` operationId) request. + func (c *Client) ListThings(ctx context.Context, params *ListThingsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListThingsRequest(c.Server, params) if err != nil { @@ -209,6 +217,9 @@ func (c *Client) ListThings(ctx context.Context, params *ListThingsParams, reqEd return c.Client.Do(req) } +// CreateThingWithBody performs a POST /things (the `CreateThing` operationId) request, +// with any type of body and a specified content type. + func (c *Client) CreateThingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateThingRequestWithBody(c.Server, contentType, body) if err != nil { @@ -221,6 +232,8 @@ func (c *Client) CreateThingWithBody(ctx context.Context, contentType string, bo return c.Client.Do(req) } +// CreateThing performs a POST /things (the `CreateThing` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) CreateThing(ctx context.Context, body CreateThingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateThingRequest(c.Server, body) if err != nil { @@ -233,7 +246,7 @@ func (c *Client) CreateThing(ctx context.Context, body CreateThingJSONRequestBod return c.Client.Do(req) } -// NewListThingsRequest generates requests for ListThings +// NewListThingsRequest constructs an http.Request for the ListThings method func NewListThingsRequest(server string, params *ListThingsParams) (*http.Request, error) { var err error @@ -310,7 +323,7 @@ func NewCreateThingRequest(server string, body CreateThingJSONRequestBody) (*htt return NewCreateThingRequestWithBody(server, "application/json", bodyReader) } -// NewCreateThingRequestWithBody generates requests for CreateThing with any type of body +// NewCreateThingRequestWithBody constructs an http.Request for the CreateThing method, with any body, and a specified content type func NewCreateThingRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -382,12 +395,22 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // ListThingsWithResponse request + + // ListThingsWithResponse performs a GET /things (the `ListThings` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ListThingsWithResponse(ctx context.Context, params *ListThingsParams, reqEditors ...RequestEditorFn) (*ListThingsResponse, error) - // CreateThingWithBodyWithResponse request with any body + // CreateThingWithBodyWithResponse performs a POST /things (the `CreateThing` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + CreateThingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateThingResponse, error) + // CreateThingWithResponse performs a POST /things (the `CreateThing` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). CreateThingWithResponse(ctx context.Context, body CreateThingJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateThingResponse, error) } @@ -459,7 +482,10 @@ func (r CreateThingResponse) ContentType() string { return "" } -// ListThingsWithResponse request returning *ListThingsResponse +// ListThingsWithResponse performs a GET /things (the `ListThings` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) ListThingsWithResponse(ctx context.Context, params *ListThingsParams, reqEditors ...RequestEditorFn) (*ListThingsResponse, error) { rsp, err := c.ListThings(ctx, params, reqEditors...) if err != nil { @@ -468,7 +494,11 @@ func (c *ClientWithResponses) ListThingsWithResponse(ctx context.Context, params return ParseListThingsResponse(rsp) } -// CreateThingWithBodyWithResponse request with arbitrary body returning *CreateThingResponse +// CreateThingWithBodyWithResponse performs a POST /things (the `CreateThing` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) CreateThingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateThingResponse, error) { rsp, err := c.CreateThingWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -477,6 +507,8 @@ func (c *ClientWithResponses) CreateThingWithBodyWithResponse(ctx context.Contex return ParseCreateThingResponse(rsp) } +// CreateThingWithResponse performs a POST /things (the `CreateThing` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) CreateThingWithResponse(ctx context.Context, body CreateThingJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateThingResponse, error) { rsp, err := c.CreateThing(ctx, body, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-312/issue.gen.go b/internal/test/issues/issue-312/issue.gen.go index 25763f9374..1d440fc381 100644 --- a/internal/test/issues/issue-312/issue.gen.go +++ b/internal/test/issues/issue-312/issue.gen.go @@ -45,7 +45,7 @@ type PetNames struct { // ValidatePetsJSONRequestBody defines body for ValidatePets for application/json ContentType. type ValidatePetsJSONRequestBody = PetNames -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -118,15 +118,33 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetPet request + + // GetPet Get pet given identifier. + // + // Corresponds with GET /pets/{petId} (the `GetPet` operationId). + GetPet(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*http.Response, error) - // ValidatePetsWithBody request with any body + // ValidatePetsWithBody Validate pets + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /pets:validate (the `ValidatePets` operationId). + ValidatePetsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // ValidatePets Validate pets + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /pets:validate (the `ValidatePets` operationId). ValidatePets(ctx context.Context, body ValidatePetsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetPet Get pet given identifier. +// +// Corresponds with GET /pets/{petId} (the `GetPet` operationId). + func (c *Client) GetPet(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetPetRequest(c.Server, petId) if err != nil { @@ -139,6 +157,12 @@ func (c *Client) GetPet(ctx context.Context, petId string, reqEditors ...Request return c.Client.Do(req) } +// ValidatePetsWithBody Validate pets +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /pets:validate (the `ValidatePets` operationId). + func (c *Client) ValidatePetsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewValidatePetsRequestWithBody(c.Server, contentType, body) if err != nil { @@ -151,6 +175,11 @@ func (c *Client) ValidatePetsWithBody(ctx context.Context, contentType string, b return c.Client.Do(req) } +// ValidatePets Validate pets +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /pets:validate (the `ValidatePets` operationId). func (c *Client) ValidatePets(ctx context.Context, body ValidatePetsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewValidatePetsRequest(c.Server, body) if err != nil { @@ -163,7 +192,7 @@ func (c *Client) ValidatePets(ctx context.Context, body ValidatePetsJSONRequestB return c.Client.Do(req) } -// NewGetPetRequest generates requests for GetPet +// NewGetPetRequest constructs an http.Request for the GetPet method func NewGetPetRequest(server string, petId string) (*http.Request, error) { var err error @@ -208,7 +237,7 @@ func NewValidatePetsRequest(server string, body ValidatePetsJSONRequestBody) (*h return NewValidatePetsRequestWithBody(server, "application/json", bodyReader) } -// NewValidatePetsRequestWithBody generates requests for ValidatePets with any type of body +// NewValidatePetsRequestWithBody constructs an http.Request for the ValidatePets method, with any body, and a specified content type func NewValidatePetsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -280,12 +309,28 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetPetWithResponse request + + // GetPetWithResponse Get pet given identifier. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /pets/{petId} (the `GetPet` operationId). + GetPetWithResponse(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*GetPetResponse, error) - // ValidatePetsWithBodyWithResponse request with any body + // ValidatePetsWithBodyWithResponse Validate pets + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /pets:validate (the `ValidatePets` operationId). + ValidatePetsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidatePetsResponse, error) + // ValidatePetsWithResponse Validate pets + // + // Takes a body for the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /pets:validate (the `ValidatePets` operationId). ValidatePetsWithResponse(ctx context.Context, body ValidatePetsJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidatePetsResponse, error) } @@ -295,7 +340,7 @@ type GetPetResponse struct { JSON200 *Pet } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetPetResponse) GetJSON200() *Pet { return r.JSON200 } @@ -336,12 +381,12 @@ type ValidatePetsResponse struct { JSONDefault *Error } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ValidatePetsResponse) GetJSON200() *[]Pet { return r.JSON200 } -// GetJSONDefault returns JSONDefault +// GetJSONDefault returns the response for an HTTP default `application/json` response func (r ValidatePetsResponse) GetJSONDefault() *Error { return r.JSONDefault } @@ -375,7 +420,12 @@ func (r ValidatePetsResponse) ContentType() string { return "" } -// GetPetWithResponse request returning *GetPetResponse +// GetPetWithResponse Get pet given identifier. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /pets/{petId} (the `GetPet` operationId). + func (c *ClientWithResponses) GetPetWithResponse(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*GetPetResponse, error) { rsp, err := c.GetPet(ctx, petId, reqEditors...) if err != nil { @@ -384,7 +434,12 @@ func (c *ClientWithResponses) GetPetWithResponse(ctx context.Context, petId stri return ParseGetPetResponse(rsp) } -// ValidatePetsWithBodyWithResponse request with arbitrary body returning *ValidatePetsResponse +// ValidatePetsWithBodyWithResponse Validate pets +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /pets:validate (the `ValidatePets` operationId). + func (c *ClientWithResponses) ValidatePetsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ValidatePetsResponse, error) { rsp, err := c.ValidatePetsWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -393,6 +448,11 @@ func (c *ClientWithResponses) ValidatePetsWithBodyWithResponse(ctx context.Conte return ParseValidatePetsResponse(rsp) } +// ValidatePetsWithResponse Validate pets +// +// Takes a body for the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /pets:validate (the `ValidatePets` operationId). func (c *ClientWithResponses) ValidatePetsWithResponse(ctx context.Context, body ValidatePetsJSONRequestBody, reqEditors ...RequestEditorFn) (*ValidatePetsResponse, error) { rsp, err := c.ValidatePets(ctx, body, reqEditors...) if err != nil { @@ -462,10 +522,10 @@ func ParseValidatePetsResponse(rsp *http.Response) (*ValidatePetsResponse, error // ServerInterface represents all server handlers. type ServerInterface interface { - // Get pet given identifier. + // GetPet Get pet given identifier. // (GET /pets/{petId}) GetPet(ctx echo.Context, petId string) error - // Validate pets + // ValidatePets Validate pets // (POST /pets:validate) ValidatePets(ctx echo.Context) error } diff --git a/internal/test/issues/issue-52/issue.gen.go b/internal/test/issues/issue-52/issue.gen.go index 5e0a502a4c..d0b4665e92 100644 --- a/internal/test/issues/issue-52/issue.gen.go +++ b/internal/test/issues/issue-52/issue.gen.go @@ -34,7 +34,7 @@ type Value struct { StringValue *string `json:"stringValue,omitempty"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -107,10 +107,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // ExampleGet request + + // ExampleGet performs a GET /example (the `ExampleGet` operationId) request. + ExampleGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// ExampleGet performs a GET /example (the `ExampleGet` operationId) request. + func (c *Client) ExampleGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewExampleGetRequest(c.Server) if err != nil { @@ -123,7 +127,7 @@ func (c *Client) ExampleGet(ctx context.Context, reqEditors ...RequestEditorFn) return c.Client.Do(req) } -// NewExampleGetRequest generates requests for ExampleGet +// NewExampleGetRequest constructs an http.Request for the ExampleGet method func NewExampleGetRequest(server string) (*http.Request, error) { var err error @@ -193,7 +197,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // ExampleGetWithResponse request + + // ExampleGetWithResponse performs a GET /example (the `ExampleGet` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ExampleGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ExampleGetResponse, error) } @@ -203,7 +211,7 @@ type ExampleGetResponse struct { JSON200 *Document } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ExampleGetResponse) GetJSON200() *Document { return r.JSON200 } @@ -237,7 +245,10 @@ func (r ExampleGetResponse) ContentType() string { return "" } -// ExampleGetWithResponse request returning *ExampleGetResponse +// ExampleGetWithResponse performs a GET /example (the `ExampleGet` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) ExampleGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ExampleGetResponse, error) { rsp, err := c.ExampleGet(ctx, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-grab_import_names/issue.gen.go b/internal/test/issues/issue-grab_import_names/issue.gen.go index 08e66b4fcb..852a9029f8 100644 --- a/internal/test/issues/issue-grab_import_names/issue.gen.go +++ b/internal/test/issues/issue-grab_import_names/issue.gen.go @@ -30,7 +30,7 @@ type GetFooParams struct { Bar *string `json:"Bar,omitempty"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -103,10 +103,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetFoo request + + // GetFoo performs a GET /foo (the `GetFoo` operationId) request. + GetFoo(ctx context.Context, params *GetFooParams, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetFoo performs a GET /foo (the `GetFoo` operationId) request. + func (c *Client) GetFoo(ctx context.Context, params *GetFooParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetFooRequest(c.Server, params) if err != nil { @@ -119,7 +123,7 @@ func (c *Client) GetFoo(ctx context.Context, params *GetFooParams, reqEditors .. return c.Client.Do(req) } -// NewGetFooRequest generates requests for GetFoo +// NewGetFooRequest constructs an http.Request for the GetFoo method func NewGetFooRequest(server string, params *GetFooParams) (*http.Request, error) { var err error @@ -215,7 +219,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetFooWithResponse request + + // GetFooWithResponse performs a GET /foo (the `GetFoo` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetFooWithResponse(ctx context.Context, params *GetFooParams, reqEditors ...RequestEditorFn) (*GetFooResponse, error) } @@ -225,7 +233,7 @@ type GetFooResponse struct { JSON200 *string } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetFooResponse) GetJSON200() *string { return r.JSON200 } @@ -259,7 +267,10 @@ func (r GetFooResponse) ContentType() string { return "" } -// GetFooWithResponse request returning *GetFooResponse +// GetFooWithResponse performs a GET /foo (the `GetFoo` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetFooWithResponse(ctx context.Context, params *GetFooParams, reqEditors ...RequestEditorFn) (*GetFooResponse, error) { rsp, err := c.GetFoo(ctx, params, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue-illegal_enum_names/issue.gen.go b/internal/test/issues/issue-illegal_enum_names/issue.gen.go index 09859b13cd..2dd9825b18 100644 --- a/internal/test/issues/issue-illegal_enum_names/issue.gen.go +++ b/internal/test/issues/issue-illegal_enum_names/issue.gen.go @@ -65,7 +65,7 @@ func (e Bar) Valid() bool { // Bar defines model for Bar. type Bar string -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -138,10 +138,14 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetFoo request + + // GetFoo performs a GET /foo (the `GetFoo` operationId) request. + GetFoo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetFoo performs a GET /foo (the `GetFoo` operationId) request. + func (c *Client) GetFoo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetFooRequest(c.Server) if err != nil { @@ -154,7 +158,7 @@ func (c *Client) GetFoo(ctx context.Context, reqEditors ...RequestEditorFn) (*ht return c.Client.Do(req) } -// NewGetFooRequest generates requests for GetFoo +// NewGetFooRequest constructs an http.Request for the GetFoo method func NewGetFooRequest(server string) (*http.Request, error) { var err error @@ -224,7 +228,11 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetFooWithResponse request + + // GetFooWithResponse performs a GET /foo (the `GetFoo` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetFooWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFooResponse, error) } @@ -234,7 +242,7 @@ type GetFooResponse struct { JSON200 *[]Bar } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetFooResponse) GetJSON200() *[]Bar { return r.JSON200 } @@ -268,7 +276,10 @@ func (r GetFooResponse) ContentType() string { return "" } -// GetFooWithResponse request returning *GetFooResponse +// GetFooWithResponse performs a GET /foo (the `GetFoo` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetFooWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFooResponse, error) { rsp, err := c.GetFoo(ctx, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue1799/client/out.gen.go b/internal/test/issues/issue1799/client/out.gen.go index 3ad144a2c5..e57342f5f9 100644 --- a/internal/test/issues/issue1799/client/out.gen.go +++ b/internal/test/issues/issue1799/client/out.gen.go @@ -32,7 +32,7 @@ type PostPostMultibodyApplicationLdPlusJSONProfilehttpswwwW3Orgnsactivitystreams // PostPostObjectApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsRequestBody defines body for PostPostObject for application/ld+json; profile="https://www.w3.org/ns/activitystreams" ContentType. type PostPostObjectApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsRequestBody = PostPostObjectApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBody -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -105,25 +105,40 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetGetMultibody request + + // GetGetMultibody performs a GET /get-multibody (the `GetGetMultibody` operationId) request. + GetGetMultibody(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetObject request + // GetObject performs a GET /object (the `GetObject` operationId) request. + GetObject(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostPostMultibodyWithBody request with any body + // PostPostMultibodyWithBody performs a POST /post-multibody (the `PostPostMultibody` operationId) request, + // with any type of body and a specified content type. + PostPostMultibodyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostPostMultibody performs a POST /post-multibody (the `PostPostMultibody` operationId) request, + // Takes a body for the `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` content type. PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBody(ctx context.Context, body PostPostMultibodyApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostPostMultibody performs a POST /post-multibody (the `PostPostMultibody` operationId) request, + // Takes a body for the `application/ld+json; profile="https://www.w3.org/ns/activitystreams2"` content type. PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3Orgnsactivitystreams2Body(ctx context.Context, body PostPostMultibodyApplicationLdPlusJSONProfilehttpswwwW3Orgnsactivitystreams2RequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostPostObjectWithBody request with any body + // PostPostObjectWithBody performs a POST /post-object (the `PostPostObject` operationId) request, + // with any type of body and a specified content type. + PostPostObjectWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostPostObject performs a POST /post-object (the `PostPostObject` operationId) request, + // Takes a body for the `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` content type. PostPostObjectWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBody(ctx context.Context, body PostPostObjectApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetGetMultibody performs a GET /get-multibody (the `GetGetMultibody` operationId) request. + func (c *Client) GetGetMultibody(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetGetMultibodyRequest(c.Server) if err != nil { @@ -136,6 +151,8 @@ func (c *Client) GetGetMultibody(ctx context.Context, reqEditors ...RequestEdito return c.Client.Do(req) } +// GetObject performs a GET /object (the `GetObject` operationId) request. + func (c *Client) GetObject(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetObjectRequest(c.Server) if err != nil { @@ -148,6 +165,9 @@ func (c *Client) GetObject(ctx context.Context, reqEditors ...RequestEditorFn) ( return c.Client.Do(req) } +// PostPostMultibodyWithBody performs a POST /post-multibody (the `PostPostMultibody` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostPostMultibodyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostPostMultibodyRequestWithBody(c.Server, contentType, body) if err != nil { @@ -160,6 +180,8 @@ func (c *Client) PostPostMultibodyWithBody(ctx context.Context, contentType stri return c.Client.Do(req) } +// PostPostMultibody performs a POST /post-multibody (the `PostPostMultibody` operationId) request, +// Takes a body for the `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` content type. func (c *Client) PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBody(ctx context.Context, body PostPostMultibodyApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostPostMultibodyRequestWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBody(c.Server, body) if err != nil { @@ -172,6 +194,8 @@ func (c *Client) PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3Orgn return c.Client.Do(req) } +// PostPostMultibody performs a POST /post-multibody (the `PostPostMultibody` operationId) request, +// Takes a body for the `application/ld+json; profile="https://www.w3.org/ns/activitystreams2"` content type. func (c *Client) PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3Orgnsactivitystreams2Body(ctx context.Context, body PostPostMultibodyApplicationLdPlusJSONProfilehttpswwwW3Orgnsactivitystreams2RequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostPostMultibodyRequestWithApplicationLdPlusJSONProfilehttpswwwW3Orgnsactivitystreams2Body(c.Server, body) if err != nil { @@ -184,6 +208,9 @@ func (c *Client) PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3Orgn return c.Client.Do(req) } +// PostPostObjectWithBody performs a POST /post-object (the `PostPostObject` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostPostObjectWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostPostObjectRequestWithBody(c.Server, contentType, body) if err != nil { @@ -196,6 +223,8 @@ func (c *Client) PostPostObjectWithBody(ctx context.Context, contentType string, return c.Client.Do(req) } +// PostPostObject performs a POST /post-object (the `PostPostObject` operationId) request, +// Takes a body for the `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` content type. func (c *Client) PostPostObjectWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBody(ctx context.Context, body PostPostObjectApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostPostObjectRequestWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBody(c.Server, body) if err != nil { @@ -208,7 +237,7 @@ func (c *Client) PostPostObjectWithApplicationLdPlusJSONProfilehttpswwwW3Orgnsac return c.Client.Do(req) } -// NewGetGetMultibodyRequest generates requests for GetGetMultibody +// NewGetGetMultibodyRequest constructs an http.Request for the GetGetMultibody method func NewGetGetMultibodyRequest(server string) (*http.Request, error) { var err error @@ -235,7 +264,7 @@ func NewGetGetMultibodyRequest(server string) (*http.Request, error) { return req, nil } -// NewGetObjectRequest generates requests for GetObject +// NewGetObjectRequest constructs an http.Request for the GetObject method func NewGetObjectRequest(server string) (*http.Request, error) { var err error @@ -284,7 +313,7 @@ func NewPostPostMultibodyRequestWithApplicationLdPlusJSONProfilehttpswwwW3Orgnsa return NewPostPostMultibodyRequestWithBody(server, "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams2\"", bodyReader) } -// NewPostPostMultibodyRequestWithBody generates requests for PostPostMultibody with any type of body +// NewPostPostMultibodyRequestWithBody constructs an http.Request for the PostPostMultibody method, with any body, and a specified content type func NewPostPostMultibodyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -324,7 +353,7 @@ func NewPostPostObjectRequestWithApplicationLdPlusJSONProfilehttpswwwW3Orgnsacti return NewPostPostObjectRequestWithBody(server, "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"", bodyReader) } -// NewPostPostObjectRequestWithBody generates requests for PostPostObject with any type of body +// NewPostPostObjectRequestWithBody constructs an http.Request for the PostPostObject method, with any body, and a specified content type func NewPostPostObjectRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -396,22 +425,43 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetGetMultibodyWithResponse request + + // GetGetMultibodyWithResponse performs a GET /get-multibody (the `GetGetMultibody` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetGetMultibodyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetGetMultibodyResponse, error) - // GetObjectWithResponse request + // GetObjectWithResponse performs a GET /object (the `GetObject` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetObjectWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetObjectResponse, error) - // PostPostMultibodyWithBodyWithResponse request with any body + // PostPostMultibodyWithBodyWithResponse performs a POST /post-multibody (the `PostPostMultibody` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostPostMultibodyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPostMultibodyResponse, error) + // PostPostMultibodyWithResponse performs a POST /post-multibody (the `PostPostMultibody` operationId) request, + // Takes a body of the `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` content type, and returns a wrapper object for the known response body format(s). PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBodyWithResponse(ctx context.Context, body PostPostMultibodyApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsRequestBody, reqEditors ...RequestEditorFn) (*PostPostMultibodyResponse, error) + // PostPostMultibodyWithResponse performs a POST /post-multibody (the `PostPostMultibody` operationId) request, + // Takes a body of the `application/ld+json; profile="https://www.w3.org/ns/activitystreams2"` content type, and returns a wrapper object for the known response body format(s). PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3Orgnsactivitystreams2BodyWithResponse(ctx context.Context, body PostPostMultibodyApplicationLdPlusJSONProfilehttpswwwW3Orgnsactivitystreams2RequestBody, reqEditors ...RequestEditorFn) (*PostPostMultibodyResponse, error) - // PostPostObjectWithBodyWithResponse request with any body + // PostPostObjectWithBodyWithResponse performs a POST /post-object (the `PostPostObject` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostPostObjectWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPostObjectResponse, error) + // PostPostObjectWithResponse performs a POST /post-object (the `PostPostObject` operationId) request, + // Takes a body of the `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` content type, and returns a wrapper object for the known response body format(s). PostPostObjectWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBodyWithResponse(ctx context.Context, body PostPostObjectApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsRequestBody, reqEditors ...RequestEditorFn) (*PostPostObjectResponse, error) } @@ -422,12 +472,12 @@ type GetGetMultibodyResponse struct { ApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams2200 *string } -// GetApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams200 returns ApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams200 +// GetApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams200 returns the response for an HTTP 200 `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` response func (r GetGetMultibodyResponse) GetApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams200() *string { return r.ApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams200 } -// GetApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams2200 returns ApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams2200 +// GetApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams2200 returns the response for an HTTP 200 `application/ld+json; profile="https://www.w3.org/ns/activitystreams2"` response func (r GetGetMultibodyResponse) GetApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams2200() *string { return r.ApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams2200 } @@ -467,7 +517,7 @@ type GetObjectResponse struct { ApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams200 *string } -// GetApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams200 returns ApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams200 +// GetApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams200 returns the response for an HTTP 200 `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` response func (r GetObjectResponse) GetApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams200() *string { return r.ApplicationldJSONProfilehttpswwwW3Orgnsactivitystreams200 } @@ -569,7 +619,10 @@ func (r PostPostObjectResponse) ContentType() string { return "" } -// GetGetMultibodyWithResponse request returning *GetGetMultibodyResponse +// GetGetMultibodyWithResponse performs a GET /get-multibody (the `GetGetMultibody` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetGetMultibodyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetGetMultibodyResponse, error) { rsp, err := c.GetGetMultibody(ctx, reqEditors...) if err != nil { @@ -578,7 +631,10 @@ func (c *ClientWithResponses) GetGetMultibodyWithResponse(ctx context.Context, r return ParseGetGetMultibodyResponse(rsp) } -// GetObjectWithResponse request returning *GetObjectResponse +// GetObjectWithResponse performs a GET /object (the `GetObject` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetObjectWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetObjectResponse, error) { rsp, err := c.GetObject(ctx, reqEditors...) if err != nil { @@ -587,7 +643,11 @@ func (c *ClientWithResponses) GetObjectWithResponse(ctx context.Context, reqEdit return ParseGetObjectResponse(rsp) } -// PostPostMultibodyWithBodyWithResponse request with arbitrary body returning *PostPostMultibodyResponse +// PostPostMultibodyWithBodyWithResponse performs a POST /post-multibody (the `PostPostMultibody` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostPostMultibodyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPostMultibodyResponse, error) { rsp, err := c.PostPostMultibodyWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -596,6 +656,8 @@ func (c *ClientWithResponses) PostPostMultibodyWithBodyWithResponse(ctx context. return ParsePostPostMultibodyResponse(rsp) } +// PostPostMultibodyWithResponse performs a POST /post-multibody (the `PostPostMultibody` operationId) request, +// Takes a body of the `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBodyWithResponse(ctx context.Context, body PostPostMultibodyApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsRequestBody, reqEditors ...RequestEditorFn) (*PostPostMultibodyResponse, error) { rsp, err := c.PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBody(ctx, body, reqEditors...) if err != nil { @@ -604,6 +666,8 @@ func (c *ClientWithResponses) PostPostMultibodyWithApplicationLdPlusJSONProfileh return ParsePostPostMultibodyResponse(rsp) } +// PostPostMultibodyWithResponse performs a POST /post-multibody (the `PostPostMultibody` operationId) request, +// Takes a body of the `application/ld+json; profile="https://www.w3.org/ns/activitystreams2"` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3Orgnsactivitystreams2BodyWithResponse(ctx context.Context, body PostPostMultibodyApplicationLdPlusJSONProfilehttpswwwW3Orgnsactivitystreams2RequestBody, reqEditors ...RequestEditorFn) (*PostPostMultibodyResponse, error) { rsp, err := c.PostPostMultibodyWithApplicationLdPlusJSONProfilehttpswwwW3Orgnsactivitystreams2Body(ctx, body, reqEditors...) if err != nil { @@ -612,7 +676,11 @@ func (c *ClientWithResponses) PostPostMultibodyWithApplicationLdPlusJSONProfileh return ParsePostPostMultibodyResponse(rsp) } -// PostPostObjectWithBodyWithResponse request with arbitrary body returning *PostPostObjectResponse +// PostPostObjectWithBodyWithResponse performs a POST /post-object (the `PostPostObject` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostPostObjectWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPostObjectResponse, error) { rsp, err := c.PostPostObjectWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -621,6 +689,8 @@ func (c *ClientWithResponses) PostPostObjectWithBodyWithResponse(ctx context.Con return ParsePostPostObjectResponse(rsp) } +// PostPostObjectWithResponse performs a POST /post-object (the `PostPostObject` operationId) request, +// Takes a body of the `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostPostObjectWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBodyWithResponse(ctx context.Context, body PostPostObjectApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsRequestBody, reqEditors ...RequestEditorFn) (*PostPostObjectResponse, error) { rsp, err := c.PostPostObjectWithApplicationLdPlusJSONProfilehttpswwwW3OrgnsactivitystreamsBody(ctx, body, reqEditors...) if err != nil { diff --git a/internal/test/issues/issue240/client.gen.go b/internal/test/issues/issue240/client.gen.go index cf1055c485..e7e61c1e98 100644 --- a/internal/test/issues/issue240/client.gen.go +++ b/internal/test/issues/issue240/client.gen.go @@ -18,7 +18,7 @@ type ClientType struct { Name string `json:"name"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -91,13 +91,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetClient request + + // GetClient performs a GET /client (the `GetClient` operationId) request. + GetClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // UpdateClient request + // UpdateClient performs a PUT /client (the `UpdateClient` operationId) request. + UpdateClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetClient performs a GET /client (the `GetClient` operationId) request. + func (c *Client) GetClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetClientRequest(c.Server) if err != nil { @@ -110,6 +115,8 @@ func (c *Client) GetClient(ctx context.Context, reqEditors ...RequestEditorFn) ( return c.Client.Do(req) } +// UpdateClient performs a PUT /client (the `UpdateClient` operationId) request. + func (c *Client) UpdateClient(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUpdateClientRequest(c.Server) if err != nil { @@ -122,7 +129,7 @@ func (c *Client) UpdateClient(ctx context.Context, reqEditors ...RequestEditorFn return c.Client.Do(req) } -// NewGetClientRequest generates requests for GetClient +// NewGetClientRequest constructs an http.Request for the GetClient method func NewGetClientRequest(server string) (*http.Request, error) { var err error @@ -149,7 +156,7 @@ func NewGetClientRequest(server string) (*http.Request, error) { return req, nil } -// NewUpdateClientRequest generates requests for UpdateClient +// NewUpdateClientRequest constructs an http.Request for the UpdateClient method func NewUpdateClientRequest(server string) (*http.Request, error) { var err error @@ -219,10 +226,17 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetClientWithResponse request + + // GetClientWithResponse performs a GET /client (the `GetClient` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetClientResponse, error) - // UpdateClientWithResponse request + // UpdateClientWithResponse performs a PUT /client (the `UpdateClient` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + UpdateClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*UpdateClientResponse, error) } @@ -232,7 +246,7 @@ type GetClientResponse struct { JSON200 *ClientType } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetClientResponse) GetJSON200() *ClientType { return r.JSON200 } @@ -279,7 +293,7 @@ type UpdateClientResponse struct { } } -// GetJSON400 returns JSON400 +// GetJSON400 returns the response for an HTTP 400 `application/json` response func (r UpdateClientResponse) GetJSON400() *struct { Code string `json:"code"` } { @@ -320,7 +334,10 @@ func (r UpdateClientResponse) ContentType() string { return "" } -// GetClientWithResponse request returning *GetClientResponse +// GetClientWithResponse performs a GET /client (the `GetClient` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetClientResponse, error) { rsp, err := c.GetClient(ctx, reqEditors...) if err != nil { @@ -329,7 +346,10 @@ func (c *ClientWithResponses) GetClientWithResponse(ctx context.Context, reqEdit return ParseGetClientResponse(rsp) } -// UpdateClientWithResponse request returning *UpdateClientResponse +// UpdateClientWithResponse performs a PUT /client (the `UpdateClient` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) UpdateClientWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*UpdateClientResponse, error) { rsp, err := c.UpdateClient(ctx, reqEditors...) if err != nil { diff --git a/internal/test/name_conflict_resolution/name_conflict_resolution.gen.go b/internal/test/name_conflict_resolution/name_conflict_resolution.gen.go index 1408a086d7..6388cba22e 100644 --- a/internal/test/name_conflict_resolution/name_conflict_resolution.gen.go +++ b/internal/test/name_conflict_resolution/name_conflict_resolution.gen.go @@ -491,7 +491,7 @@ func (t *N200ResourcePatchResponseJSON3ApplicationJSONPatchQueryPlusJSON) Unmars return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -564,91 +564,153 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // ListEntities request + + // ListEntities performs a GET /entities (the `ListEntities` operationId) request. + ListEntities(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostFooWithBody request with any body + // PostFooWithBody performs a POST /foo (the `PostFoo` operationId) request, + // with any type of body and a specified content type. + PostFooWithBody(ctx context.Context, params *PostFooParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostFoo performs a POST /foo (the `PostFoo` operationId) request, + // Takes a body for the `application/json` content type. PostFoo(ctx context.Context, params *PostFooParams, body PostFooJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // ListItems request + // ListItems performs a GET /items (the `ListItems` operationId) request. + ListItems(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateItemWithBody request with any body + // CreateItemWithBody performs a POST /items (the `CreateItem` operationId) request, + // with any type of body and a specified content type. + CreateItemWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateItem performs a POST /items (the `CreateItem` operationId) request, + // Takes a body for the `application/json` content type. CreateItem(ctx context.Context, body CreateItemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateOrderWithBody request with any body + // CreateOrderWithBody performs a POST /orders (the `CreateOrder` operationId) request, + // with any type of body and a specified content type. + CreateOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateOrder performs a POST /orders (the `CreateOrder` operationId) request, + // Takes a body for the `application/json` content type. CreateOrder(ctx context.Context, body CreateOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateOrder performs a POST /orders (the `CreateOrder` operationId) request, + // Takes a body for the `application/json-patch+json` content type. CreateOrderWithApplicationJSONPatchPlusJSONBody(ctx context.Context, body CreateOrderApplicationJSONPatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateOrder performs a POST /orders (the `CreateOrder` operationId) request, + // Takes a body for the `application/merge-patch+json` content type. CreateOrderWithApplicationMergePatchPlusJSONBody(ctx context.Context, body CreateOrderApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetOutcome request + // GetOutcome performs a GET /outcome (the `GetOutcome` operationId) request. + GetOutcome(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostOutcomeWithBody request with any body + // PostOutcomeWithBody performs a POST /outcome (the `PostOutcome` operationId) request, + // with any type of body and a specified content type. + PostOutcomeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostOutcome performs a POST /outcome (the `PostOutcome` operationId) request, + // Takes a body for the `application/json` content type. PostOutcome(ctx context.Context, body PostOutcomeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // SendPayloadWithBody request with any body + // SendPayloadWithBody performs a POST /payload (the `SendPayload` operationId) request, + // with any type of body and a specified content type. + SendPayloadWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // SendPayload performs a POST /payload (the `SendPayload` operationId) request, + // Takes a body for the `application/json` content type. SendPayload(ctx context.Context, body SendPayloadJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreatePetWithBody request with any body + // CreatePetWithBody performs a POST /pets (the `CreatePet` operationId) request, + // with any type of body and a specified content type. + CreatePetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreatePet performs a POST /pets (the `CreatePet` operationId) request, + // Takes a body for the `application/json` content type. CreatePet(ctx context.Context, body CreatePetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // QueryWithBody request with any body + // QueryWithBody performs a POST /query (the `Query` operationId) request, + // with any type of body and a specified content type. + QueryWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // Query performs a POST /query (the `Query` operationId) request, + // Takes a body for the `application/json` content type. Query(ctx context.Context, body QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetQux request + // GetQux performs a GET /qux (the `GetQux` operationId) request. + GetQux(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostQuxWithBody request with any body + // PostQuxWithBody performs a POST /qux (the `PostQux` operationId) request, + // with any type of body and a specified content type. + PostQuxWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostQux performs a POST /qux (the `PostQux` operationId) request, + // Takes a body for the `application/json` content type. PostQux(ctx context.Context, body PostQuxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetRenamedSchema request + // GetRenamedSchema performs a GET /renamed-schema (the `GetRenamedSchema` operationId) request. + GetRenamedSchema(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostRenamedSchemaWithBody request with any body + // PostRenamedSchemaWithBody performs a POST /renamed-schema (the `PostRenamedSchema` operationId) request, + // with any type of body and a specified content type. + PostRenamedSchemaWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostRenamedSchema performs a POST /renamed-schema (the `PostRenamedSchema` operationId) request, + // Takes a body for the `application/json` content type. PostRenamedSchema(ctx context.Context, body PostRenamedSchemaJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // PatchResourceWithBody request with any body + // PatchResourceWithBody performs a PATCH /resources/{id} (the `PatchResource` operationId) request, + // with any type of body and a specified content type. + PatchResourceWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PatchResource performs a PATCH /resources/{id} (the `PatchResource` operationId) request, + // Takes a body for the `application/json` content type. PatchResource(ctx context.Context, id string, body PatchResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // PatchResource performs a PATCH /resources/{id} (the `PatchResource` operationId) request, + // Takes a body for the `application/json-patch+json` content type. PatchResourceWithApplicationJSONPatchPlusJSONBody(ctx context.Context, id string, body PatchResourceApplicationJSONPatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // PatchResource performs a PATCH /resources/{id} (the `PatchResource` operationId) request, + // Takes a body for the `application/merge-patch+json` content type. PatchResourceWithApplicationMergePatchPlusJSONBody(ctx context.Context, id string, body PatchResourceApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetStatus request + // GetStatus performs a GET /status (the `GetStatus` operationId) request. + GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetZap request + // GetZap performs a GET /zap (the `GetZap` operationId) request. + GetZap(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostZapWithBody request with any body + // PostZapWithBody performs a POST /zap (the `PostZap` operationId) request, + // with any type of body and a specified content type. + PostZapWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostZap performs a POST /zap (the `PostZap` operationId) request, + // Takes a body for the `application/json` content type. PostZap(ctx context.Context, body PostZapJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// ListEntities performs a GET /entities (the `ListEntities` operationId) request. + func (c *Client) ListEntities(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListEntitiesRequest(c.Server) if err != nil { @@ -661,6 +723,9 @@ func (c *Client) ListEntities(ctx context.Context, reqEditors ...RequestEditorFn return c.Client.Do(req) } +// PostFooWithBody performs a POST /foo (the `PostFoo` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostFooWithBody(ctx context.Context, params *PostFooParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostFooRequestWithBody(c.Server, params, contentType, body) if err != nil { @@ -673,6 +738,8 @@ func (c *Client) PostFooWithBody(ctx context.Context, params *PostFooParams, con return c.Client.Do(req) } +// PostFoo performs a POST /foo (the `PostFoo` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) PostFoo(ctx context.Context, params *PostFooParams, body PostFooJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostFooRequest(c.Server, params, body) if err != nil { @@ -685,6 +752,8 @@ func (c *Client) PostFoo(ctx context.Context, params *PostFooParams, body PostFo return c.Client.Do(req) } +// ListItems performs a GET /items (the `ListItems` operationId) request. + func (c *Client) ListItems(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListItemsRequest(c.Server) if err != nil { @@ -697,6 +766,9 @@ func (c *Client) ListItems(ctx context.Context, reqEditors ...RequestEditorFn) ( return c.Client.Do(req) } +// CreateItemWithBody performs a POST /items (the `CreateItem` operationId) request, +// with any type of body and a specified content type. + func (c *Client) CreateItemWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateItemRequestWithBody(c.Server, contentType, body) if err != nil { @@ -709,6 +781,8 @@ func (c *Client) CreateItemWithBody(ctx context.Context, contentType string, bod return c.Client.Do(req) } +// CreateItem performs a POST /items (the `CreateItem` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) CreateItem(ctx context.Context, body CreateItemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateItemRequest(c.Server, body) if err != nil { @@ -721,6 +795,9 @@ func (c *Client) CreateItem(ctx context.Context, body CreateItemJSONRequestBody, return c.Client.Do(req) } +// CreateOrderWithBody performs a POST /orders (the `CreateOrder` operationId) request, +// with any type of body and a specified content type. + func (c *Client) CreateOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateOrderRequestWithBody(c.Server, contentType, body) if err != nil { @@ -733,6 +810,8 @@ func (c *Client) CreateOrderWithBody(ctx context.Context, contentType string, bo return c.Client.Do(req) } +// CreateOrder performs a POST /orders (the `CreateOrder` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) CreateOrder(ctx context.Context, body CreateOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateOrderRequest(c.Server, body) if err != nil { @@ -745,6 +824,8 @@ func (c *Client) CreateOrder(ctx context.Context, body CreateOrderJSONRequestBod return c.Client.Do(req) } +// CreateOrder performs a POST /orders (the `CreateOrder` operationId) request, +// Takes a body for the `application/json-patch+json` content type. func (c *Client) CreateOrderWithApplicationJSONPatchPlusJSONBody(ctx context.Context, body CreateOrderApplicationJSONPatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateOrderRequestWithApplicationJSONPatchPlusJSONBody(c.Server, body) if err != nil { @@ -757,6 +838,8 @@ func (c *Client) CreateOrderWithApplicationJSONPatchPlusJSONBody(ctx context.Con return c.Client.Do(req) } +// CreateOrder performs a POST /orders (the `CreateOrder` operationId) request, +// Takes a body for the `application/merge-patch+json` content type. func (c *Client) CreateOrderWithApplicationMergePatchPlusJSONBody(ctx context.Context, body CreateOrderApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateOrderRequestWithApplicationMergePatchPlusJSONBody(c.Server, body) if err != nil { @@ -769,6 +852,8 @@ func (c *Client) CreateOrderWithApplicationMergePatchPlusJSONBody(ctx context.Co return c.Client.Do(req) } +// GetOutcome performs a GET /outcome (the `GetOutcome` operationId) request. + func (c *Client) GetOutcome(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetOutcomeRequest(c.Server) if err != nil { @@ -781,6 +866,9 @@ func (c *Client) GetOutcome(ctx context.Context, reqEditors ...RequestEditorFn) return c.Client.Do(req) } +// PostOutcomeWithBody performs a POST /outcome (the `PostOutcome` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostOutcomeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostOutcomeRequestWithBody(c.Server, contentType, body) if err != nil { @@ -793,6 +881,8 @@ func (c *Client) PostOutcomeWithBody(ctx context.Context, contentType string, bo return c.Client.Do(req) } +// PostOutcome performs a POST /outcome (the `PostOutcome` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) PostOutcome(ctx context.Context, body PostOutcomeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostOutcomeRequest(c.Server, body) if err != nil { @@ -805,6 +895,9 @@ func (c *Client) PostOutcome(ctx context.Context, body PostOutcomeJSONRequestBod return c.Client.Do(req) } +// SendPayloadWithBody performs a POST /payload (the `SendPayload` operationId) request, +// with any type of body and a specified content type. + func (c *Client) SendPayloadWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewSendPayloadRequestWithBody(c.Server, contentType, body) if err != nil { @@ -817,6 +910,8 @@ func (c *Client) SendPayloadWithBody(ctx context.Context, contentType string, bo return c.Client.Do(req) } +// SendPayload performs a POST /payload (the `SendPayload` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) SendPayload(ctx context.Context, body SendPayloadJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewSendPayloadRequest(c.Server, body) if err != nil { @@ -829,6 +924,9 @@ func (c *Client) SendPayload(ctx context.Context, body SendPayloadJSONRequestBod return c.Client.Do(req) } +// CreatePetWithBody performs a POST /pets (the `CreatePet` operationId) request, +// with any type of body and a specified content type. + func (c *Client) CreatePetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreatePetRequestWithBody(c.Server, contentType, body) if err != nil { @@ -841,6 +939,8 @@ func (c *Client) CreatePetWithBody(ctx context.Context, contentType string, body return c.Client.Do(req) } +// CreatePet performs a POST /pets (the `CreatePet` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) CreatePet(ctx context.Context, body CreatePetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreatePetRequest(c.Server, body) if err != nil { @@ -853,6 +953,9 @@ func (c *Client) CreatePet(ctx context.Context, body CreatePetJSONRequestBody, r return c.Client.Do(req) } +// QueryWithBody performs a POST /query (the `Query` operationId) request, +// with any type of body and a specified content type. + func (c *Client) QueryWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewQueryRequestWithBody(c.Server, contentType, body) if err != nil { @@ -865,6 +968,8 @@ func (c *Client) QueryWithBody(ctx context.Context, contentType string, body io. return c.Client.Do(req) } +// Query performs a POST /query (the `Query` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) Query(ctx context.Context, body QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewQueryRequest(c.Server, body) if err != nil { @@ -877,6 +982,8 @@ func (c *Client) Query(ctx context.Context, body QueryJSONRequestBody, reqEditor return c.Client.Do(req) } +// GetQux performs a GET /qux (the `GetQux` operationId) request. + func (c *Client) GetQux(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetQuxRequest(c.Server) if err != nil { @@ -889,6 +996,9 @@ func (c *Client) GetQux(ctx context.Context, reqEditors ...RequestEditorFn) (*ht return c.Client.Do(req) } +// PostQuxWithBody performs a POST /qux (the `PostQux` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostQuxWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostQuxRequestWithBody(c.Server, contentType, body) if err != nil { @@ -901,6 +1011,8 @@ func (c *Client) PostQuxWithBody(ctx context.Context, contentType string, body i return c.Client.Do(req) } +// PostQux performs a POST /qux (the `PostQux` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) PostQux(ctx context.Context, body PostQuxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostQuxRequest(c.Server, body) if err != nil { @@ -913,6 +1025,8 @@ func (c *Client) PostQux(ctx context.Context, body PostQuxJSONRequestBody, reqEd return c.Client.Do(req) } +// GetRenamedSchema performs a GET /renamed-schema (the `GetRenamedSchema` operationId) request. + func (c *Client) GetRenamedSchema(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetRenamedSchemaRequest(c.Server) if err != nil { @@ -925,6 +1039,9 @@ func (c *Client) GetRenamedSchema(ctx context.Context, reqEditors ...RequestEdit return c.Client.Do(req) } +// PostRenamedSchemaWithBody performs a POST /renamed-schema (the `PostRenamedSchema` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostRenamedSchemaWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostRenamedSchemaRequestWithBody(c.Server, contentType, body) if err != nil { @@ -937,6 +1054,8 @@ func (c *Client) PostRenamedSchemaWithBody(ctx context.Context, contentType stri return c.Client.Do(req) } +// PostRenamedSchema performs a POST /renamed-schema (the `PostRenamedSchema` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) PostRenamedSchema(ctx context.Context, body PostRenamedSchemaJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostRenamedSchemaRequest(c.Server, body) if err != nil { @@ -949,6 +1068,9 @@ func (c *Client) PostRenamedSchema(ctx context.Context, body PostRenamedSchemaJS return c.Client.Do(req) } +// PatchResourceWithBody performs a PATCH /resources/{id} (the `PatchResource` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PatchResourceWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchResourceRequestWithBody(c.Server, id, contentType, body) if err != nil { @@ -961,6 +1083,8 @@ func (c *Client) PatchResourceWithBody(ctx context.Context, id string, contentTy return c.Client.Do(req) } +// PatchResource performs a PATCH /resources/{id} (the `PatchResource` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) PatchResource(ctx context.Context, id string, body PatchResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchResourceRequest(c.Server, id, body) if err != nil { @@ -973,6 +1097,8 @@ func (c *Client) PatchResource(ctx context.Context, id string, body PatchResourc return c.Client.Do(req) } +// PatchResource performs a PATCH /resources/{id} (the `PatchResource` operationId) request, +// Takes a body for the `application/json-patch+json` content type. func (c *Client) PatchResourceWithApplicationJSONPatchPlusJSONBody(ctx context.Context, id string, body PatchResourceApplicationJSONPatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchResourceRequestWithApplicationJSONPatchPlusJSONBody(c.Server, id, body) if err != nil { @@ -985,6 +1111,8 @@ func (c *Client) PatchResourceWithApplicationJSONPatchPlusJSONBody(ctx context.C return c.Client.Do(req) } +// PatchResource performs a PATCH /resources/{id} (the `PatchResource` operationId) request, +// Takes a body for the `application/merge-patch+json` content type. func (c *Client) PatchResourceWithApplicationMergePatchPlusJSONBody(ctx context.Context, id string, body PatchResourceApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPatchResourceRequestWithApplicationMergePatchPlusJSONBody(c.Server, id, body) if err != nil { @@ -997,6 +1125,8 @@ func (c *Client) PatchResourceWithApplicationMergePatchPlusJSONBody(ctx context. return c.Client.Do(req) } +// GetStatus performs a GET /status (the `GetStatus` operationId) request. + func (c *Client) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetStatusRequest(c.Server) if err != nil { @@ -1009,6 +1139,8 @@ func (c *Client) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) ( return c.Client.Do(req) } +// GetZap performs a GET /zap (the `GetZap` operationId) request. + func (c *Client) GetZap(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetZapRequest(c.Server) if err != nil { @@ -1021,6 +1153,9 @@ func (c *Client) GetZap(ctx context.Context, reqEditors ...RequestEditorFn) (*ht return c.Client.Do(req) } +// PostZapWithBody performs a POST /zap (the `PostZap` operationId) request, +// with any type of body and a specified content type. + func (c *Client) PostZapWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostZapRequestWithBody(c.Server, contentType, body) if err != nil { @@ -1033,6 +1168,8 @@ func (c *Client) PostZapWithBody(ctx context.Context, contentType string, body i return c.Client.Do(req) } +// PostZap performs a POST /zap (the `PostZap` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) PostZap(ctx context.Context, body PostZapJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewPostZapRequest(c.Server, body) if err != nil { @@ -1045,7 +1182,7 @@ func (c *Client) PostZap(ctx context.Context, body PostZapJSONRequestBody, reqEd return c.Client.Do(req) } -// NewListEntitiesRequest generates requests for ListEntities +// NewListEntitiesRequest constructs an http.Request for the ListEntities method func NewListEntitiesRequest(server string) (*http.Request, error) { var err error @@ -1083,7 +1220,7 @@ func NewPostFooRequest(server string, params *PostFooParams, body PostFooJSONReq return NewPostFooRequestWithBody(server, params, "application/json", bodyReader) } -// NewPostFooRequestWithBody generates requests for PostFoo with any type of body +// NewPostFooRequestWithBody constructs an http.Request for the PostFoo method, with any body, and a specified content type func NewPostFooRequestWithBody(server string, params *PostFooParams, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1139,7 +1276,7 @@ func NewPostFooRequestWithBody(server string, params *PostFooParams, contentType return req, nil } -// NewListItemsRequest generates requests for ListItems +// NewListItemsRequest constructs an http.Request for the ListItems method func NewListItemsRequest(server string) (*http.Request, error) { var err error @@ -1177,7 +1314,7 @@ func NewCreateItemRequest(server string, body CreateItemJSONRequestBody) (*http. return NewCreateItemRequestWithBody(server, "application/json", bodyReader) } -// NewCreateItemRequestWithBody generates requests for CreateItem with any type of body +// NewCreateItemRequestWithBody constructs an http.Request for the CreateItem method, with any body, and a specified content type func NewCreateItemRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1239,7 +1376,7 @@ func NewCreateOrderRequestWithApplicationMergePatchPlusJSONBody(server string, b return NewCreateOrderRequestWithBody(server, "application/merge-patch+json", bodyReader) } -// NewCreateOrderRequestWithBody generates requests for CreateOrder with any type of body +// NewCreateOrderRequestWithBody constructs an http.Request for the CreateOrder method, with any body, and a specified content type func NewCreateOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1268,7 +1405,7 @@ func NewCreateOrderRequestWithBody(server string, contentType string, body io.Re return req, nil } -// NewGetOutcomeRequest generates requests for GetOutcome +// NewGetOutcomeRequest constructs an http.Request for the GetOutcome method func NewGetOutcomeRequest(server string) (*http.Request, error) { var err error @@ -1306,7 +1443,7 @@ func NewPostOutcomeRequest(server string, body PostOutcomeJSONRequestBody) (*htt return NewPostOutcomeRequestWithBody(server, "application/json", bodyReader) } -// NewPostOutcomeRequestWithBody generates requests for PostOutcome with any type of body +// NewPostOutcomeRequestWithBody constructs an http.Request for the PostOutcome method, with any body, and a specified content type func NewPostOutcomeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1346,7 +1483,7 @@ func NewSendPayloadRequest(server string, body SendPayloadJSONRequestBody) (*htt return NewSendPayloadRequestWithBody(server, "application/json", bodyReader) } -// NewSendPayloadRequestWithBody generates requests for SendPayload with any type of body +// NewSendPayloadRequestWithBody constructs an http.Request for the SendPayload method, with any body, and a specified content type func NewSendPayloadRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1386,7 +1523,7 @@ func NewCreatePetRequest(server string, body CreatePetJSONRequestBody) (*http.Re return NewCreatePetRequestWithBody(server, "application/json", bodyReader) } -// NewCreatePetRequestWithBody generates requests for CreatePet with any type of body +// NewCreatePetRequestWithBody constructs an http.Request for the CreatePet method, with any body, and a specified content type func NewCreatePetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1426,7 +1563,7 @@ func NewQueryRequest(server string, body QueryJSONRequestBody) (*http.Request, e return NewQueryRequestWithBody(server, "application/json", bodyReader) } -// NewQueryRequestWithBody generates requests for Query with any type of body +// NewQueryRequestWithBody constructs an http.Request for the Query method, with any body, and a specified content type func NewQueryRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1455,7 +1592,7 @@ func NewQueryRequestWithBody(server string, contentType string, body io.Reader) return req, nil } -// NewGetQuxRequest generates requests for GetQux +// NewGetQuxRequest constructs an http.Request for the GetQux method func NewGetQuxRequest(server string) (*http.Request, error) { var err error @@ -1493,7 +1630,7 @@ func NewPostQuxRequest(server string, body PostQuxJSONRequestBody) (*http.Reques return NewPostQuxRequestWithBody(server, "application/json", bodyReader) } -// NewPostQuxRequestWithBody generates requests for PostQux with any type of body +// NewPostQuxRequestWithBody constructs an http.Request for the PostQux method, with any body, and a specified content type func NewPostQuxRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1522,7 +1659,7 @@ func NewPostQuxRequestWithBody(server string, contentType string, body io.Reader return req, nil } -// NewGetRenamedSchemaRequest generates requests for GetRenamedSchema +// NewGetRenamedSchemaRequest constructs an http.Request for the GetRenamedSchema method func NewGetRenamedSchemaRequest(server string) (*http.Request, error) { var err error @@ -1560,7 +1697,7 @@ func NewPostRenamedSchemaRequest(server string, body PostRenamedSchemaJSONReques return NewPostRenamedSchemaRequestWithBody(server, "application/json", bodyReader) } -// NewPostRenamedSchemaRequestWithBody generates requests for PostRenamedSchema with any type of body +// NewPostRenamedSchemaRequestWithBody constructs an http.Request for the PostRenamedSchema method, with any body, and a specified content type func NewPostRenamedSchemaRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1622,7 +1759,7 @@ func NewPatchResourceRequestWithApplicationMergePatchPlusJSONBody(server string, return NewPatchResourceRequestWithBody(server, id, "application/merge-patch+json", bodyReader) } -// NewPatchResourceRequestWithBody generates requests for PatchResource with any type of body +// NewPatchResourceRequestWithBody constructs an http.Request for the PatchResource method, with any body, and a specified content type func NewPatchResourceRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1658,7 +1795,7 @@ func NewPatchResourceRequestWithBody(server string, id string, contentType strin return req, nil } -// NewGetStatusRequest generates requests for GetStatus +// NewGetStatusRequest constructs an http.Request for the GetStatus method func NewGetStatusRequest(server string) (*http.Request, error) { var err error @@ -1685,7 +1822,7 @@ func NewGetStatusRequest(server string) (*http.Request, error) { return req, nil } -// NewGetZapRequest generates requests for GetZap +// NewGetZapRequest constructs an http.Request for the GetZap method func NewGetZapRequest(server string) (*http.Request, error) { var err error @@ -1723,7 +1860,7 @@ func NewPostZapRequest(server string, body PostZapJSONRequestBody) (*http.Reques return NewPostZapRequestWithBody(server, "application/json", bodyReader) } -// NewPostZapRequestWithBody generates requests for PostZap with any type of body +// NewPostZapRequestWithBody constructs an http.Request for the PostZap method, with any body, and a specified content type func NewPostZapRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1795,88 +1932,184 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // ListEntitiesWithResponse request + + // ListEntitiesWithResponse performs a GET /entities (the `ListEntities` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ListEntitiesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListEntitiesResponse, error) - // PostFooWithBodyWithResponse request with any body + // PostFooWithBodyWithResponse performs a POST /foo (the `PostFoo` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostFooWithBodyWithResponse(ctx context.Context, params *PostFooParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFooResponse, error) + // PostFooWithResponse performs a POST /foo (the `PostFoo` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). PostFooWithResponse(ctx context.Context, params *PostFooParams, body PostFooJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFooResponse, error) - // ListItemsWithResponse request + // ListItemsWithResponse performs a GET /items (the `ListItems` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ListItemsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListItemsResponse2, error) - // CreateItemWithBodyWithResponse request with any body + // CreateItemWithBodyWithResponse performs a POST /items (the `CreateItem` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + CreateItemWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateItemResponse2, error) + // CreateItemWithResponse performs a POST /items (the `CreateItem` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). CreateItemWithResponse(ctx context.Context, body CreateItemJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateItemResponse2, error) - // CreateOrderWithBodyWithResponse request with any body + // CreateOrderWithBodyWithResponse performs a POST /orders (the `CreateOrder` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + CreateOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrderResponse, error) + // CreateOrderWithResponse performs a POST /orders (the `CreateOrder` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). CreateOrderWithResponse(ctx context.Context, body CreateOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrderResponse, error) + // CreateOrderWithResponse performs a POST /orders (the `CreateOrder` operationId) request, + // Takes a body of the `application/json-patch+json` content type, and returns a wrapper object for the known response body format(s). CreateOrderWithApplicationJSONPatchPlusJSONBodyWithResponse(ctx context.Context, body CreateOrderApplicationJSONPatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrderResponse, error) + // CreateOrderWithResponse performs a POST /orders (the `CreateOrder` operationId) request, + // Takes a body of the `application/merge-patch+json` content type, and returns a wrapper object for the known response body format(s). CreateOrderWithApplicationMergePatchPlusJSONBodyWithResponse(ctx context.Context, body CreateOrderApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrderResponse, error) - // GetOutcomeWithResponse request + // GetOutcomeWithResponse performs a GET /outcome (the `GetOutcome` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetOutcomeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOutcomeResponse, error) - // PostOutcomeWithBodyWithResponse request with any body + // PostOutcomeWithBodyWithResponse performs a POST /outcome (the `PostOutcome` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostOutcomeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostOutcomeResponse, error) + // PostOutcomeWithResponse performs a POST /outcome (the `PostOutcome` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). PostOutcomeWithResponse(ctx context.Context, body PostOutcomeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostOutcomeResponse, error) - // SendPayloadWithBodyWithResponse request with any body + // SendPayloadWithBodyWithResponse performs a POST /payload (the `SendPayload` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + SendPayloadWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendPayloadResponse, error) + // SendPayloadWithResponse performs a POST /payload (the `SendPayload` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). SendPayloadWithResponse(ctx context.Context, body SendPayloadJSONRequestBody, reqEditors ...RequestEditorFn) (*SendPayloadResponse, error) - // CreatePetWithBodyWithResponse request with any body + // CreatePetWithBodyWithResponse performs a POST /pets (the `CreatePet` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + CreatePetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePetResponse, error) + // CreatePetWithResponse performs a POST /pets (the `CreatePet` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). CreatePetWithResponse(ctx context.Context, body CreatePetJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePetResponse, error) - // QueryWithBodyWithResponse request with any body + // QueryWithBodyWithResponse performs a POST /query (the `Query` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + QueryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueryResponse2, error) + // QueryWithResponse performs a POST /query (the `Query` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). QueryWithResponse(ctx context.Context, body QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*QueryResponse2, error) - // GetQuxWithResponse request + // GetQuxWithResponse performs a GET /qux (the `GetQux` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetQuxWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetQuxResponse, error) - // PostQuxWithBodyWithResponse request with any body + // PostQuxWithBodyWithResponse performs a POST /qux (the `PostQux` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostQuxWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostQuxResponse, error) + // PostQuxWithResponse performs a POST /qux (the `PostQux` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). PostQuxWithResponse(ctx context.Context, body PostQuxJSONRequestBody, reqEditors ...RequestEditorFn) (*PostQuxResponse, error) - // GetRenamedSchemaWithResponse request + // GetRenamedSchemaWithResponse performs a GET /renamed-schema (the `GetRenamedSchema` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetRenamedSchemaWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetRenamedSchemaResponse, error) - // PostRenamedSchemaWithBodyWithResponse request with any body + // PostRenamedSchemaWithBodyWithResponse performs a POST /renamed-schema (the `PostRenamedSchema` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostRenamedSchemaWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostRenamedSchemaResponse, error) + // PostRenamedSchemaWithResponse performs a POST /renamed-schema (the `PostRenamedSchema` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). PostRenamedSchemaWithResponse(ctx context.Context, body PostRenamedSchemaJSONRequestBody, reqEditors ...RequestEditorFn) (*PostRenamedSchemaResponse, error) - // PatchResourceWithBodyWithResponse request with any body + // PatchResourceWithBodyWithResponse performs a PATCH /resources/{id} (the `PatchResource` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PatchResourceWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchResourceResponse, error) + // PatchResourceWithResponse performs a PATCH /resources/{id} (the `PatchResource` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). PatchResourceWithResponse(ctx context.Context, id string, body PatchResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchResourceResponse, error) + // PatchResourceWithResponse performs a PATCH /resources/{id} (the `PatchResource` operationId) request, + // Takes a body of the `application/json-patch+json` content type, and returns a wrapper object for the known response body format(s). PatchResourceWithApplicationJSONPatchPlusJSONBodyWithResponse(ctx context.Context, id string, body PatchResourceApplicationJSONPatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchResourceResponse, error) + // PatchResourceWithResponse performs a PATCH /resources/{id} (the `PatchResource` operationId) request, + // Takes a body of the `application/merge-patch+json` content type, and returns a wrapper object for the known response body format(s). PatchResourceWithApplicationMergePatchPlusJSONBodyWithResponse(ctx context.Context, id string, body PatchResourceApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchResourceResponse, error) - // GetStatusWithResponse request + // GetStatusWithResponse performs a GET /status (the `GetStatus` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse2, error) - // GetZapWithResponse request + // GetZapWithResponse performs a GET /zap (the `GetZap` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetZapWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetZapResponse, error) - // PostZapWithBodyWithResponse request with any body + // PostZapWithBodyWithResponse performs a POST /zap (the `PostZap` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + PostZapWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostZapResponse, error) + // PostZapWithResponse performs a POST /zap (the `PostZap` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). PostZapWithResponse(ctx context.Context, body PostZapJSONRequestBody, reqEditors ...RequestEditorFn) (*PostZapResponse, error) } @@ -1889,7 +2122,7 @@ type ListEntitiesResponse struct { } } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ListEntitiesResponse) GetJSON200() *struct { Data *[]Widget `json:"data,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` @@ -1932,7 +2165,7 @@ type PostFooResponse struct { JSON200 *BarResponse } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r PostFooResponse) GetJSON200() *BarResponse { return r.JSON200 } @@ -1972,7 +2205,7 @@ type ListItemsResponse2 struct { JSON200 *ListItemsResponse } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ListItemsResponse2) GetJSON200() *ListItemsResponse { return r.JSON200 } @@ -2012,7 +2245,7 @@ type CreateItemResponse2 struct { JSON200 *CreateItemResponse } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r CreateItemResponse2) GetJSON200() *CreateItemResponse { return r.JSON200 } @@ -2052,7 +2285,7 @@ type CreateOrderResponse struct { JSON200 *Order } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r CreateOrderResponse) GetJSON200() *Order { return r.JSON200 } @@ -2092,7 +2325,7 @@ type GetOutcomeResponse struct { JSON200 *OutcomeResult } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetOutcomeResponse) GetJSON200() *OutcomeResult { return r.JSON200 } @@ -2166,7 +2399,7 @@ type SendPayloadResponse struct { JSON200 *Payload } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r SendPayloadResponse) GetJSON200() *Payload { return r.JSON200 } @@ -2206,7 +2439,7 @@ type CreatePetResponse struct { JSON200 *Pet } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r CreatePetResponse) GetJSON200() *Pet { return r.JSON200 } @@ -2246,7 +2479,7 @@ type QueryResponse2 struct { JSON200 *QueryResponse } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r QueryResponse2) GetJSON200() *QueryResponse { return r.JSON200 } @@ -2286,7 +2519,7 @@ type GetQuxResponse struct { JSON200 *QuxResponse } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetQuxResponse) GetJSON200() *QuxResponse { return r.JSON200 } @@ -2360,7 +2593,7 @@ type GetRenamedSchemaResponse struct { JSON200 *Renamer } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetRenamedSchemaResponse) GetJSON200() *Renamer { return r.JSON200 } @@ -2437,22 +2670,22 @@ type PatchResourceResponse struct { ApplicationmergePatchJSON200 *N200ResourcePatchResponseJSON4ApplicationMergePatchPlusJSON } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r PatchResourceResponse) GetJSON200() *N200ResourcePatchResponseJSONApplicationJSON { return r.JSON200 } -// GetApplicationjsonPatchJSON200 returns ApplicationjsonPatchJSON200 +// GetApplicationjsonPatchJSON200 returns the response for an HTTP 200 `application/json-patch+json` response func (r PatchResourceResponse) GetApplicationjsonPatchJSON200() *N200ResourcePatchResponseJSON2ApplicationJSONPatchPlusJSON { return r.ApplicationjsonPatchJSON200 } -// GetApplicationjsonPatchQueryJSON200 returns ApplicationjsonPatchQueryJSON200 +// GetApplicationjsonPatchQueryJSON200 returns the response for an HTTP 200 `application/json-patch-query+json` response func (r PatchResourceResponse) GetApplicationjsonPatchQueryJSON200() *N200ResourcePatchResponseJSON3ApplicationJSONPatchQueryPlusJSON { return r.ApplicationjsonPatchQueryJSON200 } -// GetApplicationmergePatchJSON200 returns ApplicationmergePatchJSON200 +// GetApplicationmergePatchJSON200 returns the response for an HTTP 200 `application/merge-patch+json` response func (r PatchResourceResponse) GetApplicationmergePatchJSON200() *N200ResourcePatchResponseJSON4ApplicationMergePatchPlusJSON { return r.ApplicationmergePatchJSON200 } @@ -2492,7 +2725,7 @@ type GetStatusResponse2 struct { JSON200 *GetStatusResponse } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetStatusResponse2) GetJSON200() *GetStatusResponse { return r.JSON200 } @@ -2532,7 +2765,7 @@ type GetZapResponse struct { JSON200 *ZapResponse } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetZapResponse) GetJSON200() *ZapResponse { return r.JSON200 } @@ -2600,7 +2833,10 @@ func (r PostZapResponse) ContentType() string { return "" } -// ListEntitiesWithResponse request returning *ListEntitiesResponse +// ListEntitiesWithResponse performs a GET /entities (the `ListEntities` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) ListEntitiesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListEntitiesResponse, error) { rsp, err := c.ListEntities(ctx, reqEditors...) if err != nil { @@ -2609,7 +2845,11 @@ func (c *ClientWithResponses) ListEntitiesWithResponse(ctx context.Context, reqE return ParseListEntitiesResponse(rsp) } -// PostFooWithBodyWithResponse request with arbitrary body returning *PostFooResponse +// PostFooWithBodyWithResponse performs a POST /foo (the `PostFoo` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostFooWithBodyWithResponse(ctx context.Context, params *PostFooParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFooResponse, error) { rsp, err := c.PostFooWithBody(ctx, params, contentType, body, reqEditors...) if err != nil { @@ -2618,6 +2858,8 @@ func (c *ClientWithResponses) PostFooWithBodyWithResponse(ctx context.Context, p return ParsePostFooResponse(rsp) } +// PostFooWithResponse performs a POST /foo (the `PostFoo` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostFooWithResponse(ctx context.Context, params *PostFooParams, body PostFooJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFooResponse, error) { rsp, err := c.PostFoo(ctx, params, body, reqEditors...) if err != nil { @@ -2626,7 +2868,10 @@ func (c *ClientWithResponses) PostFooWithResponse(ctx context.Context, params *P return ParsePostFooResponse(rsp) } -// ListItemsWithResponse request returning *ListItemsResponse2 +// ListItemsWithResponse performs a GET /items (the `ListItems` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) ListItemsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListItemsResponse2, error) { rsp, err := c.ListItems(ctx, reqEditors...) if err != nil { @@ -2635,7 +2880,11 @@ func (c *ClientWithResponses) ListItemsWithResponse(ctx context.Context, reqEdit return ParseListItemsResponse2(rsp) } -// CreateItemWithBodyWithResponse request with arbitrary body returning *CreateItemResponse2 +// CreateItemWithBodyWithResponse performs a POST /items (the `CreateItem` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) CreateItemWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateItemResponse2, error) { rsp, err := c.CreateItemWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2644,6 +2893,8 @@ func (c *ClientWithResponses) CreateItemWithBodyWithResponse(ctx context.Context return ParseCreateItemResponse2(rsp) } +// CreateItemWithResponse performs a POST /items (the `CreateItem` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) CreateItemWithResponse(ctx context.Context, body CreateItemJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateItemResponse2, error) { rsp, err := c.CreateItem(ctx, body, reqEditors...) if err != nil { @@ -2652,7 +2903,11 @@ func (c *ClientWithResponses) CreateItemWithResponse(ctx context.Context, body C return ParseCreateItemResponse2(rsp) } -// CreateOrderWithBodyWithResponse request with arbitrary body returning *CreateOrderResponse +// CreateOrderWithBodyWithResponse performs a POST /orders (the `CreateOrder` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) CreateOrderWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOrderResponse, error) { rsp, err := c.CreateOrderWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2661,6 +2916,8 @@ func (c *ClientWithResponses) CreateOrderWithBodyWithResponse(ctx context.Contex return ParseCreateOrderResponse(rsp) } +// CreateOrderWithResponse performs a POST /orders (the `CreateOrder` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) CreateOrderWithResponse(ctx context.Context, body CreateOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrderResponse, error) { rsp, err := c.CreateOrder(ctx, body, reqEditors...) if err != nil { @@ -2669,6 +2926,8 @@ func (c *ClientWithResponses) CreateOrderWithResponse(ctx context.Context, body return ParseCreateOrderResponse(rsp) } +// CreateOrderWithResponse performs a POST /orders (the `CreateOrder` operationId) request, +// Takes a body of the `application/json-patch+json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) CreateOrderWithApplicationJSONPatchPlusJSONBodyWithResponse(ctx context.Context, body CreateOrderApplicationJSONPatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrderResponse, error) { rsp, err := c.CreateOrderWithApplicationJSONPatchPlusJSONBody(ctx, body, reqEditors...) if err != nil { @@ -2677,6 +2936,8 @@ func (c *ClientWithResponses) CreateOrderWithApplicationJSONPatchPlusJSONBodyWit return ParseCreateOrderResponse(rsp) } +// CreateOrderWithResponse performs a POST /orders (the `CreateOrder` operationId) request, +// Takes a body of the `application/merge-patch+json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) CreateOrderWithApplicationMergePatchPlusJSONBodyWithResponse(ctx context.Context, body CreateOrderApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOrderResponse, error) { rsp, err := c.CreateOrderWithApplicationMergePatchPlusJSONBody(ctx, body, reqEditors...) if err != nil { @@ -2685,7 +2946,10 @@ func (c *ClientWithResponses) CreateOrderWithApplicationMergePatchPlusJSONBodyWi return ParseCreateOrderResponse(rsp) } -// GetOutcomeWithResponse request returning *GetOutcomeResponse +// GetOutcomeWithResponse performs a GET /outcome (the `GetOutcome` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetOutcomeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOutcomeResponse, error) { rsp, err := c.GetOutcome(ctx, reqEditors...) if err != nil { @@ -2694,7 +2958,11 @@ func (c *ClientWithResponses) GetOutcomeWithResponse(ctx context.Context, reqEdi return ParseGetOutcomeResponse(rsp) } -// PostOutcomeWithBodyWithResponse request with arbitrary body returning *PostOutcomeResponse +// PostOutcomeWithBodyWithResponse performs a POST /outcome (the `PostOutcome` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostOutcomeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostOutcomeResponse, error) { rsp, err := c.PostOutcomeWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2703,6 +2971,8 @@ func (c *ClientWithResponses) PostOutcomeWithBodyWithResponse(ctx context.Contex return ParsePostOutcomeResponse(rsp) } +// PostOutcomeWithResponse performs a POST /outcome (the `PostOutcome` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostOutcomeWithResponse(ctx context.Context, body PostOutcomeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostOutcomeResponse, error) { rsp, err := c.PostOutcome(ctx, body, reqEditors...) if err != nil { @@ -2711,7 +2981,11 @@ func (c *ClientWithResponses) PostOutcomeWithResponse(ctx context.Context, body return ParsePostOutcomeResponse(rsp) } -// SendPayloadWithBodyWithResponse request with arbitrary body returning *SendPayloadResponse +// SendPayloadWithBodyWithResponse performs a POST /payload (the `SendPayload` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) SendPayloadWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendPayloadResponse, error) { rsp, err := c.SendPayloadWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2720,6 +2994,8 @@ func (c *ClientWithResponses) SendPayloadWithBodyWithResponse(ctx context.Contex return ParseSendPayloadResponse(rsp) } +// SendPayloadWithResponse performs a POST /payload (the `SendPayload` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) SendPayloadWithResponse(ctx context.Context, body SendPayloadJSONRequestBody, reqEditors ...RequestEditorFn) (*SendPayloadResponse, error) { rsp, err := c.SendPayload(ctx, body, reqEditors...) if err != nil { @@ -2728,7 +3004,11 @@ func (c *ClientWithResponses) SendPayloadWithResponse(ctx context.Context, body return ParseSendPayloadResponse(rsp) } -// CreatePetWithBodyWithResponse request with arbitrary body returning *CreatePetResponse +// CreatePetWithBodyWithResponse performs a POST /pets (the `CreatePet` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) CreatePetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePetResponse, error) { rsp, err := c.CreatePetWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2737,6 +3017,8 @@ func (c *ClientWithResponses) CreatePetWithBodyWithResponse(ctx context.Context, return ParseCreatePetResponse(rsp) } +// CreatePetWithResponse performs a POST /pets (the `CreatePet` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) CreatePetWithResponse(ctx context.Context, body CreatePetJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePetResponse, error) { rsp, err := c.CreatePet(ctx, body, reqEditors...) if err != nil { @@ -2745,7 +3027,11 @@ func (c *ClientWithResponses) CreatePetWithResponse(ctx context.Context, body Cr return ParseCreatePetResponse(rsp) } -// QueryWithBodyWithResponse request with arbitrary body returning *QueryResponse2 +// QueryWithBodyWithResponse performs a POST /query (the `Query` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) QueryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueryResponse2, error) { rsp, err := c.QueryWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2754,6 +3040,8 @@ func (c *ClientWithResponses) QueryWithBodyWithResponse(ctx context.Context, con return ParseQueryResponse2(rsp) } +// QueryWithResponse performs a POST /query (the `Query` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) QueryWithResponse(ctx context.Context, body QueryJSONRequestBody, reqEditors ...RequestEditorFn) (*QueryResponse2, error) { rsp, err := c.Query(ctx, body, reqEditors...) if err != nil { @@ -2762,7 +3050,10 @@ func (c *ClientWithResponses) QueryWithResponse(ctx context.Context, body QueryJ return ParseQueryResponse2(rsp) } -// GetQuxWithResponse request returning *GetQuxResponse +// GetQuxWithResponse performs a GET /qux (the `GetQux` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetQuxWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetQuxResponse, error) { rsp, err := c.GetQux(ctx, reqEditors...) if err != nil { @@ -2771,7 +3062,11 @@ func (c *ClientWithResponses) GetQuxWithResponse(ctx context.Context, reqEditors return ParseGetQuxResponse(rsp) } -// PostQuxWithBodyWithResponse request with arbitrary body returning *PostQuxResponse +// PostQuxWithBodyWithResponse performs a POST /qux (the `PostQux` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostQuxWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostQuxResponse, error) { rsp, err := c.PostQuxWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2780,6 +3075,8 @@ func (c *ClientWithResponses) PostQuxWithBodyWithResponse(ctx context.Context, c return ParsePostQuxResponse(rsp) } +// PostQuxWithResponse performs a POST /qux (the `PostQux` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostQuxWithResponse(ctx context.Context, body PostQuxJSONRequestBody, reqEditors ...RequestEditorFn) (*PostQuxResponse, error) { rsp, err := c.PostQux(ctx, body, reqEditors...) if err != nil { @@ -2788,7 +3085,10 @@ func (c *ClientWithResponses) PostQuxWithResponse(ctx context.Context, body Post return ParsePostQuxResponse(rsp) } -// GetRenamedSchemaWithResponse request returning *GetRenamedSchemaResponse +// GetRenamedSchemaWithResponse performs a GET /renamed-schema (the `GetRenamedSchema` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetRenamedSchemaWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetRenamedSchemaResponse, error) { rsp, err := c.GetRenamedSchema(ctx, reqEditors...) if err != nil { @@ -2797,7 +3097,11 @@ func (c *ClientWithResponses) GetRenamedSchemaWithResponse(ctx context.Context, return ParseGetRenamedSchemaResponse(rsp) } -// PostRenamedSchemaWithBodyWithResponse request with arbitrary body returning *PostRenamedSchemaResponse +// PostRenamedSchemaWithBodyWithResponse performs a POST /renamed-schema (the `PostRenamedSchema` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostRenamedSchemaWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostRenamedSchemaResponse, error) { rsp, err := c.PostRenamedSchemaWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2806,6 +3110,8 @@ func (c *ClientWithResponses) PostRenamedSchemaWithBodyWithResponse(ctx context. return ParsePostRenamedSchemaResponse(rsp) } +// PostRenamedSchemaWithResponse performs a POST /renamed-schema (the `PostRenamedSchema` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostRenamedSchemaWithResponse(ctx context.Context, body PostRenamedSchemaJSONRequestBody, reqEditors ...RequestEditorFn) (*PostRenamedSchemaResponse, error) { rsp, err := c.PostRenamedSchema(ctx, body, reqEditors...) if err != nil { @@ -2814,7 +3120,11 @@ func (c *ClientWithResponses) PostRenamedSchemaWithResponse(ctx context.Context, return ParsePostRenamedSchemaResponse(rsp) } -// PatchResourceWithBodyWithResponse request with arbitrary body returning *PatchResourceResponse +// PatchResourceWithBodyWithResponse performs a PATCH /resources/{id} (the `PatchResource` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PatchResourceWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchResourceResponse, error) { rsp, err := c.PatchResourceWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { @@ -2823,6 +3133,8 @@ func (c *ClientWithResponses) PatchResourceWithBodyWithResponse(ctx context.Cont return ParsePatchResourceResponse(rsp) } +// PatchResourceWithResponse performs a PATCH /resources/{id} (the `PatchResource` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PatchResourceWithResponse(ctx context.Context, id string, body PatchResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchResourceResponse, error) { rsp, err := c.PatchResource(ctx, id, body, reqEditors...) if err != nil { @@ -2831,6 +3143,8 @@ func (c *ClientWithResponses) PatchResourceWithResponse(ctx context.Context, id return ParsePatchResourceResponse(rsp) } +// PatchResourceWithResponse performs a PATCH /resources/{id} (the `PatchResource` operationId) request, +// Takes a body of the `application/json-patch+json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PatchResourceWithApplicationJSONPatchPlusJSONBodyWithResponse(ctx context.Context, id string, body PatchResourceApplicationJSONPatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchResourceResponse, error) { rsp, err := c.PatchResourceWithApplicationJSONPatchPlusJSONBody(ctx, id, body, reqEditors...) if err != nil { @@ -2839,6 +3153,8 @@ func (c *ClientWithResponses) PatchResourceWithApplicationJSONPatchPlusJSONBodyW return ParsePatchResourceResponse(rsp) } +// PatchResourceWithResponse performs a PATCH /resources/{id} (the `PatchResource` operationId) request, +// Takes a body of the `application/merge-patch+json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PatchResourceWithApplicationMergePatchPlusJSONBodyWithResponse(ctx context.Context, id string, body PatchResourceApplicationMergePatchPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchResourceResponse, error) { rsp, err := c.PatchResourceWithApplicationMergePatchPlusJSONBody(ctx, id, body, reqEditors...) if err != nil { @@ -2847,7 +3163,10 @@ func (c *ClientWithResponses) PatchResourceWithApplicationMergePatchPlusJSONBody return ParsePatchResourceResponse(rsp) } -// GetStatusWithResponse request returning *GetStatusResponse2 +// GetStatusWithResponse performs a GET /status (the `GetStatus` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse2, error) { rsp, err := c.GetStatus(ctx, reqEditors...) if err != nil { @@ -2856,7 +3175,10 @@ func (c *ClientWithResponses) GetStatusWithResponse(ctx context.Context, reqEdit return ParseGetStatusResponse2(rsp) } -// GetZapWithResponse request returning *GetZapResponse +// GetZapWithResponse performs a GET /zap (the `GetZap` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetZapWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetZapResponse, error) { rsp, err := c.GetZap(ctx, reqEditors...) if err != nil { @@ -2865,7 +3187,11 @@ func (c *ClientWithResponses) GetZapWithResponse(ctx context.Context, reqEditors return ParseGetZapResponse(rsp) } -// PostZapWithBodyWithResponse request with arbitrary body returning *PostZapResponse +// PostZapWithBodyWithResponse performs a POST /zap (the `PostZap` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) PostZapWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostZapResponse, error) { rsp, err := c.PostZapWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2874,6 +3200,8 @@ func (c *ClientWithResponses) PostZapWithBodyWithResponse(ctx context.Context, c return ParsePostZapResponse(rsp) } +// PostZapWithResponse performs a POST /zap (the `PostZap` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) PostZapWithResponse(ctx context.Context, body PostZapJSONRequestBody, reqEditors ...RequestEditorFn) (*PostZapResponse, error) { rsp, err := c.PostZap(ctx, body, reqEditors...) if err != nil { diff --git a/internal/test/outputoptions/name-normalizer/to-camel-case-with-additional-initialisms/name_normalizer.gen.go b/internal/test/outputoptions/name-normalizer/to-camel-case-with-additional-initialisms/name_normalizer.gen.go index 8796ba4b3a..437f0df989 100644 --- a/internal/test/outputoptions/name-normalizer/to-camel-case-with-additional-initialisms/name_normalizer.gen.go +++ b/internal/test/outputoptions/name-normalizer/to-camel-case-with-additional-initialisms/name_normalizer.gen.go @@ -117,7 +117,7 @@ func (t *OneOf2Things) UnmarshalJSON(b []byte) error { return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -190,10 +190,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetHTTPPet request + + // GetHTTPPet Get pet given identifier. + // + // Corresponds with GET /api/pets/{petId} (the `GetHTTPPet` operationId). + GetHTTPPet(ctx context.Context, petID string, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetHTTPPet Get pet given identifier. +// +// Corresponds with GET /api/pets/{petId} (the `GetHTTPPet` operationId). + func (c *Client) GetHTTPPet(ctx context.Context, petID string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHTTPPetRequest(c.Server, petID) if err != nil { @@ -206,7 +214,7 @@ func (c *Client) GetHTTPPet(ctx context.Context, petID string, reqEditors ...Req return c.Client.Do(req) } -// NewGetHTTPPetRequest generates requests for GetHTTPPet +// NewGetHTTPPetRequest constructs an http.Request for the GetHTTPPet method func NewGetHTTPPetRequest(server string, petID string) (*http.Request, error) { var err error @@ -283,7 +291,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetHTTPPetWithResponse request + + // GetHTTPPetWithResponse Get pet given identifier. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /api/pets/{petId} (the `GetHTTPPet` operationId). + GetHTTPPetWithResponse(ctx context.Context, petID string, reqEditors ...RequestEditorFn) (*GetHTTPPetResponse, error) } @@ -293,7 +307,7 @@ type GetHTTPPetResponse struct { JSON200 *Pet } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetHTTPPetResponse) GetJSON200() *Pet { return r.JSON200 } @@ -327,7 +341,12 @@ func (r GetHTTPPetResponse) ContentType() string { return "" } -// GetHTTPPetWithResponse request returning *GetHTTPPetResponse +// GetHTTPPetWithResponse Get pet given identifier. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /api/pets/{petId} (the `GetHTTPPet` operationId). + func (c *ClientWithResponses) GetHTTPPetWithResponse(ctx context.Context, petID string, reqEditors ...RequestEditorFn) (*GetHTTPPetResponse, error) { rsp, err := c.GetHTTPPet(ctx, petID, reqEditors...) if err != nil { @@ -364,7 +383,7 @@ func ParseGetHTTPPetResponse(rsp *http.Response) (*GetHTTPPetResponse, error) { // ServerInterface represents all server handlers. type ServerInterface interface { - // Get pet given identifier. + // GetHTTPPet Get pet given identifier. // (GET /api/pets/{petId}) GetHTTPPet(w http.ResponseWriter, r *http.Request, petID string) } diff --git a/internal/test/outputoptions/name-normalizer/to-camel-case-with-digits/name_normalizer.gen.go b/internal/test/outputoptions/name-normalizer/to-camel-case-with-digits/name_normalizer.gen.go index 071a7a7386..d43f9222fa 100644 --- a/internal/test/outputoptions/name-normalizer/to-camel-case-with-digits/name_normalizer.gen.go +++ b/internal/test/outputoptions/name-normalizer/to-camel-case-with-digits/name_normalizer.gen.go @@ -117,7 +117,7 @@ func (t *OneOf2Things) UnmarshalJSON(b []byte) error { return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -190,10 +190,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetHttpPet request + + // GetHttpPet Get pet given identifier. + // + // Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + GetHttpPet(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetHttpPet Get pet given identifier. +// +// Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + func (c *Client) GetHttpPet(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHttpPetRequest(c.Server, petId) if err != nil { @@ -206,7 +214,7 @@ func (c *Client) GetHttpPet(ctx context.Context, petId string, reqEditors ...Req return c.Client.Do(req) } -// NewGetHttpPetRequest generates requests for GetHttpPet +// NewGetHttpPetRequest constructs an http.Request for the GetHttpPet method func NewGetHttpPetRequest(server string, petId string) (*http.Request, error) { var err error @@ -283,7 +291,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetHttpPetWithResponse request + + // GetHttpPetWithResponse Get pet given identifier. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + GetHttpPetWithResponse(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*GetHttpPetResponse, error) } @@ -293,7 +307,7 @@ type GetHttpPetResponse struct { JSON200 *Pet } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetHttpPetResponse) GetJSON200() *Pet { return r.JSON200 } @@ -327,7 +341,12 @@ func (r GetHttpPetResponse) ContentType() string { return "" } -// GetHttpPetWithResponse request returning *GetHttpPetResponse +// GetHttpPetWithResponse Get pet given identifier. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + func (c *ClientWithResponses) GetHttpPetWithResponse(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*GetHttpPetResponse, error) { rsp, err := c.GetHttpPet(ctx, petId, reqEditors...) if err != nil { @@ -364,7 +383,7 @@ func ParseGetHttpPetResponse(rsp *http.Response) (*GetHttpPetResponse, error) { // ServerInterface represents all server handlers. type ServerInterface interface { - // Get pet given identifier. + // GetHttpPet Get pet given identifier. // (GET /api/pets/{petId}) GetHttpPet(w http.ResponseWriter, r *http.Request, petId string) } diff --git a/internal/test/outputoptions/name-normalizer/to-camel-case-with-initialisms/name_normalizer.gen.go b/internal/test/outputoptions/name-normalizer/to-camel-case-with-initialisms/name_normalizer.gen.go index 5ed20a5756..18ef401ee5 100644 --- a/internal/test/outputoptions/name-normalizer/to-camel-case-with-initialisms/name_normalizer.gen.go +++ b/internal/test/outputoptions/name-normalizer/to-camel-case-with-initialisms/name_normalizer.gen.go @@ -117,7 +117,7 @@ func (t *OneOf2Things) UnmarshalJSON(b []byte) error { return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -190,10 +190,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetHTTPPet request + + // GetHTTPPet Get pet given identifier. + // + // Corresponds with GET /api/pets/{petId} (the `GetHTTPPet` operationId). + GetHTTPPet(ctx context.Context, petID string, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetHTTPPet Get pet given identifier. +// +// Corresponds with GET /api/pets/{petId} (the `GetHTTPPet` operationId). + func (c *Client) GetHTTPPet(ctx context.Context, petID string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHTTPPetRequest(c.Server, petID) if err != nil { @@ -206,7 +214,7 @@ func (c *Client) GetHTTPPet(ctx context.Context, petID string, reqEditors ...Req return c.Client.Do(req) } -// NewGetHTTPPetRequest generates requests for GetHTTPPet +// NewGetHTTPPetRequest constructs an http.Request for the GetHTTPPet method func NewGetHTTPPetRequest(server string, petID string) (*http.Request, error) { var err error @@ -283,7 +291,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetHTTPPetWithResponse request + + // GetHTTPPetWithResponse Get pet given identifier. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /api/pets/{petId} (the `GetHTTPPet` operationId). + GetHTTPPetWithResponse(ctx context.Context, petID string, reqEditors ...RequestEditorFn) (*GetHTTPPetResponse, error) } @@ -293,7 +307,7 @@ type GetHTTPPetResponse struct { JSON200 *Pet } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetHTTPPetResponse) GetJSON200() *Pet { return r.JSON200 } @@ -327,7 +341,12 @@ func (r GetHTTPPetResponse) ContentType() string { return "" } -// GetHTTPPetWithResponse request returning *GetHTTPPetResponse +// GetHTTPPetWithResponse Get pet given identifier. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /api/pets/{petId} (the `GetHTTPPet` operationId). + func (c *ClientWithResponses) GetHTTPPetWithResponse(ctx context.Context, petID string, reqEditors ...RequestEditorFn) (*GetHTTPPetResponse, error) { rsp, err := c.GetHTTPPet(ctx, petID, reqEditors...) if err != nil { @@ -364,7 +383,7 @@ func ParseGetHTTPPetResponse(rsp *http.Response) (*GetHTTPPetResponse, error) { // ServerInterface represents all server handlers. type ServerInterface interface { - // Get pet given identifier. + // GetHTTPPet Get pet given identifier. // (GET /api/pets/{petId}) GetHTTPPet(w http.ResponseWriter, r *http.Request, petID string) } diff --git a/internal/test/outputoptions/name-normalizer/to-camel-case/name_normalizer.gen.go b/internal/test/outputoptions/name-normalizer/to-camel-case/name_normalizer.gen.go index 08c90baded..7720b39c3e 100644 --- a/internal/test/outputoptions/name-normalizer/to-camel-case/name_normalizer.gen.go +++ b/internal/test/outputoptions/name-normalizer/to-camel-case/name_normalizer.gen.go @@ -117,7 +117,7 @@ func (t *OneOf2things) UnmarshalJSON(b []byte) error { return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -190,10 +190,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetHttpPet request + + // GetHttpPet Get pet given identifier. + // + // Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + GetHttpPet(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetHttpPet Get pet given identifier. +// +// Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + func (c *Client) GetHttpPet(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHttpPetRequest(c.Server, petId) if err != nil { @@ -206,7 +214,7 @@ func (c *Client) GetHttpPet(ctx context.Context, petId string, reqEditors ...Req return c.Client.Do(req) } -// NewGetHttpPetRequest generates requests for GetHttpPet +// NewGetHttpPetRequest constructs an http.Request for the GetHttpPet method func NewGetHttpPetRequest(server string, petId string) (*http.Request, error) { var err error @@ -283,7 +291,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetHttpPetWithResponse request + + // GetHttpPetWithResponse Get pet given identifier. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + GetHttpPetWithResponse(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*GetHttpPetResponse, error) } @@ -293,7 +307,7 @@ type GetHttpPetResponse struct { JSON200 *Pet } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetHttpPetResponse) GetJSON200() *Pet { return r.JSON200 } @@ -327,7 +341,12 @@ func (r GetHttpPetResponse) ContentType() string { return "" } -// GetHttpPetWithResponse request returning *GetHttpPetResponse +// GetHttpPetWithResponse Get pet given identifier. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + func (c *ClientWithResponses) GetHttpPetWithResponse(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*GetHttpPetResponse, error) { rsp, err := c.GetHttpPet(ctx, petId, reqEditors...) if err != nil { @@ -364,7 +383,7 @@ func ParseGetHttpPetResponse(rsp *http.Response) (*GetHttpPetResponse, error) { // ServerInterface represents all server handlers. type ServerInterface interface { - // Get pet given identifier. + // GetHttpPet Get pet given identifier. // (GET /api/pets/{petId}) GetHttpPet(w http.ResponseWriter, r *http.Request, petId string) } diff --git a/internal/test/outputoptions/name-normalizer/unset/name_normalizer.gen.go b/internal/test/outputoptions/name-normalizer/unset/name_normalizer.gen.go index cbdde2a4ef..607e8bcc63 100644 --- a/internal/test/outputoptions/name-normalizer/unset/name_normalizer.gen.go +++ b/internal/test/outputoptions/name-normalizer/unset/name_normalizer.gen.go @@ -117,7 +117,7 @@ func (t *OneOf2things) UnmarshalJSON(b []byte) error { return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -190,10 +190,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetHttpPet request + + // GetHttpPet Get pet given identifier. + // + // Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + GetHttpPet(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetHttpPet Get pet given identifier. +// +// Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + func (c *Client) GetHttpPet(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHttpPetRequest(c.Server, petId) if err != nil { @@ -206,7 +214,7 @@ func (c *Client) GetHttpPet(ctx context.Context, petId string, reqEditors ...Req return c.Client.Do(req) } -// NewGetHttpPetRequest generates requests for GetHttpPet +// NewGetHttpPetRequest constructs an http.Request for the GetHttpPet method func NewGetHttpPetRequest(server string, petId string) (*http.Request, error) { var err error @@ -283,7 +291,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetHttpPetWithResponse request + + // GetHttpPetWithResponse Get pet given identifier. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + GetHttpPetWithResponse(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*GetHttpPetResponse, error) } @@ -293,7 +307,7 @@ type GetHttpPetResponse struct { JSON200 *Pet } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetHttpPetResponse) GetJSON200() *Pet { return r.JSON200 } @@ -327,7 +341,12 @@ func (r GetHttpPetResponse) ContentType() string { return "" } -// GetHttpPetWithResponse request returning *GetHttpPetResponse +// GetHttpPetWithResponse Get pet given identifier. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /api/pets/{petId} (the `GetHttpPet` operationId). + func (c *ClientWithResponses) GetHttpPetWithResponse(ctx context.Context, petId string, reqEditors ...RequestEditorFn) (*GetHttpPetResponse, error) { rsp, err := c.GetHttpPet(ctx, petId, reqEditors...) if err != nil { @@ -364,7 +383,7 @@ func ParseGetHttpPetResponse(rsp *http.Response) (*GetHttpPetResponse, error) { // ServerInterface represents all server handlers. type ServerInterface interface { - // Get pet given identifier. + // GetHttpPet Get pet given identifier. // (GET /api/pets/{petId}) GetHttpPet(w http.ResponseWriter, r *http.Request, petId string) } diff --git a/internal/test/outputoptions/response-body-getters/enabled/response_body_getters.gen.go b/internal/test/outputoptions/response-body-getters/enabled/response_body_getters.gen.go index 28f7addd07..17566c5936 100644 --- a/internal/test/outputoptions/response-body-getters/enabled/response_body_getters.gen.go +++ b/internal/test/outputoptions/response-body-getters/enabled/response_body_getters.gen.go @@ -27,7 +27,7 @@ type Thing struct { Name string `json:"name"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -100,10 +100,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetThing request + + // GetThing Get a thing by id + // + // Corresponds with GET /things/{id} (the `GetThing` operationId). + GetThing(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetThing Get a thing by id +// +// Corresponds with GET /things/{id} (the `GetThing` operationId). + func (c *Client) GetThing(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetThingRequest(c.Server, id) if err != nil { @@ -116,7 +124,7 @@ func (c *Client) GetThing(ctx context.Context, id string, reqEditors ...RequestE return c.Client.Do(req) } -// NewGetThingRequest generates requests for GetThing +// NewGetThingRequest constructs an http.Request for the GetThing method func NewGetThingRequest(server string, id string) (*http.Request, error) { var err error @@ -193,7 +201,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetThingWithResponse request + + // GetThingWithResponse Get a thing by id + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /things/{id} (the `GetThing` operationId). + GetThingWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetThingResponse, error) } @@ -204,12 +218,12 @@ type GetThingResponse struct { JSONDefault *Error } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetThingResponse) GetJSON200() *Thing { return r.JSON200 } -// GetJSONDefault returns JSONDefault +// GetJSONDefault returns the response for an HTTP default `application/json` response func (r GetThingResponse) GetJSONDefault() *Error { return r.JSONDefault } @@ -243,7 +257,12 @@ func (r GetThingResponse) ContentType() string { return "" } -// GetThingWithResponse request returning *GetThingResponse +// GetThingWithResponse Get a thing by id +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /things/{id} (the `GetThing` operationId). + func (c *ClientWithResponses) GetThingWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetThingResponse, error) { rsp, err := c.GetThing(ctx, id, reqEditors...) if err != nil { diff --git a/internal/test/outputoptions/response-body-getters/skipped/response_body_getters.gen.go b/internal/test/outputoptions/response-body-getters/skipped/response_body_getters.gen.go index e071efe847..668847c0cb 100644 --- a/internal/test/outputoptions/response-body-getters/skipped/response_body_getters.gen.go +++ b/internal/test/outputoptions/response-body-getters/skipped/response_body_getters.gen.go @@ -27,7 +27,7 @@ type Thing struct { Name string `json:"name"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -100,10 +100,18 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetThing request + + // GetThing Get a thing by id + // + // Corresponds with GET /things/{id} (the `GetThing` operationId). + GetThing(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetThing Get a thing by id +// +// Corresponds with GET /things/{id} (the `GetThing` operationId). + func (c *Client) GetThing(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetThingRequest(c.Server, id) if err != nil { @@ -116,7 +124,7 @@ func (c *Client) GetThing(ctx context.Context, id string, reqEditors ...RequestE return c.Client.Do(req) } -// NewGetThingRequest generates requests for GetThing +// NewGetThingRequest constructs an http.Request for the GetThing method func NewGetThingRequest(server string, id string) (*http.Request, error) { var err error @@ -193,7 +201,13 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetThingWithResponse request + + // GetThingWithResponse Get a thing by id + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /things/{id} (the `GetThing` operationId). + GetThingWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetThingResponse, error) } @@ -228,7 +242,12 @@ func (r GetThingResponse) ContentType() string { return "" } -// GetThingWithResponse request returning *GetThingResponse +// GetThingWithResponse Get a thing by id +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /things/{id} (the `GetThing` operationId). + func (c *ClientWithResponses) GetThingWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetThingResponse, error) { rsp, err := c.GetThing(ctx, id, reqEditors...) if err != nil { diff --git a/internal/test/parameters/client/gen/client.gen.go b/internal/test/parameters/client/gen/client.gen.go index 0baa386b1f..3e90f0a82c 100644 --- a/internal/test/parameters/client/gen/client.gen.go +++ b/internal/test/parameters/client/gen/client.gen.go @@ -154,7 +154,7 @@ type GetQueryFormParams struct { N1s *string `form:"1s,omitempty" json:"1s,omitempty"` } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -227,88 +227,118 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetContentObject request + + // GetContentObject performs a GET /contentObject/{param} (the `GetContentObject` operationId) request. + GetContentObject(ctx context.Context, param ComplexObject, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetCookie request + // GetCookie performs a GET /cookie (the `GetCookie` operationId) request. + GetCookie(ctx context.Context, params *GetCookieParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // EnumParams request + // EnumParams performs a GET /enums (the `EnumParams` operationId) request. + EnumParams(ctx context.Context, params *EnumParamsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetHeader request + // GetHeader performs a GET /header (the `GetHeader` operationId) request. + GetHeader(ctx context.Context, params *GetHeaderParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetLabelExplodeArray request + // GetLabelExplodeArray performs a GET /labelExplodeArray/{.param*} (the `GetLabelExplodeArray` operationId) request. + GetLabelExplodeArray(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetLabelExplodeObject request + // GetLabelExplodeObject performs a GET /labelExplodeObject/{.param*} (the `GetLabelExplodeObject` operationId) request. + GetLabelExplodeObject(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetLabelExplodePrimitive request + // GetLabelExplodePrimitive performs a GET /labelExplodePrimitive/{.param*} (the `GetLabelExplodePrimitive` operationId) request. + GetLabelExplodePrimitive(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetLabelNoExplodeArray request + // GetLabelNoExplodeArray performs a GET /labelNoExplodeArray/{.param} (the `GetLabelNoExplodeArray` operationId) request. + GetLabelNoExplodeArray(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetLabelNoExplodeObject request + // GetLabelNoExplodeObject performs a GET /labelNoExplodeObject/{.param} (the `GetLabelNoExplodeObject` operationId) request. + GetLabelNoExplodeObject(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetLabelPrimitive request + // GetLabelPrimitive performs a GET /labelPrimitive/{.param} (the `GetLabelPrimitive` operationId) request. + GetLabelPrimitive(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetMatrixExplodeArray request + // GetMatrixExplodeArray performs a GET /matrixExplodeArray/{.id*} (the `GetMatrixExplodeArray` operationId) request. + GetMatrixExplodeArray(ctx context.Context, id []int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetMatrixExplodeObject request + // GetMatrixExplodeObject performs a GET /matrixExplodeObject/{.id*} (the `GetMatrixExplodeObject` operationId) request. + GetMatrixExplodeObject(ctx context.Context, id Object, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetMatrixExplodePrimitive request + // GetMatrixExplodePrimitive performs a GET /matrixExplodePrimitive/{;id*} (the `GetMatrixExplodePrimitive` operationId) request. + GetMatrixExplodePrimitive(ctx context.Context, id int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetMatrixNoExplodeArray request + // GetMatrixNoExplodeArray performs a GET /matrixNoExplodeArray/{.id} (the `GetMatrixNoExplodeArray` operationId) request. + GetMatrixNoExplodeArray(ctx context.Context, id []int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetMatrixNoExplodeObject request + // GetMatrixNoExplodeObject performs a GET /matrixNoExplodeObject/{.id} (the `GetMatrixNoExplodeObject` operationId) request. + GetMatrixNoExplodeObject(ctx context.Context, id Object, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetMatrixPrimitive request + // GetMatrixPrimitive performs a GET /matrixPrimitive/{;id} (the `GetMatrixPrimitive` operationId) request. + GetMatrixPrimitive(ctx context.Context, id int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetPassThrough request + // GetPassThrough performs a GET /passThrough/{param} (the `GetPassThrough` operationId) request. + GetPassThrough(ctx context.Context, param string, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetDeepObject request + // GetDeepObject performs a GET /queryDeepObject (the `GetDeepObject` operationId) request. + GetDeepObject(ctx context.Context, params *GetDeepObjectParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetQueryDelimited request + // GetQueryDelimited performs a GET /queryDelimited (the `GetQueryDelimited` operationId) request. + GetQueryDelimited(ctx context.Context, params *GetQueryDelimitedParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetQueryForm request + // GetQueryForm performs a GET /queryForm (the `GetQueryForm` operationId) request. + GetQueryForm(ctx context.Context, params *GetQueryFormParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetSimpleExplodeArray request + // GetSimpleExplodeArray performs a GET /simpleExplodeArray/{param*} (the `GetSimpleExplodeArray` operationId) request. + GetSimpleExplodeArray(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetSimpleExplodeObject request + // GetSimpleExplodeObject performs a GET /simpleExplodeObject/{param*} (the `GetSimpleExplodeObject` operationId) request. + GetSimpleExplodeObject(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetSimpleExplodePrimitive request + // GetSimpleExplodePrimitive performs a GET /simpleExplodePrimitive/{param} (the `GetSimpleExplodePrimitive` operationId) request. + GetSimpleExplodePrimitive(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetSimpleNoExplodeArray request + // GetSimpleNoExplodeArray performs a GET /simpleNoExplodeArray/{param} (the `GetSimpleNoExplodeArray` operationId) request. + GetSimpleNoExplodeArray(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetSimpleNoExplodeObject request + // GetSimpleNoExplodeObject performs a GET /simpleNoExplodeObject/{param} (the `GetSimpleNoExplodeObject` operationId) request. + GetSimpleNoExplodeObject(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetSimplePrimitive request + // GetSimplePrimitive performs a GET /simplePrimitive/{param} (the `GetSimplePrimitive` operationId) request. + GetSimplePrimitive(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetStartingWithNumber request + // GetStartingWithNumber performs a GET /startingWithNumber/{1param} (the `GetStartingWithNumber` operationId) request. + GetStartingWithNumber(ctx context.Context, n1param string, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetContentObject performs a GET /contentObject/{param} (the `GetContentObject` operationId) request. + func (c *Client) GetContentObject(ctx context.Context, param ComplexObject, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetContentObjectRequest(c.Server, param) if err != nil { @@ -321,6 +351,8 @@ func (c *Client) GetContentObject(ctx context.Context, param ComplexObject, reqE return c.Client.Do(req) } +// GetCookie performs a GET /cookie (the `GetCookie` operationId) request. + func (c *Client) GetCookie(ctx context.Context, params *GetCookieParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetCookieRequest(c.Server, params) if err != nil { @@ -333,6 +365,8 @@ func (c *Client) GetCookie(ctx context.Context, params *GetCookieParams, reqEdit return c.Client.Do(req) } +// EnumParams performs a GET /enums (the `EnumParams` operationId) request. + func (c *Client) EnumParams(ctx context.Context, params *EnumParamsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewEnumParamsRequest(c.Server, params) if err != nil { @@ -345,6 +379,8 @@ func (c *Client) EnumParams(ctx context.Context, params *EnumParamsParams, reqEd return c.Client.Do(req) } +// GetHeader performs a GET /header (the `GetHeader` operationId) request. + func (c *Client) GetHeader(ctx context.Context, params *GetHeaderParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetHeaderRequest(c.Server, params) if err != nil { @@ -357,6 +393,8 @@ func (c *Client) GetHeader(ctx context.Context, params *GetHeaderParams, reqEdit return c.Client.Do(req) } +// GetLabelExplodeArray performs a GET /labelExplodeArray/{.param*} (the `GetLabelExplodeArray` operationId) request. + func (c *Client) GetLabelExplodeArray(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetLabelExplodeArrayRequest(c.Server, param) if err != nil { @@ -369,6 +407,8 @@ func (c *Client) GetLabelExplodeArray(ctx context.Context, param []int32, reqEdi return c.Client.Do(req) } +// GetLabelExplodeObject performs a GET /labelExplodeObject/{.param*} (the `GetLabelExplodeObject` operationId) request. + func (c *Client) GetLabelExplodeObject(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetLabelExplodeObjectRequest(c.Server, param) if err != nil { @@ -381,6 +421,8 @@ func (c *Client) GetLabelExplodeObject(ctx context.Context, param Object, reqEdi return c.Client.Do(req) } +// GetLabelExplodePrimitive performs a GET /labelExplodePrimitive/{.param*} (the `GetLabelExplodePrimitive` operationId) request. + func (c *Client) GetLabelExplodePrimitive(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetLabelExplodePrimitiveRequest(c.Server, param) if err != nil { @@ -393,6 +435,8 @@ func (c *Client) GetLabelExplodePrimitive(ctx context.Context, param int32, reqE return c.Client.Do(req) } +// GetLabelNoExplodeArray performs a GET /labelNoExplodeArray/{.param} (the `GetLabelNoExplodeArray` operationId) request. + func (c *Client) GetLabelNoExplodeArray(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetLabelNoExplodeArrayRequest(c.Server, param) if err != nil { @@ -405,6 +449,8 @@ func (c *Client) GetLabelNoExplodeArray(ctx context.Context, param []int32, reqE return c.Client.Do(req) } +// GetLabelNoExplodeObject performs a GET /labelNoExplodeObject/{.param} (the `GetLabelNoExplodeObject` operationId) request. + func (c *Client) GetLabelNoExplodeObject(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetLabelNoExplodeObjectRequest(c.Server, param) if err != nil { @@ -417,6 +463,8 @@ func (c *Client) GetLabelNoExplodeObject(ctx context.Context, param Object, reqE return c.Client.Do(req) } +// GetLabelPrimitive performs a GET /labelPrimitive/{.param} (the `GetLabelPrimitive` operationId) request. + func (c *Client) GetLabelPrimitive(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetLabelPrimitiveRequest(c.Server, param) if err != nil { @@ -429,6 +477,8 @@ func (c *Client) GetLabelPrimitive(ctx context.Context, param int32, reqEditors return c.Client.Do(req) } +// GetMatrixExplodeArray performs a GET /matrixExplodeArray/{.id*} (the `GetMatrixExplodeArray` operationId) request. + func (c *Client) GetMatrixExplodeArray(ctx context.Context, id []int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetMatrixExplodeArrayRequest(c.Server, id) if err != nil { @@ -441,6 +491,8 @@ func (c *Client) GetMatrixExplodeArray(ctx context.Context, id []int32, reqEdito return c.Client.Do(req) } +// GetMatrixExplodeObject performs a GET /matrixExplodeObject/{.id*} (the `GetMatrixExplodeObject` operationId) request. + func (c *Client) GetMatrixExplodeObject(ctx context.Context, id Object, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetMatrixExplodeObjectRequest(c.Server, id) if err != nil { @@ -453,6 +505,8 @@ func (c *Client) GetMatrixExplodeObject(ctx context.Context, id Object, reqEdito return c.Client.Do(req) } +// GetMatrixExplodePrimitive performs a GET /matrixExplodePrimitive/{;id*} (the `GetMatrixExplodePrimitive` operationId) request. + func (c *Client) GetMatrixExplodePrimitive(ctx context.Context, id int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetMatrixExplodePrimitiveRequest(c.Server, id) if err != nil { @@ -465,6 +519,8 @@ func (c *Client) GetMatrixExplodePrimitive(ctx context.Context, id int32, reqEdi return c.Client.Do(req) } +// GetMatrixNoExplodeArray performs a GET /matrixNoExplodeArray/{.id} (the `GetMatrixNoExplodeArray` operationId) request. + func (c *Client) GetMatrixNoExplodeArray(ctx context.Context, id []int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetMatrixNoExplodeArrayRequest(c.Server, id) if err != nil { @@ -477,6 +533,8 @@ func (c *Client) GetMatrixNoExplodeArray(ctx context.Context, id []int32, reqEdi return c.Client.Do(req) } +// GetMatrixNoExplodeObject performs a GET /matrixNoExplodeObject/{.id} (the `GetMatrixNoExplodeObject` operationId) request. + func (c *Client) GetMatrixNoExplodeObject(ctx context.Context, id Object, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetMatrixNoExplodeObjectRequest(c.Server, id) if err != nil { @@ -489,6 +547,8 @@ func (c *Client) GetMatrixNoExplodeObject(ctx context.Context, id Object, reqEdi return c.Client.Do(req) } +// GetMatrixPrimitive performs a GET /matrixPrimitive/{;id} (the `GetMatrixPrimitive` operationId) request. + func (c *Client) GetMatrixPrimitive(ctx context.Context, id int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetMatrixPrimitiveRequest(c.Server, id) if err != nil { @@ -501,6 +561,8 @@ func (c *Client) GetMatrixPrimitive(ctx context.Context, id int32, reqEditors .. return c.Client.Do(req) } +// GetPassThrough performs a GET /passThrough/{param} (the `GetPassThrough` operationId) request. + func (c *Client) GetPassThrough(ctx context.Context, param string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetPassThroughRequest(c.Server, param) if err != nil { @@ -513,6 +575,8 @@ func (c *Client) GetPassThrough(ctx context.Context, param string, reqEditors .. return c.Client.Do(req) } +// GetDeepObject performs a GET /queryDeepObject (the `GetDeepObject` operationId) request. + func (c *Client) GetDeepObject(ctx context.Context, params *GetDeepObjectParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetDeepObjectRequest(c.Server, params) if err != nil { @@ -525,6 +589,8 @@ func (c *Client) GetDeepObject(ctx context.Context, params *GetDeepObjectParams, return c.Client.Do(req) } +// GetQueryDelimited performs a GET /queryDelimited (the `GetQueryDelimited` operationId) request. + func (c *Client) GetQueryDelimited(ctx context.Context, params *GetQueryDelimitedParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetQueryDelimitedRequest(c.Server, params) if err != nil { @@ -537,6 +603,8 @@ func (c *Client) GetQueryDelimited(ctx context.Context, params *GetQueryDelimite return c.Client.Do(req) } +// GetQueryForm performs a GET /queryForm (the `GetQueryForm` operationId) request. + func (c *Client) GetQueryForm(ctx context.Context, params *GetQueryFormParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetQueryFormRequest(c.Server, params) if err != nil { @@ -549,6 +617,8 @@ func (c *Client) GetQueryForm(ctx context.Context, params *GetQueryFormParams, r return c.Client.Do(req) } +// GetSimpleExplodeArray performs a GET /simpleExplodeArray/{param*} (the `GetSimpleExplodeArray` operationId) request. + func (c *Client) GetSimpleExplodeArray(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSimpleExplodeArrayRequest(c.Server, param) if err != nil { @@ -561,6 +631,8 @@ func (c *Client) GetSimpleExplodeArray(ctx context.Context, param []int32, reqEd return c.Client.Do(req) } +// GetSimpleExplodeObject performs a GET /simpleExplodeObject/{param*} (the `GetSimpleExplodeObject` operationId) request. + func (c *Client) GetSimpleExplodeObject(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSimpleExplodeObjectRequest(c.Server, param) if err != nil { @@ -573,6 +645,8 @@ func (c *Client) GetSimpleExplodeObject(ctx context.Context, param Object, reqEd return c.Client.Do(req) } +// GetSimpleExplodePrimitive performs a GET /simpleExplodePrimitive/{param} (the `GetSimpleExplodePrimitive` operationId) request. + func (c *Client) GetSimpleExplodePrimitive(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSimpleExplodePrimitiveRequest(c.Server, param) if err != nil { @@ -585,6 +659,8 @@ func (c *Client) GetSimpleExplodePrimitive(ctx context.Context, param int32, req return c.Client.Do(req) } +// GetSimpleNoExplodeArray performs a GET /simpleNoExplodeArray/{param} (the `GetSimpleNoExplodeArray` operationId) request. + func (c *Client) GetSimpleNoExplodeArray(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSimpleNoExplodeArrayRequest(c.Server, param) if err != nil { @@ -597,6 +673,8 @@ func (c *Client) GetSimpleNoExplodeArray(ctx context.Context, param []int32, req return c.Client.Do(req) } +// GetSimpleNoExplodeObject performs a GET /simpleNoExplodeObject/{param} (the `GetSimpleNoExplodeObject` operationId) request. + func (c *Client) GetSimpleNoExplodeObject(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSimpleNoExplodeObjectRequest(c.Server, param) if err != nil { @@ -609,6 +687,8 @@ func (c *Client) GetSimpleNoExplodeObject(ctx context.Context, param Object, req return c.Client.Do(req) } +// GetSimplePrimitive performs a GET /simplePrimitive/{param} (the `GetSimplePrimitive` operationId) request. + func (c *Client) GetSimplePrimitive(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetSimplePrimitiveRequest(c.Server, param) if err != nil { @@ -621,6 +701,8 @@ func (c *Client) GetSimplePrimitive(ctx context.Context, param int32, reqEditors return c.Client.Do(req) } +// GetStartingWithNumber performs a GET /startingWithNumber/{1param} (the `GetStartingWithNumber` operationId) request. + func (c *Client) GetStartingWithNumber(ctx context.Context, n1param string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetStartingWithNumberRequest(c.Server, n1param) if err != nil { @@ -633,7 +715,7 @@ func (c *Client) GetStartingWithNumber(ctx context.Context, n1param string, reqE return c.Client.Do(req) } -// NewGetContentObjectRequest generates requests for GetContentObject +// NewGetContentObjectRequest constructs an http.Request for the GetContentObject method func NewGetContentObjectRequest(server string, param ComplexObject) (*http.Request, error) { var err error @@ -669,7 +751,7 @@ func NewGetContentObjectRequest(server string, param ComplexObject) (*http.Reque return req, nil } -// NewGetCookieRequest generates requests for GetCookie +// NewGetCookieRequest constructs an http.Request for the GetCookie method func NewGetCookieRequest(server string, params *GetCookieParams) (*http.Request, error) { var err error @@ -820,7 +902,7 @@ func NewGetCookieRequest(server string, params *GetCookieParams) (*http.Request, return req, nil } -// NewEnumParamsRequest generates requests for EnumParams +// NewEnumParamsRequest constructs an http.Request for the EnumParams method func NewEnumParamsRequest(server string, params *EnumParamsParams) (*http.Request, error) { var err error @@ -874,7 +956,7 @@ func NewEnumParamsRequest(server string, params *EnumParamsParams) (*http.Reques return req, nil } -// NewGetHeaderRequest generates requests for GetHeader +// NewGetHeaderRequest constructs an http.Request for the GetHeader method func NewGetHeaderRequest(server string, params *GetHeaderParams) (*http.Request, error) { var err error @@ -995,7 +1077,7 @@ func NewGetHeaderRequest(server string, params *GetHeaderParams) (*http.Request, return req, nil } -// NewGetLabelExplodeArrayRequest generates requests for GetLabelExplodeArray +// NewGetLabelExplodeArrayRequest constructs an http.Request for the GetLabelExplodeArray method func NewGetLabelExplodeArrayRequest(server string, param []int32) (*http.Request, error) { var err error @@ -1029,7 +1111,7 @@ func NewGetLabelExplodeArrayRequest(server string, param []int32) (*http.Request return req, nil } -// NewGetLabelExplodeObjectRequest generates requests for GetLabelExplodeObject +// NewGetLabelExplodeObjectRequest constructs an http.Request for the GetLabelExplodeObject method func NewGetLabelExplodeObjectRequest(server string, param Object) (*http.Request, error) { var err error @@ -1063,7 +1145,7 @@ func NewGetLabelExplodeObjectRequest(server string, param Object) (*http.Request return req, nil } -// NewGetLabelExplodePrimitiveRequest generates requests for GetLabelExplodePrimitive +// NewGetLabelExplodePrimitiveRequest constructs an http.Request for the GetLabelExplodePrimitive method func NewGetLabelExplodePrimitiveRequest(server string, param int32) (*http.Request, error) { var err error @@ -1097,7 +1179,7 @@ func NewGetLabelExplodePrimitiveRequest(server string, param int32) (*http.Reque return req, nil } -// NewGetLabelNoExplodeArrayRequest generates requests for GetLabelNoExplodeArray +// NewGetLabelNoExplodeArrayRequest constructs an http.Request for the GetLabelNoExplodeArray method func NewGetLabelNoExplodeArrayRequest(server string, param []int32) (*http.Request, error) { var err error @@ -1131,7 +1213,7 @@ func NewGetLabelNoExplodeArrayRequest(server string, param []int32) (*http.Reque return req, nil } -// NewGetLabelNoExplodeObjectRequest generates requests for GetLabelNoExplodeObject +// NewGetLabelNoExplodeObjectRequest constructs an http.Request for the GetLabelNoExplodeObject method func NewGetLabelNoExplodeObjectRequest(server string, param Object) (*http.Request, error) { var err error @@ -1165,7 +1247,7 @@ func NewGetLabelNoExplodeObjectRequest(server string, param Object) (*http.Reque return req, nil } -// NewGetLabelPrimitiveRequest generates requests for GetLabelPrimitive +// NewGetLabelPrimitiveRequest constructs an http.Request for the GetLabelPrimitive method func NewGetLabelPrimitiveRequest(server string, param int32) (*http.Request, error) { var err error @@ -1199,7 +1281,7 @@ func NewGetLabelPrimitiveRequest(server string, param int32) (*http.Request, err return req, nil } -// NewGetMatrixExplodeArrayRequest generates requests for GetMatrixExplodeArray +// NewGetMatrixExplodeArrayRequest constructs an http.Request for the GetMatrixExplodeArray method func NewGetMatrixExplodeArrayRequest(server string, id []int32) (*http.Request, error) { var err error @@ -1233,7 +1315,7 @@ func NewGetMatrixExplodeArrayRequest(server string, id []int32) (*http.Request, return req, nil } -// NewGetMatrixExplodeObjectRequest generates requests for GetMatrixExplodeObject +// NewGetMatrixExplodeObjectRequest constructs an http.Request for the GetMatrixExplodeObject method func NewGetMatrixExplodeObjectRequest(server string, id Object) (*http.Request, error) { var err error @@ -1267,7 +1349,7 @@ func NewGetMatrixExplodeObjectRequest(server string, id Object) (*http.Request, return req, nil } -// NewGetMatrixExplodePrimitiveRequest generates requests for GetMatrixExplodePrimitive +// NewGetMatrixExplodePrimitiveRequest constructs an http.Request for the GetMatrixExplodePrimitive method func NewGetMatrixExplodePrimitiveRequest(server string, id int32) (*http.Request, error) { var err error @@ -1301,7 +1383,7 @@ func NewGetMatrixExplodePrimitiveRequest(server string, id int32) (*http.Request return req, nil } -// NewGetMatrixNoExplodeArrayRequest generates requests for GetMatrixNoExplodeArray +// NewGetMatrixNoExplodeArrayRequest constructs an http.Request for the GetMatrixNoExplodeArray method func NewGetMatrixNoExplodeArrayRequest(server string, id []int32) (*http.Request, error) { var err error @@ -1335,7 +1417,7 @@ func NewGetMatrixNoExplodeArrayRequest(server string, id []int32) (*http.Request return req, nil } -// NewGetMatrixNoExplodeObjectRequest generates requests for GetMatrixNoExplodeObject +// NewGetMatrixNoExplodeObjectRequest constructs an http.Request for the GetMatrixNoExplodeObject method func NewGetMatrixNoExplodeObjectRequest(server string, id Object) (*http.Request, error) { var err error @@ -1369,7 +1451,7 @@ func NewGetMatrixNoExplodeObjectRequest(server string, id Object) (*http.Request return req, nil } -// NewGetMatrixPrimitiveRequest generates requests for GetMatrixPrimitive +// NewGetMatrixPrimitiveRequest constructs an http.Request for the GetMatrixPrimitive method func NewGetMatrixPrimitiveRequest(server string, id int32) (*http.Request, error) { var err error @@ -1403,7 +1485,7 @@ func NewGetMatrixPrimitiveRequest(server string, id int32) (*http.Request, error return req, nil } -// NewGetPassThroughRequest generates requests for GetPassThrough +// NewGetPassThroughRequest constructs an http.Request for the GetPassThrough method func NewGetPassThroughRequest(server string, param string) (*http.Request, error) { var err error @@ -1434,7 +1516,7 @@ func NewGetPassThroughRequest(server string, param string) (*http.Request, error return req, nil } -// NewGetDeepObjectRequest generates requests for GetDeepObject +// NewGetDeepObjectRequest constructs an http.Request for the GetDeepObject method func NewGetDeepObjectRequest(server string, params *GetDeepObjectParams) (*http.Request, error) { var err error @@ -1484,7 +1566,7 @@ func NewGetDeepObjectRequest(server string, params *GetDeepObjectParams) (*http. return req, nil } -// NewGetQueryDelimitedRequest generates requests for GetQueryDelimited +// NewGetQueryDelimitedRequest constructs an http.Request for the GetQueryDelimited method func NewGetQueryDelimitedRequest(server string, params *GetQueryDelimitedParams) (*http.Request, error) { var err error @@ -1550,7 +1632,7 @@ func NewGetQueryDelimitedRequest(server string, params *GetQueryDelimitedParams) return req, nil } -// NewGetQueryFormRequest generates requests for GetQueryForm +// NewGetQueryFormRequest constructs an http.Request for the GetQueryForm method func NewGetQueryFormRequest(server string, params *GetQueryFormParams) (*http.Request, error) { var err error @@ -1698,7 +1780,7 @@ func NewGetQueryFormRequest(server string, params *GetQueryFormParams) (*http.Re return req, nil } -// NewGetSimpleExplodeArrayRequest generates requests for GetSimpleExplodeArray +// NewGetSimpleExplodeArrayRequest constructs an http.Request for the GetSimpleExplodeArray method func NewGetSimpleExplodeArrayRequest(server string, param []int32) (*http.Request, error) { var err error @@ -1732,7 +1814,7 @@ func NewGetSimpleExplodeArrayRequest(server string, param []int32) (*http.Reques return req, nil } -// NewGetSimpleExplodeObjectRequest generates requests for GetSimpleExplodeObject +// NewGetSimpleExplodeObjectRequest constructs an http.Request for the GetSimpleExplodeObject method func NewGetSimpleExplodeObjectRequest(server string, param Object) (*http.Request, error) { var err error @@ -1766,7 +1848,7 @@ func NewGetSimpleExplodeObjectRequest(server string, param Object) (*http.Reques return req, nil } -// NewGetSimpleExplodePrimitiveRequest generates requests for GetSimpleExplodePrimitive +// NewGetSimpleExplodePrimitiveRequest constructs an http.Request for the GetSimpleExplodePrimitive method func NewGetSimpleExplodePrimitiveRequest(server string, param int32) (*http.Request, error) { var err error @@ -1800,7 +1882,7 @@ func NewGetSimpleExplodePrimitiveRequest(server string, param int32) (*http.Requ return req, nil } -// NewGetSimpleNoExplodeArrayRequest generates requests for GetSimpleNoExplodeArray +// NewGetSimpleNoExplodeArrayRequest constructs an http.Request for the GetSimpleNoExplodeArray method func NewGetSimpleNoExplodeArrayRequest(server string, param []int32) (*http.Request, error) { var err error @@ -1834,7 +1916,7 @@ func NewGetSimpleNoExplodeArrayRequest(server string, param []int32) (*http.Requ return req, nil } -// NewGetSimpleNoExplodeObjectRequest generates requests for GetSimpleNoExplodeObject +// NewGetSimpleNoExplodeObjectRequest constructs an http.Request for the GetSimpleNoExplodeObject method func NewGetSimpleNoExplodeObjectRequest(server string, param Object) (*http.Request, error) { var err error @@ -1868,7 +1950,7 @@ func NewGetSimpleNoExplodeObjectRequest(server string, param Object) (*http.Requ return req, nil } -// NewGetSimplePrimitiveRequest generates requests for GetSimplePrimitive +// NewGetSimplePrimitiveRequest constructs an http.Request for the GetSimplePrimitive method func NewGetSimplePrimitiveRequest(server string, param int32) (*http.Request, error) { var err error @@ -1902,7 +1984,7 @@ func NewGetSimplePrimitiveRequest(server string, param int32) (*http.Request, er return req, nil } -// NewGetStartingWithNumberRequest generates requests for GetStartingWithNumber +// NewGetStartingWithNumberRequest constructs an http.Request for the GetStartingWithNumber method func NewGetStartingWithNumberRequest(server string, n1param string) (*http.Request, error) { var err error @@ -1976,85 +2058,167 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetContentObjectWithResponse request + + // GetContentObjectWithResponse performs a GET /contentObject/{param} (the `GetContentObject` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetContentObjectWithResponse(ctx context.Context, param ComplexObject, reqEditors ...RequestEditorFn) (*GetContentObjectResponse, error) - // GetCookieWithResponse request + // GetCookieWithResponse performs a GET /cookie (the `GetCookie` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetCookieWithResponse(ctx context.Context, params *GetCookieParams, reqEditors ...RequestEditorFn) (*GetCookieResponse, error) - // EnumParamsWithResponse request + // EnumParamsWithResponse performs a GET /enums (the `EnumParams` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + EnumParamsWithResponse(ctx context.Context, params *EnumParamsParams, reqEditors ...RequestEditorFn) (*EnumParamsResponse, error) - // GetHeaderWithResponse request + // GetHeaderWithResponse performs a GET /header (the `GetHeader` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetHeaderWithResponse(ctx context.Context, params *GetHeaderParams, reqEditors ...RequestEditorFn) (*GetHeaderResponse, error) - // GetLabelExplodeArrayWithResponse request + // GetLabelExplodeArrayWithResponse performs a GET /labelExplodeArray/{.param*} (the `GetLabelExplodeArray` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetLabelExplodeArrayWithResponse(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*GetLabelExplodeArrayResponse, error) - // GetLabelExplodeObjectWithResponse request + // GetLabelExplodeObjectWithResponse performs a GET /labelExplodeObject/{.param*} (the `GetLabelExplodeObject` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetLabelExplodeObjectWithResponse(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*GetLabelExplodeObjectResponse, error) - // GetLabelExplodePrimitiveWithResponse request + // GetLabelExplodePrimitiveWithResponse performs a GET /labelExplodePrimitive/{.param*} (the `GetLabelExplodePrimitive` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetLabelExplodePrimitiveWithResponse(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*GetLabelExplodePrimitiveResponse, error) - // GetLabelNoExplodeArrayWithResponse request + // GetLabelNoExplodeArrayWithResponse performs a GET /labelNoExplodeArray/{.param} (the `GetLabelNoExplodeArray` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetLabelNoExplodeArrayWithResponse(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*GetLabelNoExplodeArrayResponse, error) - // GetLabelNoExplodeObjectWithResponse request + // GetLabelNoExplodeObjectWithResponse performs a GET /labelNoExplodeObject/{.param} (the `GetLabelNoExplodeObject` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetLabelNoExplodeObjectWithResponse(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*GetLabelNoExplodeObjectResponse, error) - // GetLabelPrimitiveWithResponse request + // GetLabelPrimitiveWithResponse performs a GET /labelPrimitive/{.param} (the `GetLabelPrimitive` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetLabelPrimitiveWithResponse(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*GetLabelPrimitiveResponse, error) - // GetMatrixExplodeArrayWithResponse request + // GetMatrixExplodeArrayWithResponse performs a GET /matrixExplodeArray/{.id*} (the `GetMatrixExplodeArray` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetMatrixExplodeArrayWithResponse(ctx context.Context, id []int32, reqEditors ...RequestEditorFn) (*GetMatrixExplodeArrayResponse, error) - // GetMatrixExplodeObjectWithResponse request + // GetMatrixExplodeObjectWithResponse performs a GET /matrixExplodeObject/{.id*} (the `GetMatrixExplodeObject` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetMatrixExplodeObjectWithResponse(ctx context.Context, id Object, reqEditors ...RequestEditorFn) (*GetMatrixExplodeObjectResponse, error) - // GetMatrixExplodePrimitiveWithResponse request + // GetMatrixExplodePrimitiveWithResponse performs a GET /matrixExplodePrimitive/{;id*} (the `GetMatrixExplodePrimitive` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetMatrixExplodePrimitiveWithResponse(ctx context.Context, id int32, reqEditors ...RequestEditorFn) (*GetMatrixExplodePrimitiveResponse, error) - // GetMatrixNoExplodeArrayWithResponse request + // GetMatrixNoExplodeArrayWithResponse performs a GET /matrixNoExplodeArray/{.id} (the `GetMatrixNoExplodeArray` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetMatrixNoExplodeArrayWithResponse(ctx context.Context, id []int32, reqEditors ...RequestEditorFn) (*GetMatrixNoExplodeArrayResponse, error) - // GetMatrixNoExplodeObjectWithResponse request + // GetMatrixNoExplodeObjectWithResponse performs a GET /matrixNoExplodeObject/{.id} (the `GetMatrixNoExplodeObject` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetMatrixNoExplodeObjectWithResponse(ctx context.Context, id Object, reqEditors ...RequestEditorFn) (*GetMatrixNoExplodeObjectResponse, error) - // GetMatrixPrimitiveWithResponse request + // GetMatrixPrimitiveWithResponse performs a GET /matrixPrimitive/{;id} (the `GetMatrixPrimitive` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetMatrixPrimitiveWithResponse(ctx context.Context, id int32, reqEditors ...RequestEditorFn) (*GetMatrixPrimitiveResponse, error) - // GetPassThroughWithResponse request + // GetPassThroughWithResponse performs a GET /passThrough/{param} (the `GetPassThrough` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetPassThroughWithResponse(ctx context.Context, param string, reqEditors ...RequestEditorFn) (*GetPassThroughResponse, error) - // GetDeepObjectWithResponse request + // GetDeepObjectWithResponse performs a GET /queryDeepObject (the `GetDeepObject` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetDeepObjectWithResponse(ctx context.Context, params *GetDeepObjectParams, reqEditors ...RequestEditorFn) (*GetDeepObjectResponse, error) - // GetQueryDelimitedWithResponse request + // GetQueryDelimitedWithResponse performs a GET /queryDelimited (the `GetQueryDelimited` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetQueryDelimitedWithResponse(ctx context.Context, params *GetQueryDelimitedParams, reqEditors ...RequestEditorFn) (*GetQueryDelimitedResponse, error) - // GetQueryFormWithResponse request + // GetQueryFormWithResponse performs a GET /queryForm (the `GetQueryForm` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetQueryFormWithResponse(ctx context.Context, params *GetQueryFormParams, reqEditors ...RequestEditorFn) (*GetQueryFormResponse, error) - // GetSimpleExplodeArrayWithResponse request + // GetSimpleExplodeArrayWithResponse performs a GET /simpleExplodeArray/{param*} (the `GetSimpleExplodeArray` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetSimpleExplodeArrayWithResponse(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*GetSimpleExplodeArrayResponse, error) - // GetSimpleExplodeObjectWithResponse request + // GetSimpleExplodeObjectWithResponse performs a GET /simpleExplodeObject/{param*} (the `GetSimpleExplodeObject` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetSimpleExplodeObjectWithResponse(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*GetSimpleExplodeObjectResponse, error) - // GetSimpleExplodePrimitiveWithResponse request + // GetSimpleExplodePrimitiveWithResponse performs a GET /simpleExplodePrimitive/{param} (the `GetSimpleExplodePrimitive` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetSimpleExplodePrimitiveWithResponse(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*GetSimpleExplodePrimitiveResponse, error) - // GetSimpleNoExplodeArrayWithResponse request + // GetSimpleNoExplodeArrayWithResponse performs a GET /simpleNoExplodeArray/{param} (the `GetSimpleNoExplodeArray` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetSimpleNoExplodeArrayWithResponse(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*GetSimpleNoExplodeArrayResponse, error) - // GetSimpleNoExplodeObjectWithResponse request + // GetSimpleNoExplodeObjectWithResponse performs a GET /simpleNoExplodeObject/{param} (the `GetSimpleNoExplodeObject` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetSimpleNoExplodeObjectWithResponse(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*GetSimpleNoExplodeObjectResponse, error) - // GetSimplePrimitiveWithResponse request + // GetSimplePrimitiveWithResponse performs a GET /simplePrimitive/{param} (the `GetSimplePrimitive` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetSimplePrimitiveWithResponse(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*GetSimplePrimitiveResponse, error) - // GetStartingWithNumberWithResponse request + // GetStartingWithNumberWithResponse performs a GET /startingWithNumber/{1param} (the `GetStartingWithNumber` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetStartingWithNumberWithResponse(ctx context.Context, n1param string, reqEditors ...RequestEditorFn) (*GetStartingWithNumberResponse, error) } @@ -2976,7 +3140,10 @@ func (r GetStartingWithNumberResponse) ContentType() string { return "" } -// GetContentObjectWithResponse request returning *GetContentObjectResponse +// GetContentObjectWithResponse performs a GET /contentObject/{param} (the `GetContentObject` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetContentObjectWithResponse(ctx context.Context, param ComplexObject, reqEditors ...RequestEditorFn) (*GetContentObjectResponse, error) { rsp, err := c.GetContentObject(ctx, param, reqEditors...) if err != nil { @@ -2985,7 +3152,10 @@ func (c *ClientWithResponses) GetContentObjectWithResponse(ctx context.Context, return ParseGetContentObjectResponse(rsp) } -// GetCookieWithResponse request returning *GetCookieResponse +// GetCookieWithResponse performs a GET /cookie (the `GetCookie` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetCookieWithResponse(ctx context.Context, params *GetCookieParams, reqEditors ...RequestEditorFn) (*GetCookieResponse, error) { rsp, err := c.GetCookie(ctx, params, reqEditors...) if err != nil { @@ -2994,7 +3164,10 @@ func (c *ClientWithResponses) GetCookieWithResponse(ctx context.Context, params return ParseGetCookieResponse(rsp) } -// EnumParamsWithResponse request returning *EnumParamsResponse +// EnumParamsWithResponse performs a GET /enums (the `EnumParams` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) EnumParamsWithResponse(ctx context.Context, params *EnumParamsParams, reqEditors ...RequestEditorFn) (*EnumParamsResponse, error) { rsp, err := c.EnumParams(ctx, params, reqEditors...) if err != nil { @@ -3003,7 +3176,10 @@ func (c *ClientWithResponses) EnumParamsWithResponse(ctx context.Context, params return ParseEnumParamsResponse(rsp) } -// GetHeaderWithResponse request returning *GetHeaderResponse +// GetHeaderWithResponse performs a GET /header (the `GetHeader` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetHeaderWithResponse(ctx context.Context, params *GetHeaderParams, reqEditors ...RequestEditorFn) (*GetHeaderResponse, error) { rsp, err := c.GetHeader(ctx, params, reqEditors...) if err != nil { @@ -3012,7 +3188,10 @@ func (c *ClientWithResponses) GetHeaderWithResponse(ctx context.Context, params return ParseGetHeaderResponse(rsp) } -// GetLabelExplodeArrayWithResponse request returning *GetLabelExplodeArrayResponse +// GetLabelExplodeArrayWithResponse performs a GET /labelExplodeArray/{.param*} (the `GetLabelExplodeArray` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetLabelExplodeArrayWithResponse(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*GetLabelExplodeArrayResponse, error) { rsp, err := c.GetLabelExplodeArray(ctx, param, reqEditors...) if err != nil { @@ -3021,7 +3200,10 @@ func (c *ClientWithResponses) GetLabelExplodeArrayWithResponse(ctx context.Conte return ParseGetLabelExplodeArrayResponse(rsp) } -// GetLabelExplodeObjectWithResponse request returning *GetLabelExplodeObjectResponse +// GetLabelExplodeObjectWithResponse performs a GET /labelExplodeObject/{.param*} (the `GetLabelExplodeObject` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetLabelExplodeObjectWithResponse(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*GetLabelExplodeObjectResponse, error) { rsp, err := c.GetLabelExplodeObject(ctx, param, reqEditors...) if err != nil { @@ -3030,7 +3212,10 @@ func (c *ClientWithResponses) GetLabelExplodeObjectWithResponse(ctx context.Cont return ParseGetLabelExplodeObjectResponse(rsp) } -// GetLabelExplodePrimitiveWithResponse request returning *GetLabelExplodePrimitiveResponse +// GetLabelExplodePrimitiveWithResponse performs a GET /labelExplodePrimitive/{.param*} (the `GetLabelExplodePrimitive` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetLabelExplodePrimitiveWithResponse(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*GetLabelExplodePrimitiveResponse, error) { rsp, err := c.GetLabelExplodePrimitive(ctx, param, reqEditors...) if err != nil { @@ -3039,7 +3224,10 @@ func (c *ClientWithResponses) GetLabelExplodePrimitiveWithResponse(ctx context.C return ParseGetLabelExplodePrimitiveResponse(rsp) } -// GetLabelNoExplodeArrayWithResponse request returning *GetLabelNoExplodeArrayResponse +// GetLabelNoExplodeArrayWithResponse performs a GET /labelNoExplodeArray/{.param} (the `GetLabelNoExplodeArray` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetLabelNoExplodeArrayWithResponse(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*GetLabelNoExplodeArrayResponse, error) { rsp, err := c.GetLabelNoExplodeArray(ctx, param, reqEditors...) if err != nil { @@ -3048,7 +3236,10 @@ func (c *ClientWithResponses) GetLabelNoExplodeArrayWithResponse(ctx context.Con return ParseGetLabelNoExplodeArrayResponse(rsp) } -// GetLabelNoExplodeObjectWithResponse request returning *GetLabelNoExplodeObjectResponse +// GetLabelNoExplodeObjectWithResponse performs a GET /labelNoExplodeObject/{.param} (the `GetLabelNoExplodeObject` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetLabelNoExplodeObjectWithResponse(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*GetLabelNoExplodeObjectResponse, error) { rsp, err := c.GetLabelNoExplodeObject(ctx, param, reqEditors...) if err != nil { @@ -3057,7 +3248,10 @@ func (c *ClientWithResponses) GetLabelNoExplodeObjectWithResponse(ctx context.Co return ParseGetLabelNoExplodeObjectResponse(rsp) } -// GetLabelPrimitiveWithResponse request returning *GetLabelPrimitiveResponse +// GetLabelPrimitiveWithResponse performs a GET /labelPrimitive/{.param} (the `GetLabelPrimitive` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetLabelPrimitiveWithResponse(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*GetLabelPrimitiveResponse, error) { rsp, err := c.GetLabelPrimitive(ctx, param, reqEditors...) if err != nil { @@ -3066,7 +3260,10 @@ func (c *ClientWithResponses) GetLabelPrimitiveWithResponse(ctx context.Context, return ParseGetLabelPrimitiveResponse(rsp) } -// GetMatrixExplodeArrayWithResponse request returning *GetMatrixExplodeArrayResponse +// GetMatrixExplodeArrayWithResponse performs a GET /matrixExplodeArray/{.id*} (the `GetMatrixExplodeArray` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetMatrixExplodeArrayWithResponse(ctx context.Context, id []int32, reqEditors ...RequestEditorFn) (*GetMatrixExplodeArrayResponse, error) { rsp, err := c.GetMatrixExplodeArray(ctx, id, reqEditors...) if err != nil { @@ -3075,7 +3272,10 @@ func (c *ClientWithResponses) GetMatrixExplodeArrayWithResponse(ctx context.Cont return ParseGetMatrixExplodeArrayResponse(rsp) } -// GetMatrixExplodeObjectWithResponse request returning *GetMatrixExplodeObjectResponse +// GetMatrixExplodeObjectWithResponse performs a GET /matrixExplodeObject/{.id*} (the `GetMatrixExplodeObject` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetMatrixExplodeObjectWithResponse(ctx context.Context, id Object, reqEditors ...RequestEditorFn) (*GetMatrixExplodeObjectResponse, error) { rsp, err := c.GetMatrixExplodeObject(ctx, id, reqEditors...) if err != nil { @@ -3084,7 +3284,10 @@ func (c *ClientWithResponses) GetMatrixExplodeObjectWithResponse(ctx context.Con return ParseGetMatrixExplodeObjectResponse(rsp) } -// GetMatrixExplodePrimitiveWithResponse request returning *GetMatrixExplodePrimitiveResponse +// GetMatrixExplodePrimitiveWithResponse performs a GET /matrixExplodePrimitive/{;id*} (the `GetMatrixExplodePrimitive` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetMatrixExplodePrimitiveWithResponse(ctx context.Context, id int32, reqEditors ...RequestEditorFn) (*GetMatrixExplodePrimitiveResponse, error) { rsp, err := c.GetMatrixExplodePrimitive(ctx, id, reqEditors...) if err != nil { @@ -3093,7 +3296,10 @@ func (c *ClientWithResponses) GetMatrixExplodePrimitiveWithResponse(ctx context. return ParseGetMatrixExplodePrimitiveResponse(rsp) } -// GetMatrixNoExplodeArrayWithResponse request returning *GetMatrixNoExplodeArrayResponse +// GetMatrixNoExplodeArrayWithResponse performs a GET /matrixNoExplodeArray/{.id} (the `GetMatrixNoExplodeArray` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetMatrixNoExplodeArrayWithResponse(ctx context.Context, id []int32, reqEditors ...RequestEditorFn) (*GetMatrixNoExplodeArrayResponse, error) { rsp, err := c.GetMatrixNoExplodeArray(ctx, id, reqEditors...) if err != nil { @@ -3102,7 +3308,10 @@ func (c *ClientWithResponses) GetMatrixNoExplodeArrayWithResponse(ctx context.Co return ParseGetMatrixNoExplodeArrayResponse(rsp) } -// GetMatrixNoExplodeObjectWithResponse request returning *GetMatrixNoExplodeObjectResponse +// GetMatrixNoExplodeObjectWithResponse performs a GET /matrixNoExplodeObject/{.id} (the `GetMatrixNoExplodeObject` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetMatrixNoExplodeObjectWithResponse(ctx context.Context, id Object, reqEditors ...RequestEditorFn) (*GetMatrixNoExplodeObjectResponse, error) { rsp, err := c.GetMatrixNoExplodeObject(ctx, id, reqEditors...) if err != nil { @@ -3111,7 +3320,10 @@ func (c *ClientWithResponses) GetMatrixNoExplodeObjectWithResponse(ctx context.C return ParseGetMatrixNoExplodeObjectResponse(rsp) } -// GetMatrixPrimitiveWithResponse request returning *GetMatrixPrimitiveResponse +// GetMatrixPrimitiveWithResponse performs a GET /matrixPrimitive/{;id} (the `GetMatrixPrimitive` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetMatrixPrimitiveWithResponse(ctx context.Context, id int32, reqEditors ...RequestEditorFn) (*GetMatrixPrimitiveResponse, error) { rsp, err := c.GetMatrixPrimitive(ctx, id, reqEditors...) if err != nil { @@ -3120,7 +3332,10 @@ func (c *ClientWithResponses) GetMatrixPrimitiveWithResponse(ctx context.Context return ParseGetMatrixPrimitiveResponse(rsp) } -// GetPassThroughWithResponse request returning *GetPassThroughResponse +// GetPassThroughWithResponse performs a GET /passThrough/{param} (the `GetPassThrough` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetPassThroughWithResponse(ctx context.Context, param string, reqEditors ...RequestEditorFn) (*GetPassThroughResponse, error) { rsp, err := c.GetPassThrough(ctx, param, reqEditors...) if err != nil { @@ -3129,7 +3344,10 @@ func (c *ClientWithResponses) GetPassThroughWithResponse(ctx context.Context, pa return ParseGetPassThroughResponse(rsp) } -// GetDeepObjectWithResponse request returning *GetDeepObjectResponse +// GetDeepObjectWithResponse performs a GET /queryDeepObject (the `GetDeepObject` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetDeepObjectWithResponse(ctx context.Context, params *GetDeepObjectParams, reqEditors ...RequestEditorFn) (*GetDeepObjectResponse, error) { rsp, err := c.GetDeepObject(ctx, params, reqEditors...) if err != nil { @@ -3138,7 +3356,10 @@ func (c *ClientWithResponses) GetDeepObjectWithResponse(ctx context.Context, par return ParseGetDeepObjectResponse(rsp) } -// GetQueryDelimitedWithResponse request returning *GetQueryDelimitedResponse +// GetQueryDelimitedWithResponse performs a GET /queryDelimited (the `GetQueryDelimited` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetQueryDelimitedWithResponse(ctx context.Context, params *GetQueryDelimitedParams, reqEditors ...RequestEditorFn) (*GetQueryDelimitedResponse, error) { rsp, err := c.GetQueryDelimited(ctx, params, reqEditors...) if err != nil { @@ -3147,7 +3368,10 @@ func (c *ClientWithResponses) GetQueryDelimitedWithResponse(ctx context.Context, return ParseGetQueryDelimitedResponse(rsp) } -// GetQueryFormWithResponse request returning *GetQueryFormResponse +// GetQueryFormWithResponse performs a GET /queryForm (the `GetQueryForm` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetQueryFormWithResponse(ctx context.Context, params *GetQueryFormParams, reqEditors ...RequestEditorFn) (*GetQueryFormResponse, error) { rsp, err := c.GetQueryForm(ctx, params, reqEditors...) if err != nil { @@ -3156,7 +3380,10 @@ func (c *ClientWithResponses) GetQueryFormWithResponse(ctx context.Context, para return ParseGetQueryFormResponse(rsp) } -// GetSimpleExplodeArrayWithResponse request returning *GetSimpleExplodeArrayResponse +// GetSimpleExplodeArrayWithResponse performs a GET /simpleExplodeArray/{param*} (the `GetSimpleExplodeArray` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetSimpleExplodeArrayWithResponse(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*GetSimpleExplodeArrayResponse, error) { rsp, err := c.GetSimpleExplodeArray(ctx, param, reqEditors...) if err != nil { @@ -3165,7 +3392,10 @@ func (c *ClientWithResponses) GetSimpleExplodeArrayWithResponse(ctx context.Cont return ParseGetSimpleExplodeArrayResponse(rsp) } -// GetSimpleExplodeObjectWithResponse request returning *GetSimpleExplodeObjectResponse +// GetSimpleExplodeObjectWithResponse performs a GET /simpleExplodeObject/{param*} (the `GetSimpleExplodeObject` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetSimpleExplodeObjectWithResponse(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*GetSimpleExplodeObjectResponse, error) { rsp, err := c.GetSimpleExplodeObject(ctx, param, reqEditors...) if err != nil { @@ -3174,7 +3404,10 @@ func (c *ClientWithResponses) GetSimpleExplodeObjectWithResponse(ctx context.Con return ParseGetSimpleExplodeObjectResponse(rsp) } -// GetSimpleExplodePrimitiveWithResponse request returning *GetSimpleExplodePrimitiveResponse +// GetSimpleExplodePrimitiveWithResponse performs a GET /simpleExplodePrimitive/{param} (the `GetSimpleExplodePrimitive` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetSimpleExplodePrimitiveWithResponse(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*GetSimpleExplodePrimitiveResponse, error) { rsp, err := c.GetSimpleExplodePrimitive(ctx, param, reqEditors...) if err != nil { @@ -3183,7 +3416,10 @@ func (c *ClientWithResponses) GetSimpleExplodePrimitiveWithResponse(ctx context. return ParseGetSimpleExplodePrimitiveResponse(rsp) } -// GetSimpleNoExplodeArrayWithResponse request returning *GetSimpleNoExplodeArrayResponse +// GetSimpleNoExplodeArrayWithResponse performs a GET /simpleNoExplodeArray/{param} (the `GetSimpleNoExplodeArray` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetSimpleNoExplodeArrayWithResponse(ctx context.Context, param []int32, reqEditors ...RequestEditorFn) (*GetSimpleNoExplodeArrayResponse, error) { rsp, err := c.GetSimpleNoExplodeArray(ctx, param, reqEditors...) if err != nil { @@ -3192,7 +3428,10 @@ func (c *ClientWithResponses) GetSimpleNoExplodeArrayWithResponse(ctx context.Co return ParseGetSimpleNoExplodeArrayResponse(rsp) } -// GetSimpleNoExplodeObjectWithResponse request returning *GetSimpleNoExplodeObjectResponse +// GetSimpleNoExplodeObjectWithResponse performs a GET /simpleNoExplodeObject/{param} (the `GetSimpleNoExplodeObject` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetSimpleNoExplodeObjectWithResponse(ctx context.Context, param Object, reqEditors ...RequestEditorFn) (*GetSimpleNoExplodeObjectResponse, error) { rsp, err := c.GetSimpleNoExplodeObject(ctx, param, reqEditors...) if err != nil { @@ -3201,7 +3440,10 @@ func (c *ClientWithResponses) GetSimpleNoExplodeObjectWithResponse(ctx context.C return ParseGetSimpleNoExplodeObjectResponse(rsp) } -// GetSimplePrimitiveWithResponse request returning *GetSimplePrimitiveResponse +// GetSimplePrimitiveWithResponse performs a GET /simplePrimitive/{param} (the `GetSimplePrimitive` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetSimplePrimitiveWithResponse(ctx context.Context, param int32, reqEditors ...RequestEditorFn) (*GetSimplePrimitiveResponse, error) { rsp, err := c.GetSimplePrimitive(ctx, param, reqEditors...) if err != nil { @@ -3210,7 +3452,10 @@ func (c *ClientWithResponses) GetSimplePrimitiveWithResponse(ctx context.Context return ParseGetSimplePrimitiveResponse(rsp) } -// GetStartingWithNumberWithResponse request returning *GetStartingWithNumberResponse +// GetStartingWithNumberWithResponse performs a GET /startingWithNumber/{1param} (the `GetStartingWithNumber` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetStartingWithNumberWithResponse(ctx context.Context, n1param string, reqEditors ...RequestEditorFn) (*GetStartingWithNumberResponse, error) { rsp, err := c.GetStartingWithNumber(ctx, n1param, reqEditors...) if err != nil { diff --git a/internal/test/pathalias/client.gen.go b/internal/test/pathalias/client.gen.go index bf291c3cee..760de592d4 100644 --- a/internal/test/pathalias/client.gen.go +++ b/internal/test/pathalias/client.gen.go @@ -13,7 +13,7 @@ import ( "strings" ) -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -86,13 +86,24 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetTest request + + // GetTest test + // + // Corresponds with GET /test (the `GetTest` operationId). + GetTest(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetTestAlias0 request + // GetTestAlias0 test + // + // Corresponds with GET /test2 (the `GetTestAlias0` operationId). + GetTestAlias0(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// GetTest test +// +// Corresponds with GET /test (the `GetTest` operationId). + func (c *Client) GetTest(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetTestRequest(c.Server) if err != nil { @@ -105,6 +116,10 @@ func (c *Client) GetTest(ctx context.Context, reqEditors ...RequestEditorFn) (*h return c.Client.Do(req) } +// GetTestAlias0 test +// +// Corresponds with GET /test2 (the `GetTestAlias0` operationId). + func (c *Client) GetTestAlias0(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetTestAlias0Request(c.Server) if err != nil { @@ -117,7 +132,7 @@ func (c *Client) GetTestAlias0(ctx context.Context, reqEditors ...RequestEditorF return c.Client.Do(req) } -// NewGetTestRequest generates requests for GetTest +// NewGetTestRequest constructs an http.Request for the GetTest method func NewGetTestRequest(server string) (*http.Request, error) { var err error @@ -144,7 +159,7 @@ func NewGetTestRequest(server string) (*http.Request, error) { return req, nil } -// NewGetTestAlias0Request generates requests for GetTestAlias0 +// NewGetTestAlias0Request constructs an http.Request for the GetTestAlias0 method func NewGetTestAlias0Request(server string) (*http.Request, error) { var err error @@ -214,10 +229,21 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetTestWithResponse request + + // GetTestWithResponse test + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /test (the `GetTest` operationId). + GetTestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTestResponse, error) - // GetTestAlias0WithResponse request + // GetTestAlias0WithResponse test + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /test2 (the `GetTestAlias0` operationId). + GetTestAlias0WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTestAlias0Response, error) } @@ -227,7 +253,7 @@ type GetTestResponse struct { JSON200 *B } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetTestResponse) GetJSON200() *B { return r.JSON200 } @@ -267,7 +293,7 @@ type GetTestAlias0Response struct { JSON200 *B } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetTestAlias0Response) GetJSON200() *B { return r.JSON200 } @@ -301,7 +327,12 @@ func (r GetTestAlias0Response) ContentType() string { return "" } -// GetTestWithResponse request returning *GetTestResponse +// GetTestWithResponse test +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /test (the `GetTest` operationId). + func (c *ClientWithResponses) GetTestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTestResponse, error) { rsp, err := c.GetTest(ctx, reqEditors...) if err != nil { @@ -310,7 +341,12 @@ func (c *ClientWithResponses) GetTestWithResponse(ctx context.Context, reqEditor return ParseGetTestResponse(rsp) } -// GetTestAlias0WithResponse request returning *GetTestAlias0Response +// GetTestAlias0WithResponse test +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /test2 (the `GetTestAlias0` operationId). + func (c *ClientWithResponses) GetTestAlias0WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTestAlias0Response, error) { rsp, err := c.GetTestAlias0(ctx, reqEditors...) if err != nil { diff --git a/internal/test/pathalias/server.gen.go b/internal/test/pathalias/server.gen.go index 2883b80b82..d5c6d2af4c 100644 --- a/internal/test/pathalias/server.gen.go +++ b/internal/test/pathalias/server.gen.go @@ -17,7 +17,7 @@ type B struct { // ServerInterface represents all server handlers. type ServerInterface interface { - // test + // GetTest test // (GET /test) GetTest(w http.ResponseWriter, r *http.Request) } @@ -26,7 +26,7 @@ type ServerInterface interface { type Unimplemented struct{} -// test +// GetTest test // (GET /test) func (_ Unimplemented) GetTest(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) diff --git a/internal/test/schemas/schemas.gen.go b/internal/test/schemas/schemas.gen.go index 05562de26b..74d4f443f5 100644 --- a/internal/test/schemas/schemas.gen.go +++ b/internal/test/schemas/schemas.gen.go @@ -128,7 +128,7 @@ type Issue185JSONRequestBody = NullableProperties // Issue9JSONRequestBody defines body for Issue9 for application/json ContentType. type Issue9JSONRequestBody = Issue9JSONBody -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -201,41 +201,60 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // EnsureEverythingIsReferenced request + + // EnsureEverythingIsReferenced performs a GET /ensure-everything-is-referenced (the `EnsureEverythingIsReferenced` operationId) request. + EnsureEverythingIsReferenced(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // Issue1051 request + // Issue1051 performs a GET /issues/1051 (the `Issue1051` operationId) request. + Issue1051(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // Issue127 request + // Issue127 performs a GET /issues/127 (the `Issue127` operationId) request. + Issue127(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // Issue185WithBody request with any body + // Issue185WithBody performs a GET /issues/185 (the `Issue185` operationId) request, + // with any type of body and a specified content type. + Issue185WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // Issue185 performs a GET /issues/185 (the `Issue185` operationId) request, + // Takes a body for the `application/json` content type. Issue185(ctx context.Context, body Issue185JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // Issue209 request + // Issue209 performs a GET /issues/209/${str} (the `Issue209` operationId) request. + Issue209(ctx context.Context, str StringInPath, reqEditors ...RequestEditorFn) (*http.Response, error) - // Issue30 request + // Issue30 performs a GET /issues/30/{fallthrough} (the `Issue30` operationId) request. + Issue30(ctx context.Context, pFallthrough string, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetIssues375 request + // GetIssues375 performs a GET /issues/375 (the `GetIssues375` operationId) request. + GetIssues375(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // Issue41 request + // Issue41 performs a GET /issues/41/{1param} (the `Issue41` operationId) request. + Issue41(ctx context.Context, n1param N5StartsWithNumber, reqEditors ...RequestEditorFn) (*http.Response, error) - // Issue9WithBody request with any body + // Issue9WithBody performs a GET /issues/9 (the `Issue9` operationId) request, + // with any type of body and a specified content type. + Issue9WithBody(ctx context.Context, params *Issue9Params, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // Issue9 performs a GET /issues/9 (the `Issue9` operationId) request, + // Takes a body for the `application/json` content type. Issue9(ctx context.Context, params *Issue9Params, body Issue9JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // Issue975 request + // Issue975 performs a GET /issues/975 (the `Issue975` operationId) request. + Issue975(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) } +// EnsureEverythingIsReferenced performs a GET /ensure-everything-is-referenced (the `EnsureEverythingIsReferenced` operationId) request. + func (c *Client) EnsureEverythingIsReferenced(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewEnsureEverythingIsReferencedRequest(c.Server) if err != nil { @@ -248,6 +267,8 @@ func (c *Client) EnsureEverythingIsReferenced(ctx context.Context, reqEditors .. return c.Client.Do(req) } +// Issue1051 performs a GET /issues/1051 (the `Issue1051` operationId) request. + func (c *Client) Issue1051(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewIssue1051Request(c.Server) if err != nil { @@ -260,6 +281,8 @@ func (c *Client) Issue1051(ctx context.Context, reqEditors ...RequestEditorFn) ( return c.Client.Do(req) } +// Issue127 performs a GET /issues/127 (the `Issue127` operationId) request. + func (c *Client) Issue127(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewIssue127Request(c.Server) if err != nil { @@ -272,6 +295,9 @@ func (c *Client) Issue127(ctx context.Context, reqEditors ...RequestEditorFn) (* return c.Client.Do(req) } +// Issue185WithBody performs a GET /issues/185 (the `Issue185` operationId) request, +// with any type of body and a specified content type. + func (c *Client) Issue185WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewIssue185RequestWithBody(c.Server, contentType, body) if err != nil { @@ -284,6 +310,8 @@ func (c *Client) Issue185WithBody(ctx context.Context, contentType string, body return c.Client.Do(req) } +// Issue185 performs a GET /issues/185 (the `Issue185` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) Issue185(ctx context.Context, body Issue185JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewIssue185Request(c.Server, body) if err != nil { @@ -296,6 +324,8 @@ func (c *Client) Issue185(ctx context.Context, body Issue185JSONRequestBody, req return c.Client.Do(req) } +// Issue209 performs a GET /issues/209/${str} (the `Issue209` operationId) request. + func (c *Client) Issue209(ctx context.Context, str StringInPath, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewIssue209Request(c.Server, str) if err != nil { @@ -308,6 +338,8 @@ func (c *Client) Issue209(ctx context.Context, str StringInPath, reqEditors ...R return c.Client.Do(req) } +// Issue30 performs a GET /issues/30/{fallthrough} (the `Issue30` operationId) request. + func (c *Client) Issue30(ctx context.Context, pFallthrough string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewIssue30Request(c.Server, pFallthrough) if err != nil { @@ -320,6 +352,8 @@ func (c *Client) Issue30(ctx context.Context, pFallthrough string, reqEditors .. return c.Client.Do(req) } +// GetIssues375 performs a GET /issues/375 (the `GetIssues375` operationId) request. + func (c *Client) GetIssues375(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetIssues375Request(c.Server) if err != nil { @@ -332,6 +366,8 @@ func (c *Client) GetIssues375(ctx context.Context, reqEditors ...RequestEditorFn return c.Client.Do(req) } +// Issue41 performs a GET /issues/41/{1param} (the `Issue41` operationId) request. + func (c *Client) Issue41(ctx context.Context, n1param N5StartsWithNumber, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewIssue41Request(c.Server, n1param) if err != nil { @@ -344,6 +380,9 @@ func (c *Client) Issue41(ctx context.Context, n1param N5StartsWithNumber, reqEdi return c.Client.Do(req) } +// Issue9WithBody performs a GET /issues/9 (the `Issue9` operationId) request, +// with any type of body and a specified content type. + func (c *Client) Issue9WithBody(ctx context.Context, params *Issue9Params, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewIssue9RequestWithBody(c.Server, params, contentType, body) if err != nil { @@ -356,6 +395,8 @@ func (c *Client) Issue9WithBody(ctx context.Context, params *Issue9Params, conte return c.Client.Do(req) } +// Issue9 performs a GET /issues/9 (the `Issue9` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) Issue9(ctx context.Context, params *Issue9Params, body Issue9JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewIssue9Request(c.Server, params, body) if err != nil { @@ -368,6 +409,8 @@ func (c *Client) Issue9(ctx context.Context, params *Issue9Params, body Issue9JS return c.Client.Do(req) } +// Issue975 performs a GET /issues/975 (the `Issue975` operationId) request. + func (c *Client) Issue975(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewIssue975Request(c.Server) if err != nil { @@ -380,7 +423,7 @@ func (c *Client) Issue975(ctx context.Context, reqEditors ...RequestEditorFn) (* return c.Client.Do(req) } -// NewEnsureEverythingIsReferencedRequest generates requests for EnsureEverythingIsReferenced +// NewEnsureEverythingIsReferencedRequest constructs an http.Request for the EnsureEverythingIsReferenced method func NewEnsureEverythingIsReferencedRequest(server string) (*http.Request, error) { var err error @@ -407,7 +450,7 @@ func NewEnsureEverythingIsReferencedRequest(server string) (*http.Request, error return req, nil } -// NewIssue1051Request generates requests for Issue1051 +// NewIssue1051Request constructs an http.Request for the Issue1051 method func NewIssue1051Request(server string) (*http.Request, error) { var err error @@ -434,7 +477,7 @@ func NewIssue1051Request(server string) (*http.Request, error) { return req, nil } -// NewIssue127Request generates requests for Issue127 +// NewIssue127Request constructs an http.Request for the Issue127 method func NewIssue127Request(server string) (*http.Request, error) { var err error @@ -472,7 +515,7 @@ func NewIssue185Request(server string, body Issue185JSONRequestBody) (*http.Requ return NewIssue185RequestWithBody(server, "application/json", bodyReader) } -// NewIssue185RequestWithBody generates requests for Issue185 with any type of body +// NewIssue185RequestWithBody constructs an http.Request for the Issue185 method, with any body, and a specified content type func NewIssue185RequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -501,7 +544,7 @@ func NewIssue185RequestWithBody(server string, contentType string, body io.Reade return req, nil } -// NewIssue209Request generates requests for Issue209 +// NewIssue209Request constructs an http.Request for the Issue209 method func NewIssue209Request(server string, str StringInPath) (*http.Request, error) { var err error @@ -535,7 +578,7 @@ func NewIssue209Request(server string, str StringInPath) (*http.Request, error) return req, nil } -// NewIssue30Request generates requests for Issue30 +// NewIssue30Request constructs an http.Request for the Issue30 method func NewIssue30Request(server string, pFallthrough string) (*http.Request, error) { var err error @@ -569,7 +612,7 @@ func NewIssue30Request(server string, pFallthrough string) (*http.Request, error return req, nil } -// NewGetIssues375Request generates requests for GetIssues375 +// NewGetIssues375Request constructs an http.Request for the GetIssues375 method func NewGetIssues375Request(server string) (*http.Request, error) { var err error @@ -596,7 +639,7 @@ func NewGetIssues375Request(server string) (*http.Request, error) { return req, nil } -// NewIssue41Request generates requests for Issue41 +// NewIssue41Request constructs an http.Request for the Issue41 method func NewIssue41Request(server string, n1param N5StartsWithNumber) (*http.Request, error) { var err error @@ -641,7 +684,7 @@ func NewIssue9Request(server string, params *Issue9Params, body Issue9JSONReques return NewIssue9RequestWithBody(server, params, "application/json", bodyReader) } -// NewIssue9RequestWithBody generates requests for Issue9 with any type of body +// NewIssue9RequestWithBody constructs an http.Request for the Issue9 method, with any body, and a specified content type func NewIssue9RequestWithBody(server string, params *Issue9Params, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -693,7 +736,7 @@ func NewIssue9RequestWithBody(server string, params *Issue9Params, contentType s return req, nil } -// NewIssue975Request generates requests for Issue975 +// NewIssue975Request constructs an http.Request for the Issue975 method func NewIssue975Request(server string) (*http.Request, error) { var err error @@ -763,38 +806,75 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // EnsureEverythingIsReferencedWithResponse request + + // EnsureEverythingIsReferencedWithResponse performs a GET /ensure-everything-is-referenced (the `EnsureEverythingIsReferenced` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + EnsureEverythingIsReferencedWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*EnsureEverythingIsReferencedResponse, error) - // Issue1051WithResponse request + // Issue1051WithResponse performs a GET /issues/1051 (the `Issue1051` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + Issue1051WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*Issue1051Response, error) - // Issue127WithResponse request + // Issue127WithResponse performs a GET /issues/127 (the `Issue127` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + Issue127WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*Issue127Response, error) - // Issue185WithBodyWithResponse request with any body + // Issue185WithBodyWithResponse performs a GET /issues/185 (the `Issue185` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + Issue185WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Issue185Response, error) + // Issue185WithResponse performs a GET /issues/185 (the `Issue185` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). Issue185WithResponse(ctx context.Context, body Issue185JSONRequestBody, reqEditors ...RequestEditorFn) (*Issue185Response, error) - // Issue209WithResponse request + // Issue209WithResponse performs a GET /issues/209/${str} (the `Issue209` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + Issue209WithResponse(ctx context.Context, str StringInPath, reqEditors ...RequestEditorFn) (*Issue209Response, error) - // Issue30WithResponse request + // Issue30WithResponse performs a GET /issues/30/{fallthrough} (the `Issue30` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + Issue30WithResponse(ctx context.Context, pFallthrough string, reqEditors ...RequestEditorFn) (*Issue30Response, error) - // GetIssues375WithResponse request + // GetIssues375WithResponse performs a GET /issues/375 (the `GetIssues375` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + GetIssues375WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetIssues375Response, error) - // Issue41WithResponse request + // Issue41WithResponse performs a GET /issues/41/{1param} (the `Issue41` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + Issue41WithResponse(ctx context.Context, n1param N5StartsWithNumber, reqEditors ...RequestEditorFn) (*Issue41Response, error) - // Issue9WithBodyWithResponse request with any body + // Issue9WithBodyWithResponse performs a GET /issues/9 (the `Issue9` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + Issue9WithBodyWithResponse(ctx context.Context, params *Issue9Params, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Issue9Response, error) + // Issue9WithResponse performs a GET /issues/9 (the `Issue9` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). Issue9WithResponse(ctx context.Context, params *Issue9Params, body Issue9JSONRequestBody, reqEditors ...RequestEditorFn) (*Issue9Response, error) - // Issue975WithResponse request + // Issue975WithResponse performs a GET /issues/975 (the `Issue975` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + Issue975WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*Issue975Response, error) } @@ -812,7 +892,7 @@ type EnsureEverythingIsReferencedResponse struct { } } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r EnsureEverythingIsReferencedResponse) GetJSON200() *struct { AnyType1 *AnyType1 `json:"anyType1,omitempty"` @@ -861,12 +941,12 @@ type Issue1051Response struct { ApplicationvndSomethingV1JSON200 *map[string]interface{} } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r Issue1051Response) GetJSON200() *map[string]interface{} { return r.JSON200 } -// GetApplicationvndSomethingV1JSON200 returns ApplicationvndSomethingV1JSON200 +// GetApplicationvndSomethingV1JSON200 returns the response for an HTTP 200 `application/vnd.something.v1+json` response func (r Issue1051Response) GetApplicationvndSomethingV1JSON200() *map[string]interface{} { return r.ApplicationvndSomethingV1JSON200 } @@ -909,22 +989,22 @@ type Issue127Response struct { JSONDefault *GenericObject } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r Issue127Response) GetJSON200() *GenericObject { return r.JSON200 } -// GetXML200 returns XML200 +// GetXML200 returns the response for an HTTP 200 `application/xml` response func (r Issue127Response) GetXML200() *GenericObject { return r.XML200 } -// GetYAML200 returns YAML200 +// GetYAML200 returns the response for an HTTP 200 `text/yaml` response func (r Issue127Response) GetYAML200() *GenericObject { return r.YAML200 } -// GetJSONDefault returns JSONDefault +// GetJSONDefault returns the response for an HTTP default `application/json` response func (r Issue127Response) GetJSONDefault() *GenericObject { return r.JSONDefault } @@ -1066,7 +1146,7 @@ type GetIssues375Response struct { JSON200 *EnumInObjInArray } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetIssues375Response) GetJSON200() *EnumInObjInArray { return r.JSON200 } @@ -1174,7 +1254,7 @@ type Issue975Response struct { JSON200 *DeprecatedProperty } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r Issue975Response) GetJSON200() *DeprecatedProperty { return r.JSON200 } @@ -1208,7 +1288,10 @@ func (r Issue975Response) ContentType() string { return "" } -// EnsureEverythingIsReferencedWithResponse request returning *EnsureEverythingIsReferencedResponse +// EnsureEverythingIsReferencedWithResponse performs a GET /ensure-everything-is-referenced (the `EnsureEverythingIsReferenced` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) EnsureEverythingIsReferencedWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*EnsureEverythingIsReferencedResponse, error) { rsp, err := c.EnsureEverythingIsReferenced(ctx, reqEditors...) if err != nil { @@ -1217,7 +1300,10 @@ func (c *ClientWithResponses) EnsureEverythingIsReferencedWithResponse(ctx conte return ParseEnsureEverythingIsReferencedResponse(rsp) } -// Issue1051WithResponse request returning *Issue1051Response +// Issue1051WithResponse performs a GET /issues/1051 (the `Issue1051` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) Issue1051WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*Issue1051Response, error) { rsp, err := c.Issue1051(ctx, reqEditors...) if err != nil { @@ -1226,7 +1312,10 @@ func (c *ClientWithResponses) Issue1051WithResponse(ctx context.Context, reqEdit return ParseIssue1051Response(rsp) } -// Issue127WithResponse request returning *Issue127Response +// Issue127WithResponse performs a GET /issues/127 (the `Issue127` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) Issue127WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*Issue127Response, error) { rsp, err := c.Issue127(ctx, reqEditors...) if err != nil { @@ -1235,7 +1324,11 @@ func (c *ClientWithResponses) Issue127WithResponse(ctx context.Context, reqEdito return ParseIssue127Response(rsp) } -// Issue185WithBodyWithResponse request with arbitrary body returning *Issue185Response +// Issue185WithBodyWithResponse performs a GET /issues/185 (the `Issue185` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) Issue185WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Issue185Response, error) { rsp, err := c.Issue185WithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -1244,6 +1337,8 @@ func (c *ClientWithResponses) Issue185WithBodyWithResponse(ctx context.Context, return ParseIssue185Response(rsp) } +// Issue185WithResponse performs a GET /issues/185 (the `Issue185` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) Issue185WithResponse(ctx context.Context, body Issue185JSONRequestBody, reqEditors ...RequestEditorFn) (*Issue185Response, error) { rsp, err := c.Issue185(ctx, body, reqEditors...) if err != nil { @@ -1252,7 +1347,10 @@ func (c *ClientWithResponses) Issue185WithResponse(ctx context.Context, body Iss return ParseIssue185Response(rsp) } -// Issue209WithResponse request returning *Issue209Response +// Issue209WithResponse performs a GET /issues/209/${str} (the `Issue209` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) Issue209WithResponse(ctx context.Context, str StringInPath, reqEditors ...RequestEditorFn) (*Issue209Response, error) { rsp, err := c.Issue209(ctx, str, reqEditors...) if err != nil { @@ -1261,7 +1359,10 @@ func (c *ClientWithResponses) Issue209WithResponse(ctx context.Context, str Stri return ParseIssue209Response(rsp) } -// Issue30WithResponse request returning *Issue30Response +// Issue30WithResponse performs a GET /issues/30/{fallthrough} (the `Issue30` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) Issue30WithResponse(ctx context.Context, pFallthrough string, reqEditors ...RequestEditorFn) (*Issue30Response, error) { rsp, err := c.Issue30(ctx, pFallthrough, reqEditors...) if err != nil { @@ -1270,7 +1371,10 @@ func (c *ClientWithResponses) Issue30WithResponse(ctx context.Context, pFallthro return ParseIssue30Response(rsp) } -// GetIssues375WithResponse request returning *GetIssues375Response +// GetIssues375WithResponse performs a GET /issues/375 (the `GetIssues375` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) GetIssues375WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetIssues375Response, error) { rsp, err := c.GetIssues375(ctx, reqEditors...) if err != nil { @@ -1279,7 +1383,10 @@ func (c *ClientWithResponses) GetIssues375WithResponse(ctx context.Context, reqE return ParseGetIssues375Response(rsp) } -// Issue41WithResponse request returning *Issue41Response +// Issue41WithResponse performs a GET /issues/41/{1param} (the `Issue41` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) Issue41WithResponse(ctx context.Context, n1param N5StartsWithNumber, reqEditors ...RequestEditorFn) (*Issue41Response, error) { rsp, err := c.Issue41(ctx, n1param, reqEditors...) if err != nil { @@ -1288,7 +1395,11 @@ func (c *ClientWithResponses) Issue41WithResponse(ctx context.Context, n1param N return ParseIssue41Response(rsp) } -// Issue9WithBodyWithResponse request with arbitrary body returning *Issue9Response +// Issue9WithBodyWithResponse performs a GET /issues/9 (the `Issue9` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) Issue9WithBodyWithResponse(ctx context.Context, params *Issue9Params, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*Issue9Response, error) { rsp, err := c.Issue9WithBody(ctx, params, contentType, body, reqEditors...) if err != nil { @@ -1297,6 +1408,8 @@ func (c *ClientWithResponses) Issue9WithBodyWithResponse(ctx context.Context, pa return ParseIssue9Response(rsp) } +// Issue9WithResponse performs a GET /issues/9 (the `Issue9` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) Issue9WithResponse(ctx context.Context, params *Issue9Params, body Issue9JSONRequestBody, reqEditors ...RequestEditorFn) (*Issue9Response, error) { rsp, err := c.Issue9(ctx, params, body, reqEditors...) if err != nil { @@ -1305,7 +1418,10 @@ func (c *ClientWithResponses) Issue9WithResponse(ctx context.Context, params *Is return ParseIssue9Response(rsp) } -// Issue975WithResponse request returning *Issue975Response +// Issue975WithResponse performs a GET /issues/975 (the `Issue975` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) Issue975WithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*Issue975Response, error) { rsp, err := c.Issue975(ctx, reqEditors...) if err != nil { diff --git a/internal/test/server/server.gen.go b/internal/test/server/server.gen.go index df00ee714b..bc8f98400d 100644 --- a/internal/test/server/server.gen.go +++ b/internal/test/server/server.gen.go @@ -142,35 +142,35 @@ type UpdateResource3JSONRequestBody UpdateResource3JSONBody // ServerInterface represents all server handlers. type ServerInterface interface { - // get every type optional + // GetEveryTypeOptional get every type optional // (GET /every-type-optional) GetEveryTypeOptional(w http.ResponseWriter, r *http.Request) - // Get resource via simple path + // GetSimple Get resource via simple path // (GET /get-simple) GetSimple(w http.ResponseWriter, r *http.Request) - // Getter with referenced parameter and referenced response + // GetWithArgs Getter with referenced parameter and referenced response // (GET /get-with-args) GetWithArgs(w http.ResponseWriter, r *http.Request, params GetWithArgsParams) - // Getter with referenced parameter and referenced response + // GetWithReferences Getter with referenced parameter and referenced response // (GET /get-with-references/{global_argument}/{argument}) GetWithReferences(w http.ResponseWriter, r *http.Request, globalArgument int64, argument Argument) - // Get an object by ID + // GetWithContentType Get an object by ID // (GET /get-with-type/{content_type}) GetWithContentType(w http.ResponseWriter, r *http.Request, contentType GetWithContentTypeParamsContentType) - // get with reserved keyword + // GetReservedKeyword get with reserved keyword // (GET /reserved-keyword) GetReservedKeyword(w http.ResponseWriter, r *http.Request) - // Create a resource + // CreateResource Create a resource // (POST /resource/{argument}) CreateResource(w http.ResponseWriter, r *http.Request, argument Argument) - // Create a resource with inline parameter + // CreateResource2 Create a resource with inline parameter // (POST /resource2/{inline_argument}) CreateResource2(w http.ResponseWriter, r *http.Request, inlineArgument int, params CreateResource2Params) - // Update a resource with inline body. The parameter name is a reserved + // UpdateResource3 Update a resource with inline body. The parameter name is a reserved // keyword, so make sure that gets prefixed to avoid syntax errors // (PUT /resource3/{fallthrough}) UpdateResource3(w http.ResponseWriter, r *http.Request, pFallthrough int) - // get response with reference + // GetResponseWithReference get response with reference // (GET /response-with-reference) GetResponseWithReference(w http.ResponseWriter, r *http.Request) } @@ -179,62 +179,62 @@ type ServerInterface interface { type Unimplemented struct{} -// get every type optional +// GetEveryTypeOptional get every type optional // (GET /every-type-optional) func (_ Unimplemented) GetEveryTypeOptional(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } -// Get resource via simple path +// GetSimple Get resource via simple path // (GET /get-simple) func (_ Unimplemented) GetSimple(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } -// Getter with referenced parameter and referenced response +// GetWithArgs Getter with referenced parameter and referenced response // (GET /get-with-args) func (_ Unimplemented) GetWithArgs(w http.ResponseWriter, r *http.Request, params GetWithArgsParams) { w.WriteHeader(http.StatusNotImplemented) } -// Getter with referenced parameter and referenced response +// GetWithReferences Getter with referenced parameter and referenced response // (GET /get-with-references/{global_argument}/{argument}) func (_ Unimplemented) GetWithReferences(w http.ResponseWriter, r *http.Request, globalArgument int64, argument Argument) { w.WriteHeader(http.StatusNotImplemented) } -// Get an object by ID +// GetWithContentType Get an object by ID // (GET /get-with-type/{content_type}) func (_ Unimplemented) GetWithContentType(w http.ResponseWriter, r *http.Request, contentType GetWithContentTypeParamsContentType) { w.WriteHeader(http.StatusNotImplemented) } -// get with reserved keyword +// GetReservedKeyword get with reserved keyword // (GET /reserved-keyword) func (_ Unimplemented) GetReservedKeyword(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) } -// Create a resource +// CreateResource Create a resource // (POST /resource/{argument}) func (_ Unimplemented) CreateResource(w http.ResponseWriter, r *http.Request, argument Argument) { w.WriteHeader(http.StatusNotImplemented) } -// Create a resource with inline parameter +// CreateResource2 Create a resource with inline parameter // (POST /resource2/{inline_argument}) func (_ Unimplemented) CreateResource2(w http.ResponseWriter, r *http.Request, inlineArgument int, params CreateResource2Params) { w.WriteHeader(http.StatusNotImplemented) } -// Update a resource with inline body. The parameter name is a reserved +// UpdateResource3 Update a resource with inline body. The parameter name is a reserved // keyword, so make sure that gets prefixed to avoid syntax errors // (PUT /resource3/{fallthrough}) func (_ Unimplemented) UpdateResource3(w http.ResponseWriter, r *http.Request, pFallthrough int) { w.WriteHeader(http.StatusNotImplemented) } -// get response with reference +// GetResponseWithReference get response with reference // (GET /response-with-reference) func (_ Unimplemented) GetResponseWithReference(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNotImplemented) diff --git a/internal/test/strict-server/client/client.gen.go b/internal/test/strict-server/client/client.gen.go index a076eddef0..d4398e0a8d 100644 --- a/internal/test/strict-server/client/client.gen.go +++ b/internal/test/strict-server/client/client.gen.go @@ -151,7 +151,7 @@ func (t *UnionExample200JSONResponseBody) UnmarshalJSON(b []byte) error { return err } -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -224,74 +224,128 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // JSONExampleWithBody request with any body + + // JSONExampleWithBody performs a POST /json (the `JSONExample` operationId) request, + // with any type of body and a specified content type. + JSONExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // JSONExample performs a POST /json (the `JSONExample` operationId) request, + // Takes a body for the `application/json` content type. JSONExample(ctx context.Context, body JSONExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // MultipartExampleWithBody request with any body + // MultipartExampleWithBody performs a POST /multipart (the `MultipartExample` operationId) request, + // with any type of body and a specified content type. + MultipartExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // MultipartRelatedExampleWithBody request with any body + // MultipartRelatedExampleWithBody performs a POST /multipart-related (the `MultipartRelatedExample` operationId) request, + // with any type of body and a specified content type. + MultipartRelatedExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // MultipleRequestAndResponseTypesWithBody request with any body + // MultipleRequestAndResponseTypesWithBody performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, + // with any type of body and a specified content type. + MultipleRequestAndResponseTypesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // MultipleRequestAndResponseTypes performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, + // Takes a body for the `application/json` content type. MultipleRequestAndResponseTypes(ctx context.Context, body MultipleRequestAndResponseTypesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // MultipleRequestAndResponseTypes performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, + // Takes a body for the `application/x-www-form-urlencoded` content type. MultipleRequestAndResponseTypesWithFormdataBody(ctx context.Context, body MultipleRequestAndResponseTypesFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // MultipleRequestAndResponseTypes performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, + // Takes a body for the `text/plain` content type. MultipleRequestAndResponseTypesWithTextBody(ctx context.Context, body MultipleRequestAndResponseTypesTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // NoContentHeaders request + // NoContentHeaders performs a POST /no-content-headers (the `NoContentHeaders` operationId) request. + NoContentHeaders(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // RequiredJSONBodyWithBody request with any body + // RequiredJSONBodyWithBody performs a POST /required-json-body (the `RequiredJSONBody` operationId) request, + // with any type of body and a specified content type. + RequiredJSONBodyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // RequiredJSONBody performs a POST /required-json-body (the `RequiredJSONBody` operationId) request, + // Takes a body for the `application/json` content type. RequiredJSONBody(ctx context.Context, body RequiredJSONBodyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // RequiredTextBodyWithBody request with any body + // RequiredTextBodyWithBody performs a POST /required-text-body (the `RequiredTextBody` operationId) request, + // with any type of body and a specified content type. + RequiredTextBodyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // RequiredTextBody performs a POST /required-text-body (the `RequiredTextBody` operationId) request, + // Takes a body for the `text/plain` content type. RequiredTextBodyWithTextBody(ctx context.Context, body RequiredTextBodyTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // ReservedGoKeywordParameters request + // ReservedGoKeywordParameters performs a GET /reserved-go-keyword-parameters/{type} (the `ReservedGoKeywordParameters` operationId) request. + ReservedGoKeywordParameters(ctx context.Context, pType string, reqEditors ...RequestEditorFn) (*http.Response, error) - // ReusableResponsesWithBody request with any body + // ReusableResponsesWithBody performs a POST /reusable-responses (the `ReusableResponses` operationId) request, + // with any type of body and a specified content type. + ReusableResponsesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // ReusableResponses performs a POST /reusable-responses (the `ReusableResponses` operationId) request, + // Takes a body for the `application/json` content type. ReusableResponses(ctx context.Context, body ReusableResponsesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // TextExampleWithBody request with any body + // TextExampleWithBody performs a POST /text (the `TextExample` operationId) request, + // with any type of body and a specified content type. + TextExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // TextExample performs a POST /text (the `TextExample` operationId) request, + // Takes a body for the `text/plain` content type. TextExampleWithTextBody(ctx context.Context, body TextExampleTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // UnknownExampleWithBody request with any body + // UnknownExampleWithBody performs a POST /unknown (the `UnknownExample` operationId) request, + // with any type of body and a specified content type. + UnknownExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // UnspecifiedContentTypeWithBody request with any body + // UnspecifiedContentTypeWithBody performs a POST /unspecified-content-type (the `UnspecifiedContentType` operationId) request, + // with any type of body and a specified content type. + UnspecifiedContentTypeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // URLEncodedExampleWithBody request with any body + // URLEncodedExampleWithBody performs a POST /urlencoded (the `URLEncodedExample` operationId) request, + // with any type of body and a specified content type. + URLEncodedExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // URLEncodedExample performs a POST /urlencoded (the `URLEncodedExample` operationId) request, + // Takes a body for the `application/x-www-form-urlencoded` content type. URLEncodedExampleWithFormdataBody(ctx context.Context, body URLEncodedExampleFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // HeadersExampleWithBody request with any body + // HeadersExampleWithBody performs a POST /with-headers (the `HeadersExample` operationId) request, + // with any type of body and a specified content type. + HeadersExampleWithBody(ctx context.Context, params *HeadersExampleParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // HeadersExample performs a POST /with-headers (the `HeadersExample` operationId) request, + // Takes a body for the `application/json` content type. HeadersExample(ctx context.Context, params *HeadersExampleParams, body HeadersExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // UnionExampleWithBody request with any body + // UnionExampleWithBody performs a POST /with-union (the `UnionExample` operationId) request, + // with any type of body and a specified content type. + UnionExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // UnionExample performs a POST /with-union (the `UnionExample` operationId) request, + // Takes a body for the `application/json` content type. UnionExample(ctx context.Context, body UnionExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } +// JSONExampleWithBody performs a POST /json (the `JSONExample` operationId) request, +// with any type of body and a specified content type. + func (c *Client) JSONExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewJSONExampleRequestWithBody(c.Server, contentType, body) if err != nil { @@ -304,6 +358,8 @@ func (c *Client) JSONExampleWithBody(ctx context.Context, contentType string, bo return c.Client.Do(req) } +// JSONExample performs a POST /json (the `JSONExample` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) JSONExample(ctx context.Context, body JSONExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewJSONExampleRequest(c.Server, body) if err != nil { @@ -316,6 +372,9 @@ func (c *Client) JSONExample(ctx context.Context, body JSONExampleJSONRequestBod return c.Client.Do(req) } +// MultipartExampleWithBody performs a POST /multipart (the `MultipartExample` operationId) request, +// with any type of body and a specified content type. + func (c *Client) MultipartExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewMultipartExampleRequestWithBody(c.Server, contentType, body) if err != nil { @@ -328,6 +387,9 @@ func (c *Client) MultipartExampleWithBody(ctx context.Context, contentType strin return c.Client.Do(req) } +// MultipartRelatedExampleWithBody performs a POST /multipart-related (the `MultipartRelatedExample` operationId) request, +// with any type of body and a specified content type. + func (c *Client) MultipartRelatedExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewMultipartRelatedExampleRequestWithBody(c.Server, contentType, body) if err != nil { @@ -340,6 +402,9 @@ func (c *Client) MultipartRelatedExampleWithBody(ctx context.Context, contentTyp return c.Client.Do(req) } +// MultipleRequestAndResponseTypesWithBody performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, +// with any type of body and a specified content type. + func (c *Client) MultipleRequestAndResponseTypesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewMultipleRequestAndResponseTypesRequestWithBody(c.Server, contentType, body) if err != nil { @@ -352,6 +417,8 @@ func (c *Client) MultipleRequestAndResponseTypesWithBody(ctx context.Context, co return c.Client.Do(req) } +// MultipleRequestAndResponseTypes performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) MultipleRequestAndResponseTypes(ctx context.Context, body MultipleRequestAndResponseTypesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewMultipleRequestAndResponseTypesRequest(c.Server, body) if err != nil { @@ -364,6 +431,8 @@ func (c *Client) MultipleRequestAndResponseTypes(ctx context.Context, body Multi return c.Client.Do(req) } +// MultipleRequestAndResponseTypes performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, +// Takes a body for the `application/x-www-form-urlencoded` content type. func (c *Client) MultipleRequestAndResponseTypesWithFormdataBody(ctx context.Context, body MultipleRequestAndResponseTypesFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewMultipleRequestAndResponseTypesRequestWithFormdataBody(c.Server, body) if err != nil { @@ -376,6 +445,8 @@ func (c *Client) MultipleRequestAndResponseTypesWithFormdataBody(ctx context.Con return c.Client.Do(req) } +// MultipleRequestAndResponseTypes performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, +// Takes a body for the `text/plain` content type. func (c *Client) MultipleRequestAndResponseTypesWithTextBody(ctx context.Context, body MultipleRequestAndResponseTypesTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewMultipleRequestAndResponseTypesRequestWithTextBody(c.Server, body) if err != nil { @@ -388,6 +459,8 @@ func (c *Client) MultipleRequestAndResponseTypesWithTextBody(ctx context.Context return c.Client.Do(req) } +// NoContentHeaders performs a POST /no-content-headers (the `NoContentHeaders` operationId) request. + func (c *Client) NoContentHeaders(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewNoContentHeadersRequest(c.Server) if err != nil { @@ -400,6 +473,9 @@ func (c *Client) NoContentHeaders(ctx context.Context, reqEditors ...RequestEdit return c.Client.Do(req) } +// RequiredJSONBodyWithBody performs a POST /required-json-body (the `RequiredJSONBody` operationId) request, +// with any type of body and a specified content type. + func (c *Client) RequiredJSONBodyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRequiredJSONBodyRequestWithBody(c.Server, contentType, body) if err != nil { @@ -412,6 +488,8 @@ func (c *Client) RequiredJSONBodyWithBody(ctx context.Context, contentType strin return c.Client.Do(req) } +// RequiredJSONBody performs a POST /required-json-body (the `RequiredJSONBody` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) RequiredJSONBody(ctx context.Context, body RequiredJSONBodyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRequiredJSONBodyRequest(c.Server, body) if err != nil { @@ -424,6 +502,9 @@ func (c *Client) RequiredJSONBody(ctx context.Context, body RequiredJSONBodyJSON return c.Client.Do(req) } +// RequiredTextBodyWithBody performs a POST /required-text-body (the `RequiredTextBody` operationId) request, +// with any type of body and a specified content type. + func (c *Client) RequiredTextBodyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRequiredTextBodyRequestWithBody(c.Server, contentType, body) if err != nil { @@ -436,6 +517,8 @@ func (c *Client) RequiredTextBodyWithBody(ctx context.Context, contentType strin return c.Client.Do(req) } +// RequiredTextBody performs a POST /required-text-body (the `RequiredTextBody` operationId) request, +// Takes a body for the `text/plain` content type. func (c *Client) RequiredTextBodyWithTextBody(ctx context.Context, body RequiredTextBodyTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRequiredTextBodyRequestWithTextBody(c.Server, body) if err != nil { @@ -448,6 +531,8 @@ func (c *Client) RequiredTextBodyWithTextBody(ctx context.Context, body Required return c.Client.Do(req) } +// ReservedGoKeywordParameters performs a GET /reserved-go-keyword-parameters/{type} (the `ReservedGoKeywordParameters` operationId) request. + func (c *Client) ReservedGoKeywordParameters(ctx context.Context, pType string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewReservedGoKeywordParametersRequest(c.Server, pType) if err != nil { @@ -460,6 +545,9 @@ func (c *Client) ReservedGoKeywordParameters(ctx context.Context, pType string, return c.Client.Do(req) } +// ReusableResponsesWithBody performs a POST /reusable-responses (the `ReusableResponses` operationId) request, +// with any type of body and a specified content type. + func (c *Client) ReusableResponsesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewReusableResponsesRequestWithBody(c.Server, contentType, body) if err != nil { @@ -472,6 +560,8 @@ func (c *Client) ReusableResponsesWithBody(ctx context.Context, contentType stri return c.Client.Do(req) } +// ReusableResponses performs a POST /reusable-responses (the `ReusableResponses` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) ReusableResponses(ctx context.Context, body ReusableResponsesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewReusableResponsesRequest(c.Server, body) if err != nil { @@ -484,6 +574,9 @@ func (c *Client) ReusableResponses(ctx context.Context, body ReusableResponsesJS return c.Client.Do(req) } +// TextExampleWithBody performs a POST /text (the `TextExample` operationId) request, +// with any type of body and a specified content type. + func (c *Client) TextExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTextExampleRequestWithBody(c.Server, contentType, body) if err != nil { @@ -496,6 +589,8 @@ func (c *Client) TextExampleWithBody(ctx context.Context, contentType string, bo return c.Client.Do(req) } +// TextExample performs a POST /text (the `TextExample` operationId) request, +// Takes a body for the `text/plain` content type. func (c *Client) TextExampleWithTextBody(ctx context.Context, body TextExampleTextRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewTextExampleRequestWithTextBody(c.Server, body) if err != nil { @@ -508,6 +603,9 @@ func (c *Client) TextExampleWithTextBody(ctx context.Context, body TextExampleTe return c.Client.Do(req) } +// UnknownExampleWithBody performs a POST /unknown (the `UnknownExample` operationId) request, +// with any type of body and a specified content type. + func (c *Client) UnknownExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUnknownExampleRequestWithBody(c.Server, contentType, body) if err != nil { @@ -520,6 +618,9 @@ func (c *Client) UnknownExampleWithBody(ctx context.Context, contentType string, return c.Client.Do(req) } +// UnspecifiedContentTypeWithBody performs a POST /unspecified-content-type (the `UnspecifiedContentType` operationId) request, +// with any type of body and a specified content type. + func (c *Client) UnspecifiedContentTypeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUnspecifiedContentTypeRequestWithBody(c.Server, contentType, body) if err != nil { @@ -532,6 +633,9 @@ func (c *Client) UnspecifiedContentTypeWithBody(ctx context.Context, contentType return c.Client.Do(req) } +// URLEncodedExampleWithBody performs a POST /urlencoded (the `URLEncodedExample` operationId) request, +// with any type of body and a specified content type. + func (c *Client) URLEncodedExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewURLEncodedExampleRequestWithBody(c.Server, contentType, body) if err != nil { @@ -544,6 +648,8 @@ func (c *Client) URLEncodedExampleWithBody(ctx context.Context, contentType stri return c.Client.Do(req) } +// URLEncodedExample performs a POST /urlencoded (the `URLEncodedExample` operationId) request, +// Takes a body for the `application/x-www-form-urlencoded` content type. func (c *Client) URLEncodedExampleWithFormdataBody(ctx context.Context, body URLEncodedExampleFormdataRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewURLEncodedExampleRequestWithFormdataBody(c.Server, body) if err != nil { @@ -556,6 +662,9 @@ func (c *Client) URLEncodedExampleWithFormdataBody(ctx context.Context, body URL return c.Client.Do(req) } +// HeadersExampleWithBody performs a POST /with-headers (the `HeadersExample` operationId) request, +// with any type of body and a specified content type. + func (c *Client) HeadersExampleWithBody(ctx context.Context, params *HeadersExampleParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewHeadersExampleRequestWithBody(c.Server, params, contentType, body) if err != nil { @@ -568,6 +677,8 @@ func (c *Client) HeadersExampleWithBody(ctx context.Context, params *HeadersExam return c.Client.Do(req) } +// HeadersExample performs a POST /with-headers (the `HeadersExample` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) HeadersExample(ctx context.Context, params *HeadersExampleParams, body HeadersExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewHeadersExampleRequest(c.Server, params, body) if err != nil { @@ -580,6 +691,9 @@ func (c *Client) HeadersExample(ctx context.Context, params *HeadersExampleParam return c.Client.Do(req) } +// UnionExampleWithBody performs a POST /with-union (the `UnionExample` operationId) request, +// with any type of body and a specified content type. + func (c *Client) UnionExampleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUnionExampleRequestWithBody(c.Server, contentType, body) if err != nil { @@ -592,6 +706,8 @@ func (c *Client) UnionExampleWithBody(ctx context.Context, contentType string, b return c.Client.Do(req) } +// UnionExample performs a POST /with-union (the `UnionExample` operationId) request, +// Takes a body for the `application/json` content type. func (c *Client) UnionExample(ctx context.Context, body UnionExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewUnionExampleRequest(c.Server, body) if err != nil { @@ -615,7 +731,7 @@ func NewJSONExampleRequest(server string, body JSONExampleJSONRequestBody) (*htt return NewJSONExampleRequestWithBody(server, "application/json", bodyReader) } -// NewJSONExampleRequestWithBody generates requests for JSONExample with any type of body +// NewJSONExampleRequestWithBody constructs an http.Request for the JSONExample method, with any body, and a specified content type func NewJSONExampleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -644,7 +760,7 @@ func NewJSONExampleRequestWithBody(server string, contentType string, body io.Re return req, nil } -// NewMultipartExampleRequestWithBody generates requests for MultipartExample with any type of body +// NewMultipartExampleRequestWithBody constructs an http.Request for the MultipartExample method, with any body, and a specified content type func NewMultipartExampleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -673,7 +789,7 @@ func NewMultipartExampleRequestWithBody(server string, contentType string, body return req, nil } -// NewMultipartRelatedExampleRequestWithBody generates requests for MultipartRelatedExample with any type of body +// NewMultipartRelatedExampleRequestWithBody constructs an http.Request for the MultipartRelatedExample method, with any body, and a specified content type func NewMultipartRelatedExampleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -735,7 +851,7 @@ func NewMultipleRequestAndResponseTypesRequestWithTextBody(server string, body M return NewMultipleRequestAndResponseTypesRequestWithBody(server, "text/plain", bodyReader) } -// NewMultipleRequestAndResponseTypesRequestWithBody generates requests for MultipleRequestAndResponseTypes with any type of body +// NewMultipleRequestAndResponseTypesRequestWithBody constructs an http.Request for the MultipleRequestAndResponseTypes method, with any body, and a specified content type func NewMultipleRequestAndResponseTypesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -764,7 +880,7 @@ func NewMultipleRequestAndResponseTypesRequestWithBody(server string, contentTyp return req, nil } -// NewNoContentHeadersRequest generates requests for NoContentHeaders +// NewNoContentHeadersRequest constructs an http.Request for the NoContentHeaders method func NewNoContentHeadersRequest(server string) (*http.Request, error) { var err error @@ -802,7 +918,7 @@ func NewRequiredJSONBodyRequest(server string, body RequiredJSONBodyJSONRequestB return NewRequiredJSONBodyRequestWithBody(server, "application/json", bodyReader) } -// NewRequiredJSONBodyRequestWithBody generates requests for RequiredJSONBody with any type of body +// NewRequiredJSONBodyRequestWithBody constructs an http.Request for the RequiredJSONBody method, with any body, and a specified content type func NewRequiredJSONBodyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -842,7 +958,7 @@ func NewRequiredTextBodyRequestWithTextBody(server string, body RequiredTextBody return NewRequiredTextBodyRequestWithBody(server, "text/plain", bodyReader) } -// NewRequiredTextBodyRequestWithBody generates requests for RequiredTextBody with any type of body +// NewRequiredTextBodyRequestWithBody constructs an http.Request for the RequiredTextBody method, with any body, and a specified content type func NewRequiredTextBodyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -871,7 +987,7 @@ func NewRequiredTextBodyRequestWithBody(server string, contentType string, body return req, nil } -// NewReservedGoKeywordParametersRequest generates requests for ReservedGoKeywordParameters +// NewReservedGoKeywordParametersRequest constructs an http.Request for the ReservedGoKeywordParameters method func NewReservedGoKeywordParametersRequest(server string, pType string) (*http.Request, error) { var err error @@ -916,7 +1032,7 @@ func NewReusableResponsesRequest(server string, body ReusableResponsesJSONReques return NewReusableResponsesRequestWithBody(server, "application/json", bodyReader) } -// NewReusableResponsesRequestWithBody generates requests for ReusableResponses with any type of body +// NewReusableResponsesRequestWithBody constructs an http.Request for the ReusableResponses method, with any body, and a specified content type func NewReusableResponsesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -956,7 +1072,7 @@ func NewTextExampleRequestWithTextBody(server string, body TextExampleTextReques return NewTextExampleRequestWithBody(server, "text/plain", bodyReader) } -// NewTextExampleRequestWithBody generates requests for TextExample with any type of body +// NewTextExampleRequestWithBody constructs an http.Request for the TextExample method, with any body, and a specified content type func NewTextExampleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -985,7 +1101,7 @@ func NewTextExampleRequestWithBody(server string, contentType string, body io.Re return req, nil } -// NewUnknownExampleRequestWithBody generates requests for UnknownExample with any type of body +// NewUnknownExampleRequestWithBody constructs an http.Request for the UnknownExample method, with any body, and a specified content type func NewUnknownExampleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1014,7 +1130,7 @@ func NewUnknownExampleRequestWithBody(server string, contentType string, body io return req, nil } -// NewUnspecifiedContentTypeRequestWithBody generates requests for UnspecifiedContentType with any type of body +// NewUnspecifiedContentTypeRequestWithBody constructs an http.Request for the UnspecifiedContentType method, with any body, and a specified content type func NewUnspecifiedContentTypeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1054,7 +1170,7 @@ func NewURLEncodedExampleRequestWithFormdataBody(server string, body URLEncodedE return NewURLEncodedExampleRequestWithBody(server, "application/x-www-form-urlencoded", bodyReader) } -// NewURLEncodedExampleRequestWithBody generates requests for URLEncodedExample with any type of body +// NewURLEncodedExampleRequestWithBody constructs an http.Request for the URLEncodedExample method, with any body, and a specified content type func NewURLEncodedExampleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1094,7 +1210,7 @@ func NewHeadersExampleRequest(server string, params *HeadersExampleParams, body return NewHeadersExampleRequestWithBody(server, params, "application/json", bodyReader) } -// NewHeadersExampleRequestWithBody generates requests for HeadersExample with any type of body +// NewHeadersExampleRequestWithBody constructs an http.Request for the HeadersExample method, with any body, and a specified content type func NewHeadersExampleRequestWithBody(server string, params *HeadersExampleParams, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1158,7 +1274,7 @@ func NewUnionExampleRequest(server string, body UnionExampleJSONRequestBody) (*h return NewUnionExampleRequestWithBody(server, "application/json", bodyReader) } -// NewUnionExampleRequestWithBody generates requests for UnionExample with any type of body +// NewUnionExampleRequestWithBody constructs an http.Request for the UnionExample method, with any body, and a specified content type func NewUnionExampleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error @@ -1230,71 +1346,152 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // JSONExampleWithBodyWithResponse request with any body + + // JSONExampleWithBodyWithResponse performs a POST /json (the `JSONExample` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + JSONExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*JSONExampleResponse, error) + // JSONExampleWithResponse performs a POST /json (the `JSONExample` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). JSONExampleWithResponse(ctx context.Context, body JSONExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*JSONExampleResponse, error) - // MultipartExampleWithBodyWithResponse request with any body + // MultipartExampleWithBodyWithResponse performs a POST /multipart (the `MultipartExample` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + MultipartExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MultipartExampleResponse, error) - // MultipartRelatedExampleWithBodyWithResponse request with any body + // MultipartRelatedExampleWithBodyWithResponse performs a POST /multipart-related (the `MultipartRelatedExample` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + MultipartRelatedExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MultipartRelatedExampleResponse, error) - // MultipleRequestAndResponseTypesWithBodyWithResponse request with any body + // MultipleRequestAndResponseTypesWithBodyWithResponse performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + MultipleRequestAndResponseTypesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MultipleRequestAndResponseTypesResponse, error) + // MultipleRequestAndResponseTypesWithResponse performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). MultipleRequestAndResponseTypesWithResponse(ctx context.Context, body MultipleRequestAndResponseTypesJSONRequestBody, reqEditors ...RequestEditorFn) (*MultipleRequestAndResponseTypesResponse, error) + // MultipleRequestAndResponseTypesWithResponse performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, + // Takes a body of the `application/x-www-form-urlencoded` content type, and returns a wrapper object for the known response body format(s). MultipleRequestAndResponseTypesWithFormdataBodyWithResponse(ctx context.Context, body MultipleRequestAndResponseTypesFormdataRequestBody, reqEditors ...RequestEditorFn) (*MultipleRequestAndResponseTypesResponse, error) + // MultipleRequestAndResponseTypesWithResponse performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, + // Takes a body of the `text/plain` content type, and returns a wrapper object for the known response body format(s). MultipleRequestAndResponseTypesWithTextBodyWithResponse(ctx context.Context, body MultipleRequestAndResponseTypesTextRequestBody, reqEditors ...RequestEditorFn) (*MultipleRequestAndResponseTypesResponse, error) - // NoContentHeadersWithResponse request + // NoContentHeadersWithResponse performs a POST /no-content-headers (the `NoContentHeaders` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + NoContentHeadersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*NoContentHeadersResponse, error) - // RequiredJSONBodyWithBodyWithResponse request with any body + // RequiredJSONBodyWithBodyWithResponse performs a POST /required-json-body (the `RequiredJSONBody` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + RequiredJSONBodyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequiredJSONBodyResponse, error) + // RequiredJSONBodyWithResponse performs a POST /required-json-body (the `RequiredJSONBody` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). RequiredJSONBodyWithResponse(ctx context.Context, body RequiredJSONBodyJSONRequestBody, reqEditors ...RequestEditorFn) (*RequiredJSONBodyResponse, error) - // RequiredTextBodyWithBodyWithResponse request with any body + // RequiredTextBodyWithBodyWithResponse performs a POST /required-text-body (the `RequiredTextBody` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + RequiredTextBodyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequiredTextBodyResponse, error) + // RequiredTextBodyWithResponse performs a POST /required-text-body (the `RequiredTextBody` operationId) request, + // Takes a body of the `text/plain` content type, and returns a wrapper object for the known response body format(s). RequiredTextBodyWithTextBodyWithResponse(ctx context.Context, body RequiredTextBodyTextRequestBody, reqEditors ...RequestEditorFn) (*RequiredTextBodyResponse, error) - // ReservedGoKeywordParametersWithResponse request + // ReservedGoKeywordParametersWithResponse performs a GET /reserved-go-keyword-parameters/{type} (the `ReservedGoKeywordParameters` operationId) request. + // + // Returns a wrapper object for the known response body format(s). + ReservedGoKeywordParametersWithResponse(ctx context.Context, pType string, reqEditors ...RequestEditorFn) (*ReservedGoKeywordParametersResponse, error) - // ReusableResponsesWithBodyWithResponse request with any body + // ReusableResponsesWithBodyWithResponse performs a POST /reusable-responses (the `ReusableResponses` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + ReusableResponsesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReusableResponsesResponse, error) + // ReusableResponsesWithResponse performs a POST /reusable-responses (the `ReusableResponses` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). ReusableResponsesWithResponse(ctx context.Context, body ReusableResponsesJSONRequestBody, reqEditors ...RequestEditorFn) (*ReusableResponsesResponse, error) - // TextExampleWithBodyWithResponse request with any body + // TextExampleWithBodyWithResponse performs a POST /text (the `TextExample` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + TextExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TextExampleResponse, error) + // TextExampleWithResponse performs a POST /text (the `TextExample` operationId) request, + // Takes a body of the `text/plain` content type, and returns a wrapper object for the known response body format(s). TextExampleWithTextBodyWithResponse(ctx context.Context, body TextExampleTextRequestBody, reqEditors ...RequestEditorFn) (*TextExampleResponse, error) - // UnknownExampleWithBodyWithResponse request with any body + // UnknownExampleWithBodyWithResponse performs a POST /unknown (the `UnknownExample` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + UnknownExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UnknownExampleResponse, error) - // UnspecifiedContentTypeWithBodyWithResponse request with any body + // UnspecifiedContentTypeWithBodyWithResponse performs a POST /unspecified-content-type (the `UnspecifiedContentType` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + UnspecifiedContentTypeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UnspecifiedContentTypeResponse, error) - // URLEncodedExampleWithBodyWithResponse request with any body + // URLEncodedExampleWithBodyWithResponse performs a POST /urlencoded (the `URLEncodedExample` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + URLEncodedExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*URLEncodedExampleResponse, error) + // URLEncodedExampleWithResponse performs a POST /urlencoded (the `URLEncodedExample` operationId) request, + // Takes a body of the `application/x-www-form-urlencoded` content type, and returns a wrapper object for the known response body format(s). URLEncodedExampleWithFormdataBodyWithResponse(ctx context.Context, body URLEncodedExampleFormdataRequestBody, reqEditors ...RequestEditorFn) (*URLEncodedExampleResponse, error) - // HeadersExampleWithBodyWithResponse request with any body + // HeadersExampleWithBodyWithResponse performs a POST /with-headers (the `HeadersExample` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + HeadersExampleWithBodyWithResponse(ctx context.Context, params *HeadersExampleParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HeadersExampleResponse, error) + // HeadersExampleWithResponse performs a POST /with-headers (the `HeadersExample` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). HeadersExampleWithResponse(ctx context.Context, params *HeadersExampleParams, body HeadersExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*HeadersExampleResponse, error) - // UnionExampleWithBodyWithResponse request with any body + // UnionExampleWithBodyWithResponse performs a POST /with-union (the `UnionExample` operationId) request, + // with any type of body and a specified content type. + // + // Returns a wrapper object for the known response body format(s). + UnionExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UnionExampleResponse, error) + // UnionExampleWithResponse performs a POST /with-union (the `UnionExample` operationId) request, + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). UnionExampleWithResponse(ctx context.Context, body UnionExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*UnionExampleResponse, error) } @@ -1304,7 +1501,7 @@ type JSONExampleResponse struct { JSON200 *Example } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r JSONExampleResponse) GetJSON200() *Example { return r.JSON200 } @@ -1412,7 +1609,7 @@ type MultipleRequestAndResponseTypesResponse struct { JSON200 *Example } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r MultipleRequestAndResponseTypesResponse) GetJSON200() *Example { return r.JSON200 } @@ -1486,7 +1683,7 @@ type RequiredJSONBodyResponse struct { JSON200 *Example } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r RequiredJSONBodyResponse) GetJSON200() *Example { return r.JSON200 } @@ -1594,7 +1791,7 @@ type ReusableResponsesResponse struct { JSON200 *Reusableresponse } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ReusableResponsesResponse) GetJSON200() *Reusableresponse { return r.JSON200 } @@ -1770,7 +1967,7 @@ type HeadersExampleResponse struct { JSON200 *Example } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r HeadersExampleResponse) GetJSON200() *Example { return r.JSON200 } @@ -1811,12 +2008,12 @@ type UnionExampleResponse struct { JSON200 *UnionExample200JSONResponseBody } -// GetApplicationalternativeJSON200 returns ApplicationalternativeJSON200 +// GetApplicationalternativeJSON200 returns the response for an HTTP 200 `application/alternative+json` response func (r UnionExampleResponse) GetApplicationalternativeJSON200() *Example { return r.ApplicationalternativeJSON200 } -// GetJSON200 returns JSON200 +// GetJSON200 returns the response for an HTTP 200 `application/json` response func (r UnionExampleResponse) GetJSON200() *UnionExample200JSONResponseBody { return r.JSON200 } @@ -1850,7 +2047,11 @@ func (r UnionExampleResponse) ContentType() string { return "" } -// JSONExampleWithBodyWithResponse request with arbitrary body returning *JSONExampleResponse +// JSONExampleWithBodyWithResponse performs a POST /json (the `JSONExample` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) JSONExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*JSONExampleResponse, error) { rsp, err := c.JSONExampleWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -1859,6 +2060,8 @@ func (c *ClientWithResponses) JSONExampleWithBodyWithResponse(ctx context.Contex return ParseJSONExampleResponse(rsp) } +// JSONExampleWithResponse performs a POST /json (the `JSONExample` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) JSONExampleWithResponse(ctx context.Context, body JSONExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*JSONExampleResponse, error) { rsp, err := c.JSONExample(ctx, body, reqEditors...) if err != nil { @@ -1867,7 +2070,11 @@ func (c *ClientWithResponses) JSONExampleWithResponse(ctx context.Context, body return ParseJSONExampleResponse(rsp) } -// MultipartExampleWithBodyWithResponse request with arbitrary body returning *MultipartExampleResponse +// MultipartExampleWithBodyWithResponse performs a POST /multipart (the `MultipartExample` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) MultipartExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MultipartExampleResponse, error) { rsp, err := c.MultipartExampleWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -1876,7 +2083,11 @@ func (c *ClientWithResponses) MultipartExampleWithBodyWithResponse(ctx context.C return ParseMultipartExampleResponse(rsp) } -// MultipartRelatedExampleWithBodyWithResponse request with arbitrary body returning *MultipartRelatedExampleResponse +// MultipartRelatedExampleWithBodyWithResponse performs a POST /multipart-related (the `MultipartRelatedExample` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) MultipartRelatedExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MultipartRelatedExampleResponse, error) { rsp, err := c.MultipartRelatedExampleWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -1885,7 +2096,11 @@ func (c *ClientWithResponses) MultipartRelatedExampleWithBodyWithResponse(ctx co return ParseMultipartRelatedExampleResponse(rsp) } -// MultipleRequestAndResponseTypesWithBodyWithResponse request with arbitrary body returning *MultipleRequestAndResponseTypesResponse +// MultipleRequestAndResponseTypesWithBodyWithResponse performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) MultipleRequestAndResponseTypesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MultipleRequestAndResponseTypesResponse, error) { rsp, err := c.MultipleRequestAndResponseTypesWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -1894,6 +2109,8 @@ func (c *ClientWithResponses) MultipleRequestAndResponseTypesWithBodyWithRespons return ParseMultipleRequestAndResponseTypesResponse(rsp) } +// MultipleRequestAndResponseTypesWithResponse performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) MultipleRequestAndResponseTypesWithResponse(ctx context.Context, body MultipleRequestAndResponseTypesJSONRequestBody, reqEditors ...RequestEditorFn) (*MultipleRequestAndResponseTypesResponse, error) { rsp, err := c.MultipleRequestAndResponseTypes(ctx, body, reqEditors...) if err != nil { @@ -1902,6 +2119,8 @@ func (c *ClientWithResponses) MultipleRequestAndResponseTypesWithResponse(ctx co return ParseMultipleRequestAndResponseTypesResponse(rsp) } +// MultipleRequestAndResponseTypesWithResponse performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, +// Takes a body of the `application/x-www-form-urlencoded` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) MultipleRequestAndResponseTypesWithFormdataBodyWithResponse(ctx context.Context, body MultipleRequestAndResponseTypesFormdataRequestBody, reqEditors ...RequestEditorFn) (*MultipleRequestAndResponseTypesResponse, error) { rsp, err := c.MultipleRequestAndResponseTypesWithFormdataBody(ctx, body, reqEditors...) if err != nil { @@ -1910,6 +2129,8 @@ func (c *ClientWithResponses) MultipleRequestAndResponseTypesWithFormdataBodyWit return ParseMultipleRequestAndResponseTypesResponse(rsp) } +// MultipleRequestAndResponseTypesWithResponse performs a POST /multiple (the `MultipleRequestAndResponseTypes` operationId) request, +// Takes a body of the `text/plain` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) MultipleRequestAndResponseTypesWithTextBodyWithResponse(ctx context.Context, body MultipleRequestAndResponseTypesTextRequestBody, reqEditors ...RequestEditorFn) (*MultipleRequestAndResponseTypesResponse, error) { rsp, err := c.MultipleRequestAndResponseTypesWithTextBody(ctx, body, reqEditors...) if err != nil { @@ -1918,7 +2139,10 @@ func (c *ClientWithResponses) MultipleRequestAndResponseTypesWithTextBodyWithRes return ParseMultipleRequestAndResponseTypesResponse(rsp) } -// NoContentHeadersWithResponse request returning *NoContentHeadersResponse +// NoContentHeadersWithResponse performs a POST /no-content-headers (the `NoContentHeaders` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) NoContentHeadersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*NoContentHeadersResponse, error) { rsp, err := c.NoContentHeaders(ctx, reqEditors...) if err != nil { @@ -1927,7 +2151,11 @@ func (c *ClientWithResponses) NoContentHeadersWithResponse(ctx context.Context, return ParseNoContentHeadersResponse(rsp) } -// RequiredJSONBodyWithBodyWithResponse request with arbitrary body returning *RequiredJSONBodyResponse +// RequiredJSONBodyWithBodyWithResponse performs a POST /required-json-body (the `RequiredJSONBody` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) RequiredJSONBodyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequiredJSONBodyResponse, error) { rsp, err := c.RequiredJSONBodyWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -1936,6 +2164,8 @@ func (c *ClientWithResponses) RequiredJSONBodyWithBodyWithResponse(ctx context.C return ParseRequiredJSONBodyResponse(rsp) } +// RequiredJSONBodyWithResponse performs a POST /required-json-body (the `RequiredJSONBody` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) RequiredJSONBodyWithResponse(ctx context.Context, body RequiredJSONBodyJSONRequestBody, reqEditors ...RequestEditorFn) (*RequiredJSONBodyResponse, error) { rsp, err := c.RequiredJSONBody(ctx, body, reqEditors...) if err != nil { @@ -1944,7 +2174,11 @@ func (c *ClientWithResponses) RequiredJSONBodyWithResponse(ctx context.Context, return ParseRequiredJSONBodyResponse(rsp) } -// RequiredTextBodyWithBodyWithResponse request with arbitrary body returning *RequiredTextBodyResponse +// RequiredTextBodyWithBodyWithResponse performs a POST /required-text-body (the `RequiredTextBody` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) RequiredTextBodyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequiredTextBodyResponse, error) { rsp, err := c.RequiredTextBodyWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -1953,6 +2187,8 @@ func (c *ClientWithResponses) RequiredTextBodyWithBodyWithResponse(ctx context.C return ParseRequiredTextBodyResponse(rsp) } +// RequiredTextBodyWithResponse performs a POST /required-text-body (the `RequiredTextBody` operationId) request, +// Takes a body of the `text/plain` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) RequiredTextBodyWithTextBodyWithResponse(ctx context.Context, body RequiredTextBodyTextRequestBody, reqEditors ...RequestEditorFn) (*RequiredTextBodyResponse, error) { rsp, err := c.RequiredTextBodyWithTextBody(ctx, body, reqEditors...) if err != nil { @@ -1961,7 +2197,10 @@ func (c *ClientWithResponses) RequiredTextBodyWithTextBodyWithResponse(ctx conte return ParseRequiredTextBodyResponse(rsp) } -// ReservedGoKeywordParametersWithResponse request returning *ReservedGoKeywordParametersResponse +// ReservedGoKeywordParametersWithResponse performs a GET /reserved-go-keyword-parameters/{type} (the `ReservedGoKeywordParameters` operationId) request. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) ReservedGoKeywordParametersWithResponse(ctx context.Context, pType string, reqEditors ...RequestEditorFn) (*ReservedGoKeywordParametersResponse, error) { rsp, err := c.ReservedGoKeywordParameters(ctx, pType, reqEditors...) if err != nil { @@ -1970,7 +2209,11 @@ func (c *ClientWithResponses) ReservedGoKeywordParametersWithResponse(ctx contex return ParseReservedGoKeywordParametersResponse(rsp) } -// ReusableResponsesWithBodyWithResponse request with arbitrary body returning *ReusableResponsesResponse +// ReusableResponsesWithBodyWithResponse performs a POST /reusable-responses (the `ReusableResponses` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) ReusableResponsesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReusableResponsesResponse, error) { rsp, err := c.ReusableResponsesWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -1979,6 +2222,8 @@ func (c *ClientWithResponses) ReusableResponsesWithBodyWithResponse(ctx context. return ParseReusableResponsesResponse(rsp) } +// ReusableResponsesWithResponse performs a POST /reusable-responses (the `ReusableResponses` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) ReusableResponsesWithResponse(ctx context.Context, body ReusableResponsesJSONRequestBody, reqEditors ...RequestEditorFn) (*ReusableResponsesResponse, error) { rsp, err := c.ReusableResponses(ctx, body, reqEditors...) if err != nil { @@ -1987,7 +2232,11 @@ func (c *ClientWithResponses) ReusableResponsesWithResponse(ctx context.Context, return ParseReusableResponsesResponse(rsp) } -// TextExampleWithBodyWithResponse request with arbitrary body returning *TextExampleResponse +// TextExampleWithBodyWithResponse performs a POST /text (the `TextExample` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) TextExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TextExampleResponse, error) { rsp, err := c.TextExampleWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -1996,6 +2245,8 @@ func (c *ClientWithResponses) TextExampleWithBodyWithResponse(ctx context.Contex return ParseTextExampleResponse(rsp) } +// TextExampleWithResponse performs a POST /text (the `TextExample` operationId) request, +// Takes a body of the `text/plain` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) TextExampleWithTextBodyWithResponse(ctx context.Context, body TextExampleTextRequestBody, reqEditors ...RequestEditorFn) (*TextExampleResponse, error) { rsp, err := c.TextExampleWithTextBody(ctx, body, reqEditors...) if err != nil { @@ -2004,7 +2255,11 @@ func (c *ClientWithResponses) TextExampleWithTextBodyWithResponse(ctx context.Co return ParseTextExampleResponse(rsp) } -// UnknownExampleWithBodyWithResponse request with arbitrary body returning *UnknownExampleResponse +// UnknownExampleWithBodyWithResponse performs a POST /unknown (the `UnknownExample` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) UnknownExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UnknownExampleResponse, error) { rsp, err := c.UnknownExampleWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2013,7 +2268,11 @@ func (c *ClientWithResponses) UnknownExampleWithBodyWithResponse(ctx context.Con return ParseUnknownExampleResponse(rsp) } -// UnspecifiedContentTypeWithBodyWithResponse request with arbitrary body returning *UnspecifiedContentTypeResponse +// UnspecifiedContentTypeWithBodyWithResponse performs a POST /unspecified-content-type (the `UnspecifiedContentType` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) UnspecifiedContentTypeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UnspecifiedContentTypeResponse, error) { rsp, err := c.UnspecifiedContentTypeWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2022,7 +2281,11 @@ func (c *ClientWithResponses) UnspecifiedContentTypeWithBodyWithResponse(ctx con return ParseUnspecifiedContentTypeResponse(rsp) } -// URLEncodedExampleWithBodyWithResponse request with arbitrary body returning *URLEncodedExampleResponse +// URLEncodedExampleWithBodyWithResponse performs a POST /urlencoded (the `URLEncodedExample` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) URLEncodedExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*URLEncodedExampleResponse, error) { rsp, err := c.URLEncodedExampleWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2031,6 +2294,8 @@ func (c *ClientWithResponses) URLEncodedExampleWithBodyWithResponse(ctx context. return ParseURLEncodedExampleResponse(rsp) } +// URLEncodedExampleWithResponse performs a POST /urlencoded (the `URLEncodedExample` operationId) request, +// Takes a body of the `application/x-www-form-urlencoded` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) URLEncodedExampleWithFormdataBodyWithResponse(ctx context.Context, body URLEncodedExampleFormdataRequestBody, reqEditors ...RequestEditorFn) (*URLEncodedExampleResponse, error) { rsp, err := c.URLEncodedExampleWithFormdataBody(ctx, body, reqEditors...) if err != nil { @@ -2039,7 +2304,11 @@ func (c *ClientWithResponses) URLEncodedExampleWithFormdataBodyWithResponse(ctx return ParseURLEncodedExampleResponse(rsp) } -// HeadersExampleWithBodyWithResponse request with arbitrary body returning *HeadersExampleResponse +// HeadersExampleWithBodyWithResponse performs a POST /with-headers (the `HeadersExample` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) HeadersExampleWithBodyWithResponse(ctx context.Context, params *HeadersExampleParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HeadersExampleResponse, error) { rsp, err := c.HeadersExampleWithBody(ctx, params, contentType, body, reqEditors...) if err != nil { @@ -2048,6 +2317,8 @@ func (c *ClientWithResponses) HeadersExampleWithBodyWithResponse(ctx context.Con return ParseHeadersExampleResponse(rsp) } +// HeadersExampleWithResponse performs a POST /with-headers (the `HeadersExample` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) HeadersExampleWithResponse(ctx context.Context, params *HeadersExampleParams, body HeadersExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*HeadersExampleResponse, error) { rsp, err := c.HeadersExample(ctx, params, body, reqEditors...) if err != nil { @@ -2056,7 +2327,11 @@ func (c *ClientWithResponses) HeadersExampleWithResponse(ctx context.Context, pa return ParseHeadersExampleResponse(rsp) } -// UnionExampleWithBodyWithResponse request with arbitrary body returning *UnionExampleResponse +// UnionExampleWithBodyWithResponse performs a POST /with-union (the `UnionExample` operationId) request, +// with any type of body and a specified content type. +// +// Returns a wrapper object for the known response body format(s). + func (c *ClientWithResponses) UnionExampleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UnionExampleResponse, error) { rsp, err := c.UnionExampleWithBody(ctx, contentType, body, reqEditors...) if err != nil { @@ -2065,6 +2340,8 @@ func (c *ClientWithResponses) UnionExampleWithBodyWithResponse(ctx context.Conte return ParseUnionExampleResponse(rsp) } +// UnionExampleWithResponse performs a POST /with-union (the `UnionExample` operationId) request, +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). func (c *ClientWithResponses) UnionExampleWithResponse(ctx context.Context, body UnionExampleJSONRequestBody, reqEditors ...RequestEditorFn) (*UnionExampleResponse, error) { rsp, err := c.UnionExample(ctx, body, reqEditors...) if err != nil { diff --git a/pkg/codegen/operations.go b/pkg/codegen/operations.go index 736a8ea1b5..705ca1f347 100644 --- a/pkg/codegen/operations.go +++ b/pkg/codegen/operations.go @@ -400,16 +400,63 @@ func (o *OperationDefinition) HasBody() bool { return o.Spec.RequestBody != nil } -// SummaryAsComment returns the Operations summary as a multi line comment -func (o *OperationDefinition) SummaryAsComment() string { +// SummaryAsComment returns the Operations summary as a Godoc-style multi line comment +func (o *OperationDefinition) SummaryAsComment(prefix string) string { if o.Summary == "" { return "" } trimmed := strings.TrimSuffix(o.Summary, "\n") parts := strings.Split(trimmed, "\n") for i, p := range parts { - parts[i] = "// " + p + if i == 0 && prefix != "" { + parts[i] = "// " + prefix + " " + p + } else { + parts[i] = "// " + p + } + } + return strings.Join(parts, "\n") +} + +// ???? +func (o OperationDefinition) GenerateFunctionComment(originalFunctionName string, functionSuffix string, isFunctionWithResponses bool) string { + functionName := originalFunctionName + functionSuffix + var parts []string + if summary := o.SummaryAsComment(functionName); summary != "" { + parts = append(parts, strings.Split(summary, "\n")...) + parts = append(parts, "//") + if o.HasBody() { + if isFunctionWithResponses { + parts = append(parts, "// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).") + parts = append(parts, "//") + } else { + parts = append(parts, "// Takes any type of body and a specified content type.") + parts = append(parts, "//") + } + } else { + if isFunctionWithResponses { + parts = append(parts, "// Returns a wrapper object for the known response body format(s).") + parts = append(parts, "//") + } + } + parts = append(parts, "// Corresponds with "+o.Method+" "+o.Path+" (the `"+o.OperationId+"` operationId).") + } else { + if o.HasBody() { + parts = append(parts, "// "+functionName+" performs a "+o.Method+" "+o.Path+" (the `"+o.OperationId+"` operationId) request,") + parts = append(parts, "// with any type of body and a specified content type.") + } else { + parts = append(parts, "// "+functionName+" performs a "+o.Method+" "+o.Path+" (the `"+o.OperationId+"` operationId) request.") + } + if isFunctionWithResponses { + parts = append(parts, "//") + parts = append(parts, "// Returns a wrapper object for the known response body format(s).") + } } + + // make sure that each line is sanitised + for i, part := range parts { + parts[i] = stripNewLines(part) + } + return strings.Join(parts, "\n") } @@ -560,6 +607,38 @@ type RequestBodyDefinition struct { Encoding map[string]RequestBodyEncoding } +// **??** +// For example, **??** +func (r RequestBodyDefinition) GenerateFunctionComment(originalFunctionName string, parent OperationDefinition, functionSuffix string, isFunctionWithResponses bool) string { + functionName := originalFunctionName + functionSuffix + var parts []string + if summary := parent.SummaryAsComment(functionName); summary != "" { + parts = append(parts, strings.Split(summary, "\n")...) + parts = append(parts, "//") + if isFunctionWithResponses { + parts = append(parts, "// Takes a body for the `"+r.ContentType+"` content type, and returns a wrapper object for the known response body format(s).") + } else { + parts = append(parts, "// Takes a body of the `"+r.ContentType+"` content type.") + } + parts = append(parts, "//") + parts = append(parts, "// Corresponds with "+parent.Method+" "+parent.Path+" (the `"+parent.OperationId+"` operationId).") + } else { + parts = append(parts, "// "+functionName+" performs a "+parent.Method+" "+parent.Path+" (the `"+parent.OperationId+"` operationId) request,") + if isFunctionWithResponses { + parts = append(parts, "// Takes a body of the `"+r.ContentType+"` content type, and returns a wrapper object for the known response body format(s).") + } else { + parts = append(parts, "// Takes a body for the `"+r.ContentType+"` content type.") + } + } + + // make sure that each line is sanitised + for i, part := range parts { + parts[i] = stripNewLines(part) + } + + return strings.Join(parts, "\n") +} + // TypeDef returns the Go type definition for a request body func (r RequestBodyDefinition) TypeDef(opID string) *TypeDefinition { return &TypeDefinition{ diff --git a/pkg/codegen/templates/chi/chi-interface.tmpl b/pkg/codegen/templates/chi/chi-interface.tmpl index bec8452e75..459991c36c 100644 --- a/pkg/codegen/templates/chi/chi-interface.tmpl +++ b/pkg/codegen/templates/chi/chi-interface.tmpl @@ -1,6 +1,6 @@ // ServerInterface represents all server handlers. type ServerInterface interface { -{{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} +{{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) {{.OperationId}}(w http.ResponseWriter, r *http.Request{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}) {{end}}{{end}} @@ -9,7 +9,7 @@ type ServerInterface interface { // Unimplemented server implementation that returns http.StatusNotImplemented for each endpoint. type Unimplemented struct {} - {{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} + {{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) func (_ Unimplemented) {{.OperationId}}(w http.ResponseWriter, r *http.Request{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}) { w.WriteHeader(http.StatusNotImplemented) diff --git a/pkg/codegen/templates/client-with-responses.tmpl b/pkg/codegen/templates/client-with-responses.tmpl index b2c9546639..45d2105412 100644 --- a/pkg/codegen/templates/client-with-responses.tmpl +++ b/pkg/codegen/templates/client-with-responses.tmpl @@ -33,10 +33,20 @@ type ClientWithResponsesInterface interface { {{$hasParams := .RequiresParamObject -}} {{$pathParams := .PathParams -}} {{$opid := .OperationId -}} - // {{$opid}}{{if .HasBody}}WithBody{{end}}WithResponse request{{if .HasBody}} with any body{{end}} +{{$parent := . }} +{{$opidSuffix := ""}} +{{- if .HasBody -}} +{{- $opidSuffix = "WithBody" -}} +{{- end -}} + {{ if .HasBody }} + {{ .GenerateFunctionComment $opid "WithBodyWithResponse" true }} + {{ else }} + {{ .GenerateFunctionComment $opid "WithResponse" true }} + {{ end }} {{$opid}}{{if .HasBody}}WithBody{{end}}WithResponse(ctx context.Context{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params *{{$opid}}Params{{end}}{{if .HasBody}}, contentType string, body io.Reader{{end}}, reqEditors... RequestEditorFn) (*{{genResponseTypeName $opid}}, error) {{range .Bodies}} {{if .IsSupportedByClient -}} + {{ .GenerateFunctionComment $opid $parent "WithResponse" true }} {{$opid}}{{.Suffix}}WithResponse(ctx context.Context{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}, body {{$opid}}{{.NameTag}}RequestBody, reqEditors... RequestEditorFn) (*{{genResponseTypeName $opid}}, error) {{end -}} {{end}}{{/* range .Bodies */}} @@ -55,7 +65,7 @@ type {{genResponseTypeName $opid | ucFirst}} struct { {{ if not opts.OutputOptions.SkipResponseBodyGetters }} {{- range $responseTypeDefinitions}} - // Get{{.TypeName}} returns {{.TypeName}} + // Get{{.TypeName}} returns the response for an HTTP {{ .ResponseName }} `{{ .ContentTypeName }}` response func (r {{genResponseTypeName $opid | ucFirst}}) Get{{.TypeName}}() *{{.Schema.TypeDecl}} { return r.{{.TypeName}} } @@ -105,9 +115,18 @@ func (r {{genResponseTypeName $opid | ucFirst}}) ContentType() string { {{range .}} {{$opid := .OperationId -}} +{{$parent := . }} +{{$opidSuffix := ""}} +{{- if .HasBody -}} +{{- $opidSuffix = "WithBody" -}} +{{- end -}} {{/* Generate client methods (with responses)*/}} -// {{$opid}}{{if .HasBody}}WithBody{{end}}WithResponse request{{if .HasBody}} with arbitrary body{{end}} returning *{{genResponseTypeName $opid}} +{{ if .HasBody }} + {{ .GenerateFunctionComment $opid "WithBodyWithResponse" true }} +{{ else }} + {{ .GenerateFunctionComment $opid "WithResponse" true }} +{{ end }} func (c *ClientWithResponses) {{$opid}}{{if .HasBody}}WithBody{{end}}WithResponse(ctx context.Context{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params *{{$opid}}Params{{end}}{{if .HasBody}}, contentType string, body io.Reader{{end}}, reqEditors... RequestEditorFn) (*{{genResponseTypeName $opid}}, error){ rsp, err := c.{{$opid}}{{if .HasBody}}WithBody{{end}}(ctx{{genParamNames .PathParams}}{{if .RequiresParamObject}}, params{{end}}{{if .HasBody}}, contentType, body{{end}}, reqEditors...) if err != nil { @@ -121,6 +140,7 @@ func (c *ClientWithResponses) {{$opid}}{{if .HasBody}}WithBody{{end}}WithRespons {{$bodyRequired := .BodyRequired -}} {{range .Bodies}} {{if .IsSupportedByClient -}} +{{ .GenerateFunctionComment $opid $parent "WithResponse" true }} func (c *ClientWithResponses) {{$opid}}{{.Suffix}}WithResponse(ctx context.Context{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}, body {{$opid}}{{.NameTag}}RequestBody, reqEditors... RequestEditorFn) (*{{genResponseTypeName $opid}}, error) { rsp, err := c.{{$opid}}{{.Suffix}}(ctx{{genParamNames $pathParams}}{{if $hasParams}}, params{{end}}, body, reqEditors...) if err != nil { diff --git a/pkg/codegen/templates/client.tmpl b/pkg/codegen/templates/client.tmpl index 1f02997e1f..6f58cc450b 100644 --- a/pkg/codegen/templates/client.tmpl +++ b/pkg/codegen/templates/client.tmpl @@ -1,4 +1,4 @@ -// RequestEditorFn is the function signature for the RequestEditor callback function +// RequestEditorFn is the function signature for the RequestEditor callback function type RequestEditorFn func(ctx context.Context, req *http.Request) error // Doer performs HTTP requests. @@ -77,10 +77,20 @@ type ClientInterface interface { {{$hasParams := .RequiresParamObject -}} {{$pathParams := .PathParams -}} {{$opid := .OperationId -}} - // {{$opid}}{{if .HasBody}}WithBody{{end}} request{{if .HasBody}} with any body{{end}} +{{$opidSuffix := ""}} +{{$parent := . }} +{{- if .HasBody -}} +{{- $opidSuffix = "WithBody" -}} +{{- end -}} + {{ if .HasBody }} + {{ .GenerateFunctionComment $opid "WithBody" false }} + {{ else }} + {{ .GenerateFunctionComment $opid "" false }} + {{ end }} {{$opid}}{{if .HasBody}}WithBody{{end}}(ctx context.Context{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}{{if .HasBody}}, contentType string, body io.Reader{{end}}, reqEditors... RequestEditorFn) (*http.Response, error) {{range .Bodies}} {{if .IsSupportedByClient -}} + {{ .GenerateFunctionComment $opid $parent "" false }} {{$opid}}{{.Suffix}}(ctx context.Context{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}, body {{$opid}}{{.NameTag}}RequestBody, reqEditors... RequestEditorFn) (*http.Response, error) {{end -}} {{end}}{{/* range .Bodies */}} @@ -93,7 +103,17 @@ type ClientInterface interface { {{$hasParams := .RequiresParamObject -}} {{$pathParams := .PathParams -}} {{$opid := .OperationId -}} +{{$parent := . }} +{{$opidSuffix := ""}} +{{- if .HasBody -}} +{{- $opidSuffix = "WithBody" -}} +{{- end -}} +{{ if .HasBody }} + {{ .GenerateFunctionComment $opid "WithBody" false }} +{{ else }} + {{ .GenerateFunctionComment $opid "" false }} +{{ end }} func (c *{{ $clientTypeName }}) {{$opid}}{{if .HasBody}}WithBody{{end}}(ctx context.Context{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}{{if .HasBody}}, contentType string, body io.Reader{{end}}, reqEditors... RequestEditorFn) (*http.Response, error) { req, err := New{{$opid}}Request{{if .HasBody}}WithBody{{end}}(c.Server{{genParamNames .PathParams}}{{if $hasParams}}, params{{end}}{{if .HasBody}}, contentType, body{{end}}) if err != nil { @@ -108,6 +128,7 @@ func (c *{{ $clientTypeName }}) {{$opid}}{{if .HasBody}}WithBody{{end}}(ctx cont {{range .Bodies}} {{if .IsSupportedByClient -}} +{{ .GenerateFunctionComment $opid $parent "" false }} func (c *{{ $clientTypeName }}) {{$opid}}{{.Suffix}}(ctx context.Context{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}, body {{$opid}}{{.NameTag}}RequestBody, reqEditors... RequestEditorFn) (*http.Response, error) { req, err := New{{$opid}}Request{{.Suffix}}(c.Server{{genParamNames $pathParams}}{{if $hasParams}}, params{{end}}, body) if err != nil { @@ -163,7 +184,7 @@ func New{{$opid}}Request{{.Suffix}}(server string{{genParamArgs $pathParams}}{{i {{end -}} {{end}} -// New{{$opid}}Request{{if .HasBody}}WithBody{{end}} generates requests for {{$opid}}{{if .HasBody}} with any type of body{{end}} +// New{{$opid}}Request{{if .HasBody}}WithBody{{end}} constructs an http.Request for the {{$opid}} method{{if .HasBody}}, with any body, and a specified content type{{end}} func New{{$opid}}Request{{if .HasBody}}WithBody{{end}}(server string{{genParamArgs $pathParams}}{{if $hasParams}}, params *{{$opid}}Params{{end}}{{if .HasBody}}, contentType string, body io.Reader{{end}}) (*http.Request, error) { var err error {{range $paramIdx, $param := .PathParams}} diff --git a/pkg/codegen/templates/echo/echo-interface.tmpl b/pkg/codegen/templates/echo/echo-interface.tmpl index 6834432709..01497ab82f 100644 --- a/pkg/codegen/templates/echo/echo-interface.tmpl +++ b/pkg/codegen/templates/echo/echo-interface.tmpl @@ -1,6 +1,6 @@ // ServerInterface represents all server handlers. type ServerInterface interface { -{{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} +{{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) {{.OperationId}}(ctx echo.Context{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}) error {{end}}{{end}} diff --git a/pkg/codegen/templates/echo/v5/echo-interface.tmpl b/pkg/codegen/templates/echo/v5/echo-interface.tmpl index 6d5b874bed..a62a48e8d4 100644 --- a/pkg/codegen/templates/echo/v5/echo-interface.tmpl +++ b/pkg/codegen/templates/echo/v5/echo-interface.tmpl @@ -1,6 +1,6 @@ // ServerInterface represents all server handlers. type ServerInterface interface { -{{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} +{{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) {{.OperationId}}(ctx *echo.Context{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}) error {{end}}{{end}} diff --git a/pkg/codegen/templates/fiber/fiber-interface.tmpl b/pkg/codegen/templates/fiber/fiber-interface.tmpl index 4459e8b0d6..4adad703a1 100644 --- a/pkg/codegen/templates/fiber/fiber-interface.tmpl +++ b/pkg/codegen/templates/fiber/fiber-interface.tmpl @@ -1,6 +1,6 @@ // ServerInterface represents all server handlers. type ServerInterface interface { -{{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} +{{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) {{.OperationId}}(c *fiber.Ctx{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}) error {{end}}{{end}} diff --git a/pkg/codegen/templates/gin/gin-interface.tmpl b/pkg/codegen/templates/gin/gin-interface.tmpl index dec255e713..47a51497da 100644 --- a/pkg/codegen/templates/gin/gin-interface.tmpl +++ b/pkg/codegen/templates/gin/gin-interface.tmpl @@ -1,6 +1,6 @@ // ServerInterface represents all server handlers. type ServerInterface interface { -{{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} +{{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) {{.OperationId}}(c *gin.Context{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}) {{end}}{{end}} diff --git a/pkg/codegen/templates/gorilla/gorilla-interface.tmpl b/pkg/codegen/templates/gorilla/gorilla-interface.tmpl index 04baa51e39..7c5e2833b4 100644 --- a/pkg/codegen/templates/gorilla/gorilla-interface.tmpl +++ b/pkg/codegen/templates/gorilla/gorilla-interface.tmpl @@ -1,6 +1,6 @@ // ServerInterface represents all server handlers. type ServerInterface interface { -{{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} +{{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) {{.OperationId}}(w http.ResponseWriter, r *http.Request{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}) {{end}}{{end}} diff --git a/pkg/codegen/templates/iris/iris-interface.tmpl b/pkg/codegen/templates/iris/iris-interface.tmpl index 78f401ec2c..69bd08ae7e 100644 --- a/pkg/codegen/templates/iris/iris-interface.tmpl +++ b/pkg/codegen/templates/iris/iris-interface.tmpl @@ -1,6 +1,6 @@ // ServerInterface represents all server handlers. type ServerInterface interface { -{{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} +{{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) {{.OperationId}}(ctx iris.Context{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}) {{end}}{{end}} diff --git a/pkg/codegen/templates/stdhttp/std-http-interface.tmpl b/pkg/codegen/templates/stdhttp/std-http-interface.tmpl index 04baa51e39..7c5e2833b4 100644 --- a/pkg/codegen/templates/stdhttp/std-http-interface.tmpl +++ b/pkg/codegen/templates/stdhttp/std-http-interface.tmpl @@ -1,6 +1,6 @@ // ServerInterface represents all server handlers. type ServerInterface interface { -{{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} +{{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) {{.OperationId}}(w http.ResponseWriter, r *http.Request{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}) {{end}}{{end}} diff --git a/pkg/codegen/templates/strict/strict-fiber-interface.tmpl b/pkg/codegen/templates/strict/strict-fiber-interface.tmpl index a88607a88b..5f236ebd4c 100644 --- a/pkg/codegen/templates/strict/strict-fiber-interface.tmpl +++ b/pkg/codegen/templates/strict/strict-fiber-interface.tmpl @@ -192,7 +192,7 @@ // StrictServerInterface represents all server handlers. type StrictServerInterface interface { -{{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} +{{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) {{$opid := .OperationId -}} {{$opid}}(ctx context.Context, request {{$opid | ucFirst}}RequestObject) ({{$opid | ucFirst}}ResponseObject, error) diff --git a/pkg/codegen/templates/strict/strict-interface.tmpl b/pkg/codegen/templates/strict/strict-interface.tmpl index 206cc88bd1..ac9ebf66ac 100644 --- a/pkg/codegen/templates/strict/strict-interface.tmpl +++ b/pkg/codegen/templates/strict/strict-interface.tmpl @@ -231,7 +231,7 @@ // StrictServerInterface represents all server handlers. type StrictServerInterface interface { -{{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} +{{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) {{$opid := .OperationId -}} {{$opid}}(ctx context.Context, request {{$opid | ucFirst}}RequestObject) ({{$opid | ucFirst}}ResponseObject, error) diff --git a/pkg/codegen/templates/strict/strict-iris-interface.tmpl b/pkg/codegen/templates/strict/strict-iris-interface.tmpl index e48d7ab6d3..a8ff33adbd 100644 --- a/pkg/codegen/templates/strict/strict-iris-interface.tmpl +++ b/pkg/codegen/templates/strict/strict-iris-interface.tmpl @@ -193,7 +193,7 @@ // StrictServerInterface represents all server handlers. type StrictServerInterface interface { -{{range .}}{{if not .IsAlias}}{{.SummaryAsComment }} +{{range .}}{{if not .IsAlias}}{{.SummaryAsComment .OperationId }} // ({{.Method}} {{.Path}}) {{$opid := .OperationId -}} {{$opid}}(ctx context.Context, request {{$opid | ucFirst}}RequestObject) ({{$opid | ucFirst}}ResponseObject, error)