From 253bd65c4cc579120b344a869cecc943bd180848 Mon Sep 17 00:00:00 2001 From: Mark Nielsen Date: Fri, 15 Feb 2019 14:14:09 -0800 Subject: [PATCH] fix: add project and repo params to FindWebhooks --- default_api.go | 4 +++- default_api_test.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/default_api.go b/default_api.go index 6ce63ff..c1d9181 100644 --- a/default_api.go +++ b/default_api.go @@ -2636,7 +2636,7 @@ func (a *DefaultApiService) FindUsersNotInGroup(localVarOptionals map[string]int @param "event" (string) list of {@link com.atlassian.webhooks.WebhookEvent} ids to filter for @param "statistics" (bool) {@code true} if statistics should be provided for all found webhooks @return */ -func (a *DefaultApiService) FindWebhooks(localVarOptionals map[string]interface{}) (*APIResponse, error) { +func (a *DefaultApiService) FindWebhooks(projectKey, repositorySlug string, localVarOptionals map[string]interface{}) (*APIResponse, error) { var ( localVarHTTPMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -2646,6 +2646,8 @@ func (a *DefaultApiService) FindWebhooks(localVarOptionals map[string]interface{ // create path and map variables localVarPath := a.client.cfg.BasePath + "/api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks" + localVarPath = strings.Replace(localVarPath, "{"+"projectKey"+"}", fmt.Sprintf("%v", projectKey), -1) + localVarPath = strings.Replace(localVarPath, "{"+"repositorySlug"+"}", fmt.Sprintf("%v", repositorySlug), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/default_api_test.go b/default_api_test.go index 3d3a199..1bdd80f 100644 --- a/default_api_test.go +++ b/default_api_test.go @@ -1521,6 +1521,8 @@ func TestDefaultApiService_FindWebhooks(t *testing.T) { client *APIClient } type args struct { + projectKey string + repositorySlug string localVarOptionals map[string]interface{} } tests := []struct { @@ -1537,7 +1539,7 @@ func TestDefaultApiService_FindWebhooks(t *testing.T) { a := &DefaultApiService{ client: tt.fields.client, } - got, err := a.FindWebhooks(tt.args.localVarOptionals) + got, err := a.FindWebhooks(tt.args.projectKey, tt.args.repositorySlug, tt.args.localVarOptionals) if (err != nil) != tt.wantErr { t.Errorf("DefaultApiService.FindWebhooks() error = %v, wantErr %v", err, tt.wantErr) return