Skip to main content

pull_request_comments

Creates, updates, deletes, gets or lists a pull_request_comments resource.

Overview

Namepull_request_comments
TypeResource
Idgoogle.securesourcemanager.pull_request_comments

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Unique identifier for the pull request comment. The comment id is generated by the server. Format: projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment_id}
codeobjectOptional. The comment on a code line. (id: Code)
commentobjectOptional. The general pull request comment. (id: Comment)
createTimestring (google-datetime)Output only. Creation timestamp.
reviewobjectOptional. The review summary comment. (id: Review)
updateTimestring (google-datetime)Output only. Last updated timestamp.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, repositoriesId, pullRequestsId, pullRequestCommentsIdGets a pull request comment.
listselectprojectsId, locationsId, repositoriesId, pullRequestsIdpageSize, pageTokenLists pull request comments.
createinsertprojectsId, locationsId, repositoriesId, pullRequestsIdCreates a pull request comment. This function is used to create a single PullRequestComment of type Comment, or a single PullRequestComment of type Code that's replying to another PullRequestComment of type Code. Use BatchCreatePullRequestComments to create multiple PullRequestComments for code reviews.
batch_createinsertprojectsId, locationsId, repositoriesId, pullRequestsIdBatch creates pull request comments. This function is used to create multiple PullRequestComments for code review. There needs to be exactly one PullRequestComment of type Review, and at most 100 PullRequestComments of type Code per request. The Position of the code comments must be unique within the request.
patchupdateprojectsId, locationsId, repositoriesId, pullRequestsId, pullRequestCommentsIdupdateMaskUpdates a pull request comment.
deletedeleteprojectsId, locationsId, repositoriesId, pullRequestsId, pullRequestCommentsIdDeletes a pull request comment.
resolveexecprojectsId, locationsId, repositoriesId, pullRequestsIdResolves pull request comments. A list of PullRequestComment names must be provided. The PullRequestComment names must be in the same conversation thread. If auto_fill is set, all comments in the conversation thread will be resolved.
unresolveexecprojectsId, locationsId, repositoriesId, pullRequestsIdUnresolves pull request comments. A list of PullRequestComment names must be provided. The PullRequestComment names must be in the same conversation thread. If auto_fill is set, all comments in the conversation thread will be unresolved.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
pullRequestCommentsIdstring
pullRequestsIdstring
repositoriesIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets a pull request comment.

SELECT
name,
code,
comment,
createTime,
review,
updateTime
FROM google.securesourcemanager.pull_request_comments
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
AND pullRequestsId = '{{ pullRequestsId }}' -- required
AND pullRequestCommentsId = '{{ pullRequestCommentsId }}' -- required;

INSERT examples

Creates a pull request comment. This function is used to create a single PullRequestComment of type Comment, or a single PullRequestComment of type Code that's replying to another PullRequestComment of type Code. Use BatchCreatePullRequestComments to create multiple PullRequestComments for code reviews.

INSERT INTO google.securesourcemanager.pull_request_comments (
data__name,
data__review,
data__comment,
data__code,
projectsId,
locationsId,
repositoriesId,
pullRequestsId
)
SELECT
'{{ name }}',
'{{ review }}',
'{{ comment }}',
'{{ code }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ repositoriesId }}',
'{{ pullRequestsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a pull request comment.

UPDATE google.securesourcemanager.pull_request_comments
SET
data__name = '{{ name }}',
data__review = '{{ review }}',
data__comment = '{{ comment }}',
data__code = '{{ code }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND pullRequestsId = '{{ pullRequestsId }}' --required
AND pullRequestCommentsId = '{{ pullRequestCommentsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a pull request comment.

DELETE FROM google.securesourcemanager.pull_request_comments
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND pullRequestsId = '{{ pullRequestsId }}' --required
AND pullRequestCommentsId = '{{ pullRequestCommentsId }}' --required;

Lifecycle Methods

Resolves pull request comments. A list of PullRequestComment names must be provided. The PullRequestComment names must be in the same conversation thread. If auto_fill is set, all comments in the conversation thread will be resolved.

EXEC google.securesourcemanager.pull_request_comments.resolve 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@pullRequestsId='{{ pullRequestsId }}' --required
@@json=
'{
"names": "{{ names }}",
"autoFill": {{ autoFill }}
}';