From 4398b7d8b6647a22973fbb0ffa8c5bbd59e1d2bd Mon Sep 17 00:00:00 2001 From: broadbot Date: Fri, 13 Oct 2023 19:09:12 +0000 Subject: [PATCH] [sherlock-build] generated from 192029f2bd3451ad0b7284f9988b31b207781d72 --- .../app_versions/app_versions_client.go | 62 ++-- .../put_api_app_versions_v3_parameters.go | 151 +++++++++ .../put_api_app_versions_v3_responses.go | 295 ++++++++++++++++++ .../chart_versions/chart_versions_client.go | 62 ++-- .../put_api_chart_versions_v3_parameters.go | 151 +++++++++ .../put_api_chart_versions_v3_responses.go | 295 ++++++++++++++++++ sherlock-typescript-client/README.md | 4 +- sherlock-typescript-client/package-lock.json | 4 +- sherlock-typescript-client/package.json | 2 +- .../src/apis/AppVersionsApi.ts | 12 +- .../src/apis/ChartVersionsApi.ts | 12 +- sherlock/docs/docs.go | 4 +- sherlock/docs/swagger.json | 4 +- sherlock/docs/swagger.yaml | 4 +- 14 files changed, 977 insertions(+), 85 deletions(-) create mode 100644 sherlock-go-client/client/app_versions/put_api_app_versions_v3_parameters.go create mode 100644 sherlock-go-client/client/app_versions/put_api_app_versions_v3_responses.go create mode 100644 sherlock-go-client/client/chart_versions/put_api_chart_versions_v3_parameters.go create mode 100644 sherlock-go-client/client/chart_versions/put_api_chart_versions_v3_responses.go diff --git a/sherlock-go-client/client/app_versions/app_versions_client.go b/sherlock-go-client/client/app_versions/app_versions_client.go index 4fdab4f19..05b92d45a 100644 --- a/sherlock-go-client/client/app_versions/app_versions_client.go +++ b/sherlock-go-client/client/app_versions/app_versions_client.go @@ -48,10 +48,10 @@ type ClientService interface { PatchAPIV2AppVersionsSelector(params *PatchAPIV2AppVersionsSelectorParams, opts ...ClientOption) (*PatchAPIV2AppVersionsSelectorOK, error) - PostAPIAppVersionsV3(params *PostAPIAppVersionsV3Params, opts ...ClientOption) (*PostAPIAppVersionsV3Created, error) - PostAPIV2AppVersions(params *PostAPIV2AppVersionsParams, opts ...ClientOption) (*PostAPIV2AppVersionsOK, *PostAPIV2AppVersionsCreated, error) + PutAPIAppVersionsV3(params *PutAPIAppVersionsV3Params, opts ...ClientOption) (*PutAPIAppVersionsV3Created, error) + PutAPIV2AppVersionsSelector(params *PutAPIV2AppVersionsSelectorParams, opts ...ClientOption) (*PutAPIV2AppVersionsSelectorOK, *PutAPIV2AppVersionsSelectorCreated, error) SetTransport(transport runtime.ClientTransport) @@ -419,24 +419,25 @@ func (a *Client) PatchAPIV2AppVersionsSelector(params *PatchAPIV2AppVersionsSele } /* - PostAPIAppVersionsV3 upserts a app version + PostAPIV2AppVersions creates a new app version entry - Upsert a AppVersion. + Create a new AppVersion entry. Note that fields are immutable after creation. +If the new entry is a duplicate of one already in the database, the database will not be altered and the call will return normally but with a 200 code. */ -func (a *Client) PostAPIAppVersionsV3(params *PostAPIAppVersionsV3Params, opts ...ClientOption) (*PostAPIAppVersionsV3Created, error) { +func (a *Client) PostAPIV2AppVersions(params *PostAPIV2AppVersionsParams, opts ...ClientOption) (*PostAPIV2AppVersionsOK, *PostAPIV2AppVersionsCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostAPIAppVersionsV3Params() + params = NewPostAPIV2AppVersionsParams() } op := &runtime.ClientOperation{ - ID: "PostAPIAppVersionsV3", + ID: "PostAPIV2AppVersions", Method: "POST", - PathPattern: "/api/app-versions/v3", + PathPattern: "/api/v2/app-versions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostAPIAppVersionsV3Reader{formats: a.formats}, + Reader: &PostAPIV2AppVersionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -446,38 +447,38 @@ func (a *Client) PostAPIAppVersionsV3(params *PostAPIAppVersionsV3Params, opts . result, err := a.transport.Submit(op) if err != nil { - return nil, err + return nil, nil, err } - success, ok := result.(*PostAPIAppVersionsV3Created) - if ok { - return success, nil + switch value := result.(type) { + case *PostAPIV2AppVersionsOK: + return value, nil, nil + case *PostAPIV2AppVersionsCreated: + return nil, value, nil } - // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for PostAPIAppVersionsV3: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for app_versions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - PostAPIV2AppVersions creates a new app version entry + PutAPIAppVersionsV3 upserts a app version - Create a new AppVersion entry. Note that fields are immutable after creation. -If the new entry is a duplicate of one already in the database, the database will not be altered and the call will return normally but with a 200 code. + Upsert a AppVersion. */ -func (a *Client) PostAPIV2AppVersions(params *PostAPIV2AppVersionsParams, opts ...ClientOption) (*PostAPIV2AppVersionsOK, *PostAPIV2AppVersionsCreated, error) { +func (a *Client) PutAPIAppVersionsV3(params *PutAPIAppVersionsV3Params, opts ...ClientOption) (*PutAPIAppVersionsV3Created, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostAPIV2AppVersionsParams() + params = NewPutAPIAppVersionsV3Params() } op := &runtime.ClientOperation{ - ID: "PostAPIV2AppVersions", - Method: "POST", - PathPattern: "/api/v2/app-versions", + ID: "PutAPIAppVersionsV3", + Method: "PUT", + PathPattern: "/api/app-versions/v3", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostAPIV2AppVersionsReader{formats: a.formats}, + Reader: &PutAPIAppVersionsV3Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -487,16 +488,15 @@ func (a *Client) PostAPIV2AppVersions(params *PostAPIV2AppVersionsParams, opts . result, err := a.transport.Submit(op) if err != nil { - return nil, nil, err + return nil, err } - switch value := result.(type) { - case *PostAPIV2AppVersionsOK: - return value, nil, nil - case *PostAPIV2AppVersionsCreated: - return nil, value, nil + success, ok := result.(*PutAPIAppVersionsV3Created) + if ok { + return success, nil } + // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for app_versions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for PutAPIAppVersionsV3: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/sherlock-go-client/client/app_versions/put_api_app_versions_v3_parameters.go b/sherlock-go-client/client/app_versions/put_api_app_versions_v3_parameters.go new file mode 100644 index 000000000..509311214 --- /dev/null +++ b/sherlock-go-client/client/app_versions/put_api_app_versions_v3_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package app_versions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/broadinstitute/sherlock/sherlock-go-client/client/models" +) + +// NewPutAPIAppVersionsV3Params creates a new PutAPIAppVersionsV3Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPutAPIAppVersionsV3Params() *PutAPIAppVersionsV3Params { + return &PutAPIAppVersionsV3Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutAPIAppVersionsV3ParamsWithTimeout creates a new PutAPIAppVersionsV3Params object +// with the ability to set a timeout on a request. +func NewPutAPIAppVersionsV3ParamsWithTimeout(timeout time.Duration) *PutAPIAppVersionsV3Params { + return &PutAPIAppVersionsV3Params{ + timeout: timeout, + } +} + +// NewPutAPIAppVersionsV3ParamsWithContext creates a new PutAPIAppVersionsV3Params object +// with the ability to set a context for a request. +func NewPutAPIAppVersionsV3ParamsWithContext(ctx context.Context) *PutAPIAppVersionsV3Params { + return &PutAPIAppVersionsV3Params{ + Context: ctx, + } +} + +// NewPutAPIAppVersionsV3ParamsWithHTTPClient creates a new PutAPIAppVersionsV3Params object +// with the ability to set a custom HTTPClient for a request. +func NewPutAPIAppVersionsV3ParamsWithHTTPClient(client *http.Client) *PutAPIAppVersionsV3Params { + return &PutAPIAppVersionsV3Params{ + HTTPClient: client, + } +} + +/* PutAPIAppVersionsV3Params contains all the parameters to send to the API endpoint + for the put API app versions v3 operation. + + Typically these are written to a http.Request. +*/ +type PutAPIAppVersionsV3Params struct { + + /* AppVersion. + + The AppVersion to upsert + */ + AppVersion *models.SherlockAppVersionV3Create + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put API app versions v3 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutAPIAppVersionsV3Params) WithDefaults() *PutAPIAppVersionsV3Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put API app versions v3 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutAPIAppVersionsV3Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put API app versions v3 params +func (o *PutAPIAppVersionsV3Params) WithTimeout(timeout time.Duration) *PutAPIAppVersionsV3Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put API app versions v3 params +func (o *PutAPIAppVersionsV3Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put API app versions v3 params +func (o *PutAPIAppVersionsV3Params) WithContext(ctx context.Context) *PutAPIAppVersionsV3Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put API app versions v3 params +func (o *PutAPIAppVersionsV3Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put API app versions v3 params +func (o *PutAPIAppVersionsV3Params) WithHTTPClient(client *http.Client) *PutAPIAppVersionsV3Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put API app versions v3 params +func (o *PutAPIAppVersionsV3Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAppVersion adds the appVersion to the put API app versions v3 params +func (o *PutAPIAppVersionsV3Params) WithAppVersion(appVersion *models.SherlockAppVersionV3Create) *PutAPIAppVersionsV3Params { + o.SetAppVersion(appVersion) + return o +} + +// SetAppVersion adds the appVersion to the put API app versions v3 params +func (o *PutAPIAppVersionsV3Params) SetAppVersion(appVersion *models.SherlockAppVersionV3Create) { + o.AppVersion = appVersion +} + +// WriteToRequest writes these params to a swagger request +func (o *PutAPIAppVersionsV3Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.AppVersion != nil { + if err := r.SetBodyParam(o.AppVersion); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/sherlock-go-client/client/app_versions/put_api_app_versions_v3_responses.go b/sherlock-go-client/client/app_versions/put_api_app_versions_v3_responses.go new file mode 100644 index 000000000..1372b25ff --- /dev/null +++ b/sherlock-go-client/client/app_versions/put_api_app_versions_v3_responses.go @@ -0,0 +1,295 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package app_versions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/broadinstitute/sherlock/sherlock-go-client/client/models" +) + +// PutAPIAppVersionsV3Reader is a Reader for the PutAPIAppVersionsV3 structure. +type PutAPIAppVersionsV3Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutAPIAppVersionsV3Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewPutAPIAppVersionsV3Created() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPutAPIAppVersionsV3BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutAPIAppVersionsV3Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutAPIAppVersionsV3NotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 407: + result := NewPutAPIAppVersionsV3ProxyAuthenticationRequired() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPutAPIAppVersionsV3Conflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutAPIAppVersionsV3InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutAPIAppVersionsV3Created creates a PutAPIAppVersionsV3Created with default headers values +func NewPutAPIAppVersionsV3Created() *PutAPIAppVersionsV3Created { + return &PutAPIAppVersionsV3Created{} +} + +/* PutAPIAppVersionsV3Created describes a response with status code 201, with default header values. + +Created +*/ +type PutAPIAppVersionsV3Created struct { + Payload *models.SherlockAppVersionV3 +} + +func (o *PutAPIAppVersionsV3Created) Error() string { + return fmt.Sprintf("[PUT /api/app-versions/v3][%d] putApiAppVersionsV3Created %+v", 201, o.Payload) +} +func (o *PutAPIAppVersionsV3Created) GetPayload() *models.SherlockAppVersionV3 { + return o.Payload +} + +func (o *PutAPIAppVersionsV3Created) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SherlockAppVersionV3) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIAppVersionsV3BadRequest creates a PutAPIAppVersionsV3BadRequest with default headers values +func NewPutAPIAppVersionsV3BadRequest() *PutAPIAppVersionsV3BadRequest { + return &PutAPIAppVersionsV3BadRequest{} +} + +/* PutAPIAppVersionsV3BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PutAPIAppVersionsV3BadRequest struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIAppVersionsV3BadRequest) Error() string { + return fmt.Sprintf("[PUT /api/app-versions/v3][%d] putApiAppVersionsV3BadRequest %+v", 400, o.Payload) +} +func (o *PutAPIAppVersionsV3BadRequest) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIAppVersionsV3BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIAppVersionsV3Forbidden creates a PutAPIAppVersionsV3Forbidden with default headers values +func NewPutAPIAppVersionsV3Forbidden() *PutAPIAppVersionsV3Forbidden { + return &PutAPIAppVersionsV3Forbidden{} +} + +/* PutAPIAppVersionsV3Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PutAPIAppVersionsV3Forbidden struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIAppVersionsV3Forbidden) Error() string { + return fmt.Sprintf("[PUT /api/app-versions/v3][%d] putApiAppVersionsV3Forbidden %+v", 403, o.Payload) +} +func (o *PutAPIAppVersionsV3Forbidden) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIAppVersionsV3Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIAppVersionsV3NotFound creates a PutAPIAppVersionsV3NotFound with default headers values +func NewPutAPIAppVersionsV3NotFound() *PutAPIAppVersionsV3NotFound { + return &PutAPIAppVersionsV3NotFound{} +} + +/* PutAPIAppVersionsV3NotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PutAPIAppVersionsV3NotFound struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIAppVersionsV3NotFound) Error() string { + return fmt.Sprintf("[PUT /api/app-versions/v3][%d] putApiAppVersionsV3NotFound %+v", 404, o.Payload) +} +func (o *PutAPIAppVersionsV3NotFound) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIAppVersionsV3NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIAppVersionsV3ProxyAuthenticationRequired creates a PutAPIAppVersionsV3ProxyAuthenticationRequired with default headers values +func NewPutAPIAppVersionsV3ProxyAuthenticationRequired() *PutAPIAppVersionsV3ProxyAuthenticationRequired { + return &PutAPIAppVersionsV3ProxyAuthenticationRequired{} +} + +/* PutAPIAppVersionsV3ProxyAuthenticationRequired describes a response with status code 407, with default header values. + +Proxy Authentication Required +*/ +type PutAPIAppVersionsV3ProxyAuthenticationRequired struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIAppVersionsV3ProxyAuthenticationRequired) Error() string { + return fmt.Sprintf("[PUT /api/app-versions/v3][%d] putApiAppVersionsV3ProxyAuthenticationRequired %+v", 407, o.Payload) +} +func (o *PutAPIAppVersionsV3ProxyAuthenticationRequired) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIAppVersionsV3ProxyAuthenticationRequired) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIAppVersionsV3Conflict creates a PutAPIAppVersionsV3Conflict with default headers values +func NewPutAPIAppVersionsV3Conflict() *PutAPIAppVersionsV3Conflict { + return &PutAPIAppVersionsV3Conflict{} +} + +/* PutAPIAppVersionsV3Conflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PutAPIAppVersionsV3Conflict struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIAppVersionsV3Conflict) Error() string { + return fmt.Sprintf("[PUT /api/app-versions/v3][%d] putApiAppVersionsV3Conflict %+v", 409, o.Payload) +} +func (o *PutAPIAppVersionsV3Conflict) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIAppVersionsV3Conflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIAppVersionsV3InternalServerError creates a PutAPIAppVersionsV3InternalServerError with default headers values +func NewPutAPIAppVersionsV3InternalServerError() *PutAPIAppVersionsV3InternalServerError { + return &PutAPIAppVersionsV3InternalServerError{} +} + +/* PutAPIAppVersionsV3InternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PutAPIAppVersionsV3InternalServerError struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIAppVersionsV3InternalServerError) Error() string { + return fmt.Sprintf("[PUT /api/app-versions/v3][%d] putApiAppVersionsV3InternalServerError %+v", 500, o.Payload) +} +func (o *PutAPIAppVersionsV3InternalServerError) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIAppVersionsV3InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/sherlock-go-client/client/chart_versions/chart_versions_client.go b/sherlock-go-client/client/chart_versions/chart_versions_client.go index 0414f8af6..1639e316f 100644 --- a/sherlock-go-client/client/chart_versions/chart_versions_client.go +++ b/sherlock-go-client/client/chart_versions/chart_versions_client.go @@ -48,10 +48,10 @@ type ClientService interface { PatchAPIV2ChartVersionsSelector(params *PatchAPIV2ChartVersionsSelectorParams, opts ...ClientOption) (*PatchAPIV2ChartVersionsSelectorOK, error) - PostAPIChartVersionsV3(params *PostAPIChartVersionsV3Params, opts ...ClientOption) (*PostAPIChartVersionsV3Created, error) - PostAPIV2ChartVersions(params *PostAPIV2ChartVersionsParams, opts ...ClientOption) (*PostAPIV2ChartVersionsOK, *PostAPIV2ChartVersionsCreated, error) + PutAPIChartVersionsV3(params *PutAPIChartVersionsV3Params, opts ...ClientOption) (*PutAPIChartVersionsV3Created, error) + PutAPIV2ChartVersionsSelector(params *PutAPIV2ChartVersionsSelectorParams, opts ...ClientOption) (*PutAPIV2ChartVersionsSelectorOK, *PutAPIV2ChartVersionsSelectorCreated, error) SetTransport(transport runtime.ClientTransport) @@ -419,24 +419,25 @@ func (a *Client) PatchAPIV2ChartVersionsSelector(params *PatchAPIV2ChartVersions } /* - PostAPIChartVersionsV3 upserts a chart version + PostAPIV2ChartVersions creates a new chart version entry - Upsert a ChartVersion. + Create a new ChartVersion entry. Note that fields are immutable after creation. +If the new entry is a duplicate of one already in the database, the database will not be altered and the call will return normally but with a 200 code. */ -func (a *Client) PostAPIChartVersionsV3(params *PostAPIChartVersionsV3Params, opts ...ClientOption) (*PostAPIChartVersionsV3Created, error) { +func (a *Client) PostAPIV2ChartVersions(params *PostAPIV2ChartVersionsParams, opts ...ClientOption) (*PostAPIV2ChartVersionsOK, *PostAPIV2ChartVersionsCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostAPIChartVersionsV3Params() + params = NewPostAPIV2ChartVersionsParams() } op := &runtime.ClientOperation{ - ID: "PostAPIChartVersionsV3", + ID: "PostAPIV2ChartVersions", Method: "POST", - PathPattern: "/api/chart-versions/v3", + PathPattern: "/api/v2/chart-versions", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostAPIChartVersionsV3Reader{formats: a.formats}, + Reader: &PostAPIV2ChartVersionsReader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -446,38 +447,38 @@ func (a *Client) PostAPIChartVersionsV3(params *PostAPIChartVersionsV3Params, op result, err := a.transport.Submit(op) if err != nil { - return nil, err + return nil, nil, err } - success, ok := result.(*PostAPIChartVersionsV3Created) - if ok { - return success, nil + switch value := result.(type) { + case *PostAPIV2ChartVersionsOK: + return value, nil, nil + case *PostAPIV2ChartVersionsCreated: + return nil, value, nil } - // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for PostAPIChartVersionsV3: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for chart_versions: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - PostAPIV2ChartVersions creates a new chart version entry + PutAPIChartVersionsV3 upserts a chart version - Create a new ChartVersion entry. Note that fields are immutable after creation. -If the new entry is a duplicate of one already in the database, the database will not be altered and the call will return normally but with a 200 code. + Upsert a ChartVersion. */ -func (a *Client) PostAPIV2ChartVersions(params *PostAPIV2ChartVersionsParams, opts ...ClientOption) (*PostAPIV2ChartVersionsOK, *PostAPIV2ChartVersionsCreated, error) { +func (a *Client) PutAPIChartVersionsV3(params *PutAPIChartVersionsV3Params, opts ...ClientOption) (*PutAPIChartVersionsV3Created, error) { // TODO: Validate the params before sending if params == nil { - params = NewPostAPIV2ChartVersionsParams() + params = NewPutAPIChartVersionsV3Params() } op := &runtime.ClientOperation{ - ID: "PostAPIV2ChartVersions", - Method: "POST", - PathPattern: "/api/v2/chart-versions", + ID: "PutAPIChartVersionsV3", + Method: "PUT", + PathPattern: "/api/chart-versions/v3", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"https"}, Params: params, - Reader: &PostAPIV2ChartVersionsReader{formats: a.formats}, + Reader: &PutAPIChartVersionsV3Reader{formats: a.formats}, Context: params.Context, Client: params.HTTPClient, } @@ -487,16 +488,15 @@ func (a *Client) PostAPIV2ChartVersions(params *PostAPIV2ChartVersionsParams, op result, err := a.transport.Submit(op) if err != nil { - return nil, nil, err + return nil, err } - switch value := result.(type) { - case *PostAPIV2ChartVersionsOK: - return value, nil, nil - case *PostAPIV2ChartVersionsCreated: - return nil, value, nil + success, ok := result.(*PutAPIChartVersionsV3Created) + if ok { + return success, nil } + // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for chart_versions: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for PutAPIChartVersionsV3: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/sherlock-go-client/client/chart_versions/put_api_chart_versions_v3_parameters.go b/sherlock-go-client/client/chart_versions/put_api_chart_versions_v3_parameters.go new file mode 100644 index 000000000..363bcb321 --- /dev/null +++ b/sherlock-go-client/client/chart_versions/put_api_chart_versions_v3_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package chart_versions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/broadinstitute/sherlock/sherlock-go-client/client/models" +) + +// NewPutAPIChartVersionsV3Params creates a new PutAPIChartVersionsV3Params object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPutAPIChartVersionsV3Params() *PutAPIChartVersionsV3Params { + return &PutAPIChartVersionsV3Params{ + timeout: cr.DefaultTimeout, + } +} + +// NewPutAPIChartVersionsV3ParamsWithTimeout creates a new PutAPIChartVersionsV3Params object +// with the ability to set a timeout on a request. +func NewPutAPIChartVersionsV3ParamsWithTimeout(timeout time.Duration) *PutAPIChartVersionsV3Params { + return &PutAPIChartVersionsV3Params{ + timeout: timeout, + } +} + +// NewPutAPIChartVersionsV3ParamsWithContext creates a new PutAPIChartVersionsV3Params object +// with the ability to set a context for a request. +func NewPutAPIChartVersionsV3ParamsWithContext(ctx context.Context) *PutAPIChartVersionsV3Params { + return &PutAPIChartVersionsV3Params{ + Context: ctx, + } +} + +// NewPutAPIChartVersionsV3ParamsWithHTTPClient creates a new PutAPIChartVersionsV3Params object +// with the ability to set a custom HTTPClient for a request. +func NewPutAPIChartVersionsV3ParamsWithHTTPClient(client *http.Client) *PutAPIChartVersionsV3Params { + return &PutAPIChartVersionsV3Params{ + HTTPClient: client, + } +} + +/* PutAPIChartVersionsV3Params contains all the parameters to send to the API endpoint + for the put API chart versions v3 operation. + + Typically these are written to a http.Request. +*/ +type PutAPIChartVersionsV3Params struct { + + /* ChartVersion. + + The ChartVersion to upsert + */ + ChartVersion *models.SherlockChartVersionV3Create + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the put API chart versions v3 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutAPIChartVersionsV3Params) WithDefaults() *PutAPIChartVersionsV3Params { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the put API chart versions v3 params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PutAPIChartVersionsV3Params) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the put API chart versions v3 params +func (o *PutAPIChartVersionsV3Params) WithTimeout(timeout time.Duration) *PutAPIChartVersionsV3Params { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the put API chart versions v3 params +func (o *PutAPIChartVersionsV3Params) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the put API chart versions v3 params +func (o *PutAPIChartVersionsV3Params) WithContext(ctx context.Context) *PutAPIChartVersionsV3Params { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the put API chart versions v3 params +func (o *PutAPIChartVersionsV3Params) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the put API chart versions v3 params +func (o *PutAPIChartVersionsV3Params) WithHTTPClient(client *http.Client) *PutAPIChartVersionsV3Params { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the put API chart versions v3 params +func (o *PutAPIChartVersionsV3Params) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithChartVersion adds the chartVersion to the put API chart versions v3 params +func (o *PutAPIChartVersionsV3Params) WithChartVersion(chartVersion *models.SherlockChartVersionV3Create) *PutAPIChartVersionsV3Params { + o.SetChartVersion(chartVersion) + return o +} + +// SetChartVersion adds the chartVersion to the put API chart versions v3 params +func (o *PutAPIChartVersionsV3Params) SetChartVersion(chartVersion *models.SherlockChartVersionV3Create) { + o.ChartVersion = chartVersion +} + +// WriteToRequest writes these params to a swagger request +func (o *PutAPIChartVersionsV3Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.ChartVersion != nil { + if err := r.SetBodyParam(o.ChartVersion); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/sherlock-go-client/client/chart_versions/put_api_chart_versions_v3_responses.go b/sherlock-go-client/client/chart_versions/put_api_chart_versions_v3_responses.go new file mode 100644 index 000000000..4810d8e49 --- /dev/null +++ b/sherlock-go-client/client/chart_versions/put_api_chart_versions_v3_responses.go @@ -0,0 +1,295 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package chart_versions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/broadinstitute/sherlock/sherlock-go-client/client/models" +) + +// PutAPIChartVersionsV3Reader is a Reader for the PutAPIChartVersionsV3 structure. +type PutAPIChartVersionsV3Reader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PutAPIChartVersionsV3Reader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewPutAPIChartVersionsV3Created() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPutAPIChartVersionsV3BadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPutAPIChartVersionsV3Forbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPutAPIChartVersionsV3NotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 407: + result := NewPutAPIChartVersionsV3ProxyAuthenticationRequired() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPutAPIChartVersionsV3Conflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPutAPIChartVersionsV3InternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPutAPIChartVersionsV3Created creates a PutAPIChartVersionsV3Created with default headers values +func NewPutAPIChartVersionsV3Created() *PutAPIChartVersionsV3Created { + return &PutAPIChartVersionsV3Created{} +} + +/* PutAPIChartVersionsV3Created describes a response with status code 201, with default header values. + +Created +*/ +type PutAPIChartVersionsV3Created struct { + Payload *models.SherlockChartVersionV3 +} + +func (o *PutAPIChartVersionsV3Created) Error() string { + return fmt.Sprintf("[PUT /api/chart-versions/v3][%d] putApiChartVersionsV3Created %+v", 201, o.Payload) +} +func (o *PutAPIChartVersionsV3Created) GetPayload() *models.SherlockChartVersionV3 { + return o.Payload +} + +func (o *PutAPIChartVersionsV3Created) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SherlockChartVersionV3) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIChartVersionsV3BadRequest creates a PutAPIChartVersionsV3BadRequest with default headers values +func NewPutAPIChartVersionsV3BadRequest() *PutAPIChartVersionsV3BadRequest { + return &PutAPIChartVersionsV3BadRequest{} +} + +/* PutAPIChartVersionsV3BadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PutAPIChartVersionsV3BadRequest struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIChartVersionsV3BadRequest) Error() string { + return fmt.Sprintf("[PUT /api/chart-versions/v3][%d] putApiChartVersionsV3BadRequest %+v", 400, o.Payload) +} +func (o *PutAPIChartVersionsV3BadRequest) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIChartVersionsV3BadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIChartVersionsV3Forbidden creates a PutAPIChartVersionsV3Forbidden with default headers values +func NewPutAPIChartVersionsV3Forbidden() *PutAPIChartVersionsV3Forbidden { + return &PutAPIChartVersionsV3Forbidden{} +} + +/* PutAPIChartVersionsV3Forbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PutAPIChartVersionsV3Forbidden struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIChartVersionsV3Forbidden) Error() string { + return fmt.Sprintf("[PUT /api/chart-versions/v3][%d] putApiChartVersionsV3Forbidden %+v", 403, o.Payload) +} +func (o *PutAPIChartVersionsV3Forbidden) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIChartVersionsV3Forbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIChartVersionsV3NotFound creates a PutAPIChartVersionsV3NotFound with default headers values +func NewPutAPIChartVersionsV3NotFound() *PutAPIChartVersionsV3NotFound { + return &PutAPIChartVersionsV3NotFound{} +} + +/* PutAPIChartVersionsV3NotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PutAPIChartVersionsV3NotFound struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIChartVersionsV3NotFound) Error() string { + return fmt.Sprintf("[PUT /api/chart-versions/v3][%d] putApiChartVersionsV3NotFound %+v", 404, o.Payload) +} +func (o *PutAPIChartVersionsV3NotFound) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIChartVersionsV3NotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIChartVersionsV3ProxyAuthenticationRequired creates a PutAPIChartVersionsV3ProxyAuthenticationRequired with default headers values +func NewPutAPIChartVersionsV3ProxyAuthenticationRequired() *PutAPIChartVersionsV3ProxyAuthenticationRequired { + return &PutAPIChartVersionsV3ProxyAuthenticationRequired{} +} + +/* PutAPIChartVersionsV3ProxyAuthenticationRequired describes a response with status code 407, with default header values. + +Proxy Authentication Required +*/ +type PutAPIChartVersionsV3ProxyAuthenticationRequired struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIChartVersionsV3ProxyAuthenticationRequired) Error() string { + return fmt.Sprintf("[PUT /api/chart-versions/v3][%d] putApiChartVersionsV3ProxyAuthenticationRequired %+v", 407, o.Payload) +} +func (o *PutAPIChartVersionsV3ProxyAuthenticationRequired) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIChartVersionsV3ProxyAuthenticationRequired) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIChartVersionsV3Conflict creates a PutAPIChartVersionsV3Conflict with default headers values +func NewPutAPIChartVersionsV3Conflict() *PutAPIChartVersionsV3Conflict { + return &PutAPIChartVersionsV3Conflict{} +} + +/* PutAPIChartVersionsV3Conflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PutAPIChartVersionsV3Conflict struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIChartVersionsV3Conflict) Error() string { + return fmt.Sprintf("[PUT /api/chart-versions/v3][%d] putApiChartVersionsV3Conflict %+v", 409, o.Payload) +} +func (o *PutAPIChartVersionsV3Conflict) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIChartVersionsV3Conflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPutAPIChartVersionsV3InternalServerError creates a PutAPIChartVersionsV3InternalServerError with default headers values +func NewPutAPIChartVersionsV3InternalServerError() *PutAPIChartVersionsV3InternalServerError { + return &PutAPIChartVersionsV3InternalServerError{} +} + +/* PutAPIChartVersionsV3InternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PutAPIChartVersionsV3InternalServerError struct { + Payload *models.ErrorsErrorResponse +} + +func (o *PutAPIChartVersionsV3InternalServerError) Error() string { + return fmt.Sprintf("[PUT /api/chart-versions/v3][%d] putApiChartVersionsV3InternalServerError %+v", 500, o.Payload) +} +func (o *PutAPIChartVersionsV3InternalServerError) GetPayload() *models.ErrorsErrorResponse { + return o.Payload +} + +func (o *PutAPIChartVersionsV3InternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ErrorsErrorResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/sherlock-typescript-client/README.md b/sherlock-typescript-client/README.md index 3b972d439..e43c064d8 100644 --- a/sherlock-typescript-client/README.md +++ b/sherlock-typescript-client/README.md @@ -1,4 +1,4 @@ -## @sherlock-js-client/sherlock@v0.2.12 +## @sherlock-js-client/sherlock@v0.2.13 This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: @@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co _published:_ ``` -npm install @sherlock-js-client/sherlock@v0.2.12 --save +npm install @sherlock-js-client/sherlock@v0.2.13 --save ``` _unPublished (not recommended):_ diff --git a/sherlock-typescript-client/package-lock.json b/sherlock-typescript-client/package-lock.json index 99139f540..1dde04687 100644 --- a/sherlock-typescript-client/package-lock.json +++ b/sherlock-typescript-client/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sherlock-js-client/sherlock", - "version": "v0.2.12", + "version": "v0.2.13", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@sherlock-js-client/sherlock", - "version": "v0.2.12", + "version": "v0.2.13", "devDependencies": { "typescript": "^4.0" } diff --git a/sherlock-typescript-client/package.json b/sherlock-typescript-client/package.json index baabf50a1..a9156f457 100644 --- a/sherlock-typescript-client/package.json +++ b/sherlock-typescript-client/package.json @@ -1,6 +1,6 @@ { "name": "@sherlock-js-client/sherlock", - "version": "v0.2.12", + "version": "v0.2.13", "description": "OpenAPI client for @sherlock-js-client/sherlock", "author": "OpenAPI-Generator", "repository": { diff --git a/sherlock-typescript-client/src/apis/AppVersionsApi.ts b/sherlock-typescript-client/src/apis/AppVersionsApi.ts index 31e270fa0..20d0ebb1c 100644 --- a/sherlock-typescript-client/src/apis/AppVersionsApi.ts +++ b/sherlock-typescript-client/src/apis/AppVersionsApi.ts @@ -63,7 +63,7 @@ export interface ApiAppVersionsV3GetRequest { offset?: number; } -export interface ApiAppVersionsV3PostRequest { +export interface ApiAppVersionsV3PutRequest { appVersion: SherlockAppVersionV3Create; } @@ -245,9 +245,9 @@ export class AppVersionsApi extends runtime.BaseAPI { * Upsert a AppVersion. * Upsert a AppVersion */ - async apiAppVersionsV3PostRaw(requestParameters: ApiAppVersionsV3PostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async apiAppVersionsV3PutRaw(requestParameters: ApiAppVersionsV3PutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.appVersion === null || requestParameters.appVersion === undefined) { - throw new runtime.RequiredError('appVersion','Required parameter requestParameters.appVersion was null or undefined when calling apiAppVersionsV3Post.'); + throw new runtime.RequiredError('appVersion','Required parameter requestParameters.appVersion was null or undefined when calling apiAppVersionsV3Put.'); } const queryParameters: any = {}; @@ -258,7 +258,7 @@ export class AppVersionsApi extends runtime.BaseAPI { const response = await this.request({ path: `/api/app-versions/v3`, - method: 'POST', + method: 'PUT', headers: headerParameters, query: queryParameters, body: SherlockAppVersionV3CreateToJSON(requestParameters.appVersion), @@ -271,8 +271,8 @@ export class AppVersionsApi extends runtime.BaseAPI { * Upsert a AppVersion. * Upsert a AppVersion */ - async apiAppVersionsV3Post(requestParameters: ApiAppVersionsV3PostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.apiAppVersionsV3PostRaw(requestParameters, initOverrides); + async apiAppVersionsV3Put(requestParameters: ApiAppVersionsV3PutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiAppVersionsV3PutRaw(requestParameters, initOverrides); return await response.value(); } diff --git a/sherlock-typescript-client/src/apis/ChartVersionsApi.ts b/sherlock-typescript-client/src/apis/ChartVersionsApi.ts index 71ce7b8bd..6c55f0c07 100644 --- a/sherlock-typescript-client/src/apis/ChartVersionsApi.ts +++ b/sherlock-typescript-client/src/apis/ChartVersionsApi.ts @@ -61,7 +61,7 @@ export interface ApiChartVersionsV3GetRequest { offset?: number; } -export interface ApiChartVersionsV3PostRequest { +export interface ApiChartVersionsV3PutRequest { chartVersion: SherlockChartVersionV3Create; } @@ -233,9 +233,9 @@ export class ChartVersionsApi extends runtime.BaseAPI { * Upsert a ChartVersion. * Upsert a ChartVersion */ - async apiChartVersionsV3PostRaw(requestParameters: ApiChartVersionsV3PostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async apiChartVersionsV3PutRaw(requestParameters: ApiChartVersionsV3PutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.chartVersion === null || requestParameters.chartVersion === undefined) { - throw new runtime.RequiredError('chartVersion','Required parameter requestParameters.chartVersion was null or undefined when calling apiChartVersionsV3Post.'); + throw new runtime.RequiredError('chartVersion','Required parameter requestParameters.chartVersion was null or undefined when calling apiChartVersionsV3Put.'); } const queryParameters: any = {}; @@ -246,7 +246,7 @@ export class ChartVersionsApi extends runtime.BaseAPI { const response = await this.request({ path: `/api/chart-versions/v3`, - method: 'POST', + method: 'PUT', headers: headerParameters, query: queryParameters, body: SherlockChartVersionV3CreateToJSON(requestParameters.chartVersion), @@ -259,8 +259,8 @@ export class ChartVersionsApi extends runtime.BaseAPI { * Upsert a ChartVersion. * Upsert a ChartVersion */ - async apiChartVersionsV3Post(requestParameters: ApiChartVersionsV3PostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.apiChartVersionsV3PostRaw(requestParameters, initOverrides); + async apiChartVersionsV3Put(requestParameters: ApiChartVersionsV3PutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.apiChartVersionsV3PutRaw(requestParameters, initOverrides); return await response.value(); } diff --git a/sherlock/docs/docs.go b/sherlock/docs/docs.go index 4a2dbd1fe..3e86ee02f 100644 --- a/sherlock/docs/docs.go +++ b/sherlock/docs/docs.go @@ -227,7 +227,7 @@ const docTemplate = `{ } } }, - "post": { + "put": { "description": "Upsert a AppVersion.", "consumes": [ "application/json" @@ -622,7 +622,7 @@ const docTemplate = `{ } } }, - "post": { + "put": { "description": "Upsert a ChartVersion.", "consumes": [ "application/json" diff --git a/sherlock/docs/swagger.json b/sherlock/docs/swagger.json index 334a992d6..70bb040cc 100644 --- a/sherlock/docs/swagger.json +++ b/sherlock/docs/swagger.json @@ -223,7 +223,7 @@ } } }, - "post": { + "put": { "description": "Upsert a AppVersion.", "consumes": [ "application/json" @@ -618,7 +618,7 @@ } } }, - "post": { + "put": { "description": "Upsert a ChartVersion.", "consumes": [ "application/json" diff --git a/sherlock/docs/swagger.yaml b/sherlock/docs/swagger.yaml index 1bd63b8ea..2c6151856 100644 --- a/sherlock/docs/swagger.yaml +++ b/sherlock/docs/swagger.yaml @@ -2195,7 +2195,7 @@ paths: summary: List AppVersions matching a filter tags: - AppVersions - post: + put: consumes: - application/json description: Upsert a AppVersion. @@ -2461,7 +2461,7 @@ paths: summary: List ChartVersions matching a filter tags: - ChartVersions - post: + put: consumes: - application/json description: Upsert a ChartVersion.