From 5d932d516bf372dc43c72e0129872fb937368b90 Mon Sep 17 00:00:00 2001 From: Stanislav Afanasev Date: Wed, 31 Oct 2018 23:25:23 +0300 Subject: [PATCH] fix of CreateComment_1 --- default_api.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/default_api.go b/default_api.go index bd9f850..74c4b04 100644 --- a/default_api.go +++ b/default_api.go @@ -752,24 +752,20 @@ func (a *DefaultApiService) CreateComment(commitId string, localVarOptionals map Add a new comment. <p> Comments can be added in a few places by setting different attributes: <p> General pull request comment: <pre> { \"text\": \"An insightful general comment on a pull request.\" } </pre> Reply to a comment: <pre> { \"text\": \"A measured reply.\", \"parent\": { \"id\": 1 } } </pre> General file comment: <pre> { \"text\": \"An insightful general comment on a file.\", \"anchor\": { \"diffType\": \"RANGE\", \"fromHash\": \"6df3858eeb9a53a911cd17e66a9174d44ffb02cd\", \"path\": \"path/to/file\", \"srcPath\": \"path/to/file\", \"toHash\": \"04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b\" } } </pre> File line comment: <pre> { \"text\": \"A pithy comment on a particular line within a file.\", \"anchor\": { \"diffType\": \"COMMIT\", \"line\": 1, \"lineType\": \"CONTEXT\", \"fileType\": \"FROM\", \"fromHash\": \"6df3858eeb9a53a911cd17e66a9174d44ffb02cd\", \"path\": \"path/to/file\", \"srcPath\": \"path/to/file\", \"toHash\": \"04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b\" } } </pre> <p> For file and line comments, 'path' refers to the path of the file to which the comment should be applied and 'srcPath' refers to the path the that file used to have (only required for copies and moves). Also, fromHash and toHash refer to the sinceId / untilId (respectively) used to produce the diff on which the comment was added. Finally diffType refers to the type of diff the comment was added on. For backwards compatibility purposes if no diffType is provided and no fromHash/toHash pair is provided the diffType will be resolved to 'EFFECTIVE'. In any other cases the diffType is REQUIRED. <p> For line comments, 'line' refers to the line in the diff that the comment should apply to. 'lineType' refers to the type of diff hunk, which can be: <ul> <li>'ADDED' - for an added line;</li> <li>'REMOVED' - for a removed line; or</li> <li>'CONTEXT' - for a line that was unmodified but is in the vicinity of the diff.</li> </ul> 'fileType' refers to the file of the diff to which the anchor should be attached - which is of relevance when displaying the diff in a side-by-side way. Currently the supported values are: <ul> <li>'FROM' - the source file of the diff</li> <li>'TO' - the destination file of the diff</li> </ul> If the current user is not a participant the user is added as a watcher of the pull request. <p> The authenticated user must have <strong>REPO_READ</strong> permission for the repository that this pull request targets to call this resource. * @param ctx context.Context for authentication, logging, tracing, etc. @return */ -func (a *DefaultApiService) CreateComment_1(ctx context.Context) (*APIResponse, error) { +func (a *DefaultApiService) CreateComment_1(projectKey, repositorySlug string, pullRequestID int, localVarPostBody interface{}, localVarHTTPContentTypes []string) (*APIResponse, error) { var ( localVarHTTPMethod = strings.ToUpper("Post") - localVarPostBody interface{} localVarFileName string localVarFileBytes []byte ) // create path and map variables - localVarPath := a.client.cfg.BasePath + "/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments" + localVarPath := a.client.cfg.BasePath + fmt.Sprintf("/api/1.0/projects/%s/repos/%s/pull-requests/%d/comments", projectKey, repositorySlug, pullRequestID) 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 != "" {