mirror of
https://github.com/gfleury/go-bitbucket-v1.git
synced 2025-04-04 17:00:12 -05:00
Merge pull request #17 from superstas/fix-create-comment-1
fix of CreateComment_1
This commit is contained in:
commit
0b7c3522e6
@ -752,24 +752,23 @@ 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 = strings.Replace(localVarPath, "{"+"projectKey"+"}", fmt.Sprintf("%v", projectKey), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"repositorySlug"+"}", fmt.Sprintf("%v", repositorySlug), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"pullRequestId"+"}", fmt.Sprintf("%v", pullRequestID), -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 != "" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user