mirror of
https://github.com/gfleury/go-bitbucket-v1.git
synced 2025-04-04 08:50:13 -05:00
Fixes
This commit is contained in:
parent
0f2067afb7
commit
e0ef906417
@ -3057,8 +3057,8 @@ func (a *DefaultApiService) ForkRepository(projectKey, repositorySlug string,
|
||||
}
|
||||
defer localVarHTTPResponse.Body.Close()
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
bodyBytes, _ := ioutil.ReadAll(localVarHTTPResponse.Body)
|
||||
return NewAPIResponseWithError(localVarHTTPResponse, reportError("Status: %s, Url: %s, Body: %s", localVarHTTPResponse.Status, localVarPath, bodyBytes))
|
||||
bodyBytes, _ := io.ReadAll(localVarHTTPResponse.Body)
|
||||
return NewAPIResponseWithError(localVarHTTPResponse, bodyBytes, reportError("Status: %s, Url: %s, Body: %s", localVarHTTPResponse.Status, localVarPath, bodyBytes))
|
||||
}
|
||||
|
||||
return NewBitbucketAPIResponse(localVarHTTPResponse)
|
||||
@ -5304,8 +5304,8 @@ func (a *DefaultApiService) SetRepositoryPermissionGroups(projectKey, repository
|
||||
}
|
||||
defer localVarHTTPResponse.Body.Close()
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
bodyBytes, _ := ioutil.ReadAll(localVarHTTPResponse.Body)
|
||||
return NewAPIResponseWithError(localVarHTTPResponse, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes))
|
||||
bodyBytes, _ := io.ReadAll(localVarHTTPResponse.Body)
|
||||
return NewAPIResponseWithError(localVarHTTPResponse, bodyBytes, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes))
|
||||
}
|
||||
if localVarHTTPResponse.StatusCode == 204 {
|
||||
return nil, nil
|
||||
@ -8419,8 +8419,8 @@ func (a *DefaultApiService) CreateRepoSSHKey(projectKey, repositorySlug, sshPubK
|
||||
}
|
||||
defer localVarHTTPResponse.Body.Close()
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
bodyBytes, _ := ioutil.ReadAll(localVarHTTPResponse.Body)
|
||||
return NewAPIResponseWithError(localVarHTTPResponse, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes))
|
||||
bodyBytes, _ := io.ReadAll(localVarHTTPResponse.Body)
|
||||
return NewAPIResponseWithError(localVarHTTPResponse, bodyBytes, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes))
|
||||
}
|
||||
|
||||
return NewBitbucketAPIResponse(localVarHTTPResponse)
|
||||
@ -11226,8 +11226,8 @@ func (a *DefaultApiService) CreateAccessToken(userSlug, tokenName string, repoAd
|
||||
}
|
||||
defer localVarHTTPResponse.Body.Close()
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
bodyBytes, _ := ioutil.ReadAll(localVarHTTPResponse.Body)
|
||||
return NewAPIResponseWithError(localVarHTTPResponse, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes))
|
||||
bodyBytes, _ := io.ReadAll(localVarHTTPResponse.Body)
|
||||
return NewAPIResponseWithError(localVarHTTPResponse, bodyBytes, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes))
|
||||
}
|
||||
|
||||
return NewBitbucketAPIResponse(localVarHTTPResponse)
|
||||
@ -14686,7 +14686,6 @@ func (a *DefaultApiService) SearchCode(query SearchQuery) (*APIResponse, error)
|
||||
return NewBitbucketAPIResponse(localVarHTTPResponse)
|
||||
}
|
||||
|
||||
// "http://<ourstashurl>/stash/rest/api/latest/projects/<projectname>/repos/<reponame>/commits?at=refs/heads/deploy&start=0&limit=0"
|
||||
func (a *DefaultApiService) GetHeadCommit(project, repository, branch string, localVarOptionals map[string]interface{}) (*APIResponse, error) {
|
||||
var (
|
||||
localVarHTTPMethod = strings.ToUpper("Get")
|
||||
@ -14694,6 +14693,7 @@ func (a *DefaultApiService) GetHeadCommit(project, repository, branch string, lo
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
if err := typeCheckParameter(localVarOptionals["apibasepath"], "string", "apibasepath"); err != nil {
|
||||
return nil, err
|
||||
@ -14740,8 +14740,8 @@ func (a *DefaultApiService) GetHeadCommit(project, repository, branch string, lo
|
||||
}
|
||||
defer localVarHTTPResponse.Body.Close()
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
bodyBytes, _ := ioutil.ReadAll(localVarHTTPResponse.Body)
|
||||
return NewAPIResponseWithError(localVarHTTPResponse, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes))
|
||||
bodyBytes, _ := io.ReadAll(localVarHTTPResponse.Body)
|
||||
return NewAPIResponseWithError(localVarHTTPResponse, bodyBytes, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes))
|
||||
}
|
||||
|
||||
return NewBitbucketAPIResponse(localVarHTTPResponse)
|
||||
|
@ -2282,6 +2282,7 @@ func TestDefaultApiService_GetArchive(t *testing.T) {
|
||||
project string
|
||||
repository string
|
||||
localVarOptionals map[string]interface{}
|
||||
writer io.Writer
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
@ -2300,7 +2301,7 @@ func TestDefaultApiService_GetArchive(t *testing.T) {
|
||||
a := &DefaultApiService{
|
||||
client: tt.fields.client,
|
||||
}
|
||||
got, err := a.GetArchive(tt.args.project, tt.args.repository, tt.args.localVarOptionals)
|
||||
got, err := a.GetArchive(tt.args.project, tt.args.repository, tt.args.localVarOptionals, tt.args.writer)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("DefaultApiService.GetArchive() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
@ -2963,13 +2964,13 @@ func TestDefaultApiService_GetContent_11(t *testing.T) {
|
||||
a := &DefaultApiService{
|
||||
client: tt.fields.client,
|
||||
}
|
||||
got, err := a.GetContent_11(tt.args.projectKey, tt.args.repositorySlug, tt.args.path, tt.args.localVarOptionals)
|
||||
got, err := a.GetRawContent(tt.args.projectKey, tt.args.repositorySlug, tt.args.path, tt.args.localVarOptionals)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("DefaultApiService.GetContent_11() error = %v, wantErr %v", err, tt.wantErr)
|
||||
t.Errorf("DefaultApiService.GetRawContent() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
if !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("DefaultApiService.GetContent_11() = %v, want %v", got, tt.want)
|
||||
t.Errorf("DefaultApiService.GetRawContent() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user