diff --git a/default_api.go b/default_api.go index b5a5581..6e10a48 100644 --- a/default_api.go +++ b/default_api.go @@ -5221,7 +5221,7 @@ func (a *DefaultApiService) GetPullRequestsPage(projectKey, repositorySlug strin Retrieve the project matching the supplied <strong>projectKey</strong>. <p> The authenticated user must have <strong>PROJECT_VIEW</strong> permission for the specified project to call this resource. * @param ctx context.Context for authentication, logging, tracing, etc. @return */ -func (a *DefaultApiService) GetProject(ctx context.Context) (*APIResponse, error) { +func (a *DefaultApiService) GetProject(ctx context.Context, projectKey string) (*APIResponse, error) { var ( localVarHTTPMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -5231,6 +5231,7 @@ func (a *DefaultApiService) GetProject(ctx context.Context) (*APIResponse, error // create path and map variables localVarPath := a.client.cfg.BasePath + "/api/1.0/projects/{projectKey}" + localVarPath = strings.Replace(localVarPath, "{"+"projectKey"+"}", fmt.Sprintf("%v", projectKey), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/default_api_test.go b/default_api_test.go index 0f8fe93..b8d894b 100644 --- a/default_api_test.go +++ b/default_api_test.go @@ -2794,6 +2794,7 @@ func TestDefaultApiService_GetProject(t *testing.T) { } type args struct { ctx context.Context + key string } tests := []struct { name string @@ -2802,14 +2803,14 @@ func TestDefaultApiService_GetProject(t *testing.T) { want *APIResponse wantErr bool }{ - {"networkErrorContextExceeded", fields{client: generateConfigFake()}, args{}, &APIResponse{Message: "Get https://stash.domain.com/rest/api/1.0/projects/%7BprojectKey%7D: context canceled"}, true}, + {"networkErrorContextExceeded", fields{client: generateConfigFake()}, args{key: "7BprojectKey"}, &APIResponse{Message: "Get https://stash.domain.com/rest/api/1.0/projects/7BprojectKey: context canceled"}, true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { a := &DefaultApiService{ client: tt.fields.client, } - got, err := a.GetProject(tt.args.ctx) + got, err := a.GetProject(tt.args.ctx, tt.args.key) if (err != nil) != tt.wantErr { t.Errorf("DefaultApiService.GetProject() error = %v, wantErr %v", err, tt.wantErr) return