From 6294d41064fdf4f23e34d53b4fe208c751197988 Mon Sep 17 00:00:00 2001 From: Sanket Patel Date: Tue, 5 Jun 2018 16:19:45 -0500 Subject: [PATCH] Sync with jx, and set int data type for Merge method --- default_api.go | 104 ++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/default_api.go b/default_api.go index 517708a..bd9f850 100644 --- a/default_api.go +++ b/default_api.go @@ -3667,57 +3667,6 @@ func (a *DefaultApiService) GetCommit(commitId string, localVarOptionals map[str return NewBitbucketAPIResponse(localVarHTTPResponse) } -func (a *DefaultApiService) GetCommitBuildStatuses(commitSHA string) (*APIResponse, error) { - var ( - localVarHTTPMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/build-status/1.0/commits/{commitId}" - localVarPath = strings.Replace(localVarPath, "{"+"commitId"+"}", fmt.Sprintf("%v", commitSHA), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(a.client.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return NewBitbucketAPIResponse(localVarHTTPResponse) - } - defer localVarHTTPResponse.Body.Close() - if localVarHTTPResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHTTPResponse.Body) - return NewAPIResponseWithError(localVarHTTPResponse, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes)) - } - - return NewBitbucketAPIResponse(localVarHTTPResponse) -} - /* DefaultApiService Retrieve a page of commits from a given starting commit or \"between\" two commits. If no explicit commit is specified, the tip of the repository's default branch is assumed. commits may be identified by branch or tag name or by ID. A path may be supplied to restrict the returned commits to only those which affect that path. <p> The authenticated user must have <b>REPO_READ</b> permission for the specified repository to call this resource. * @param ctx context.Context for authentication, logging, tracing, etc. @@ -6490,6 +6439,57 @@ func (a *DefaultApiService) GetPullRequestCommitsWithOptions(projectKey, reposit return NewBitbucketAPIResponse(localVarHTTPResponse) } +func (a *DefaultApiService) GetCommitBuildStatuses(commitSHA string) (*APIResponse, error) { + var ( + localVarHTTPMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/build-status/1.0/commits/{commitId}" + localVarPath = strings.Replace(localVarPath, "{"+"commitId"+"}", fmt.Sprintf("%v", commitSHA), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(a.client.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return NewBitbucketAPIResponse(localVarHTTPResponse) + } + defer localVarHTTPResponse.Body.Close() + if localVarHTTPResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHTTPResponse.Body) + return NewAPIResponseWithError(localVarHTTPResponse, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes)) + } + + return NewBitbucketAPIResponse(localVarHTTPResponse) +} + /* DefaultApiService Retrieve a repository hook for this repository. <p> The authenticated user must have <strong>REPO_READ</strong> permission for the specified repository to call this resource. * @param ctx context.Context for authentication, logging, tracing, etc. @@ -8218,7 +8218,7 @@ func (a *DefaultApiService) ListParticipants(pullRequestID int64) (*APIResponse, @param optional (nil or map[string]interface{}) with one or more of: @param "version" (int32) the current version of the pull request. If the server's version isn't the same as the specified version the operation will fail. To determine the current version of the pull request it should be fetched from the server prior to this operation. Look for the 'version' attribute in the returned JSON structure. @return */ -func (a *DefaultApiService) Merge(projectKey, repositorySlug string, pullRequestID int64, localVarOptionals map[string]interface{}, localVarPostBody interface{}, localVarHTTPContentTypes []string) (*APIResponse, error) { +func (a *DefaultApiService) Merge(projectKey, repositorySlug string, pullRequestID int, localVarOptionals map[string]interface{}, localVarPostBody interface{}, localVarHTTPContentTypes []string) (*APIResponse, error) { var ( localVarHTTPMethod = strings.ToUpper("Post") localVarFileName string