udpate openapi spec
This commit is contained in:
@@ -23,34 +23,37 @@ import (
|
||||
// CardAPIService CardAPI service
|
||||
type CardAPIService service
|
||||
|
||||
type ApiAddCardApiV1CardsGroupIdPostRequest struct {
|
||||
type ApiAddCardApiV1CardsPostRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *CardAPIService
|
||||
groupId int32
|
||||
cardCreate *CardCreate
|
||||
}
|
||||
|
||||
func (r ApiAddCardApiV1CardsGroupIdPostRequest) Execute() (*Card, *http.Response, error) {
|
||||
return r.ApiService.AddCardApiV1CardsGroupIdPostExecute(r)
|
||||
func (r ApiAddCardApiV1CardsPostRequest) CardCreate(cardCreate CardCreate) ApiAddCardApiV1CardsPostRequest {
|
||||
r.cardCreate = &cardCreate
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiAddCardApiV1CardsPostRequest) Execute() (*Card, *http.Response, error) {
|
||||
return r.ApiService.AddCardApiV1CardsPostExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
AddCardApiV1CardsGroupIdPost Add Card
|
||||
AddCardApiV1CardsPost Add Card
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param groupId
|
||||
@return ApiAddCardApiV1CardsGroupIdPostRequest
|
||||
@return ApiAddCardApiV1CardsPostRequest
|
||||
*/
|
||||
func (a *CardAPIService) AddCardApiV1CardsGroupIdPost(ctx context.Context, groupId int32) ApiAddCardApiV1CardsGroupIdPostRequest {
|
||||
return ApiAddCardApiV1CardsGroupIdPostRequest{
|
||||
func (a *CardAPIService) AddCardApiV1CardsPost(ctx context.Context) ApiAddCardApiV1CardsPostRequest {
|
||||
return ApiAddCardApiV1CardsPostRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
groupId: groupId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Card
|
||||
func (a *CardAPIService) AddCardApiV1CardsGroupIdPostExecute(r ApiAddCardApiV1CardsGroupIdPostRequest) (*Card, *http.Response, error) {
|
||||
func (a *CardAPIService) AddCardApiV1CardsPostExecute(r ApiAddCardApiV1CardsPostRequest) (*Card, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
@@ -58,20 +61,22 @@ func (a *CardAPIService) AddCardApiV1CardsGroupIdPostExecute(r ApiAddCardApiV1Ca
|
||||
localVarReturnValue *Card
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CardAPIService.AddCardApiV1CardsGroupIdPost")
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CardAPIService.AddCardApiV1CardsPost")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/api/v1/cards/{group_id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1)
|
||||
localVarPath := localBasePath + "/api/v1/cards/"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.cardCreate == nil {
|
||||
return localVarReturnValue, nil, reportError("cardCreate is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
@@ -87,6 +92,8 @@ func (a *CardAPIService) AddCardApiV1CardsGroupIdPostExecute(r ApiAddCardApiV1Ca
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.cardCreate
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -134,23 +141,23 @@ func (a *CardAPIService) AddCardApiV1CardsGroupIdPostExecute(r ApiAddCardApiV1Ca
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiDelCardApiV1CardsDeleteGetRequest struct {
|
||||
type ApiDelCardApiV1CardsDeleteRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *CardAPIService
|
||||
}
|
||||
|
||||
func (r ApiDelCardApiV1CardsDeleteGetRequest) Execute() (interface{}, *http.Response, error) {
|
||||
return r.ApiService.DelCardApiV1CardsDeleteGetExecute(r)
|
||||
func (r ApiDelCardApiV1CardsDeleteRequest) Execute() (interface{}, *http.Response, error) {
|
||||
return r.ApiService.DelCardApiV1CardsDeleteExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DelCardApiV1CardsDeleteGet Del Card
|
||||
DelCardApiV1CardsDelete Del Card
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiDelCardApiV1CardsDeleteGetRequest
|
||||
@return ApiDelCardApiV1CardsDeleteRequest
|
||||
*/
|
||||
func (a *CardAPIService) DelCardApiV1CardsDeleteGet(ctx context.Context) ApiDelCardApiV1CardsDeleteGetRequest {
|
||||
return ApiDelCardApiV1CardsDeleteGetRequest{
|
||||
func (a *CardAPIService) DelCardApiV1CardsDelete(ctx context.Context) ApiDelCardApiV1CardsDeleteRequest {
|
||||
return ApiDelCardApiV1CardsDeleteRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
@@ -158,20 +165,20 @@ func (a *CardAPIService) DelCardApiV1CardsDeleteGet(ctx context.Context) ApiDelC
|
||||
|
||||
// Execute executes the request
|
||||
// @return interface{}
|
||||
func (a *CardAPIService) DelCardApiV1CardsDeleteGetExecute(r ApiDelCardApiV1CardsDeleteGetRequest) (interface{}, *http.Response, error) {
|
||||
func (a *CardAPIService) DelCardApiV1CardsDeleteExecute(r ApiDelCardApiV1CardsDeleteRequest) (interface{}, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue interface{}
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CardAPIService.DelCardApiV1CardsDeleteGet")
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CardAPIService.DelCardApiV1CardsDelete")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/api/v1/cards/delete"
|
||||
localVarPath := localBasePath + "/api/v1/cards/"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
@@ -341,3 +348,125 @@ func (a *CardAPIService) GetCardsApiV1CardsGroupIdGetExecute(r ApiGetCardsApiV1C
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiUpdateCardApiV1CardsCardIdPatchRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *CardAPIService
|
||||
cardId int32
|
||||
cardUpdate *CardUpdate
|
||||
}
|
||||
|
||||
func (r ApiUpdateCardApiV1CardsCardIdPatchRequest) CardUpdate(cardUpdate CardUpdate) ApiUpdateCardApiV1CardsCardIdPatchRequest {
|
||||
r.cardUpdate = &cardUpdate
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdateCardApiV1CardsCardIdPatchRequest) Execute() (*Card, *http.Response, error) {
|
||||
return r.ApiService.UpdateCardApiV1CardsCardIdPatchExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateCardApiV1CardsCardIdPatch Update Card
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param cardId
|
||||
@return ApiUpdateCardApiV1CardsCardIdPatchRequest
|
||||
*/
|
||||
func (a *CardAPIService) UpdateCardApiV1CardsCardIdPatch(ctx context.Context, cardId int32) ApiUpdateCardApiV1CardsCardIdPatchRequest {
|
||||
return ApiUpdateCardApiV1CardsCardIdPatchRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
cardId: cardId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Card
|
||||
func (a *CardAPIService) UpdateCardApiV1CardsCardIdPatchExecute(r ApiUpdateCardApiV1CardsCardIdPatchRequest) (*Card, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Card
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CardAPIService.UpdateCardApiV1CardsCardIdPatch")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/api/v1/cards/{card_id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"card_id"+"}", url.PathEscape(parameterValueToString(r.cardId, "cardId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.cardUpdate == nil {
|
||||
return localVarReturnValue, nil, reportError("cardUpdate is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.cardUpdate
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
if localVarHTTPResponse.StatusCode == 422 {
|
||||
var v HTTPValidationError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user