pull_request_comments
Creates, updates, deletes, gets or lists a pull_request_comments
resource.
Overview
Name | pull_request_comments |
Type | Resource |
Id | google.securesourcemanager.pull_request_comments |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. 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} |
code | object | Optional. The comment on a code line. (id: Code) |
comment | object | Optional. The general pull request comment. (id: Comment) |
createTime | string (google-datetime) | Output only. Creation timestamp. |
review | object | Optional. The review summary comment. (id: Review) |
updateTime | string (google-datetime) | Output only. Last updated timestamp. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. 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} |
code | object | Optional. The comment on a code line. (id: Code) |
comment | object | Optional. The general pull request comment. (id: Comment) |
createTime | string (google-datetime) | Output only. Creation timestamp. |
review | object | Optional. The review summary comment. (id: Review) |
updateTime | string (google-datetime) | Output only. Last updated timestamp. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , repositoriesId , pullRequestsId , pullRequestCommentsId | Gets a pull request comment. | |
list | select | projectsId , locationsId , repositoriesId , pullRequestsId | pageSize , pageToken | Lists pull request comments. |
create | insert | projectsId , locationsId , repositoriesId , pullRequestsId | 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. | |
batch_create | insert | projectsId , locationsId , repositoriesId , pullRequestsId | Batch 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. | |
patch | update | projectsId , locationsId , repositoriesId , pullRequestsId , pullRequestCommentsId | updateMask | Updates a pull request comment. |
delete | delete | projectsId , locationsId , repositoriesId , pullRequestsId , pullRequestCommentsId | Deletes a pull request comment. | |
resolve | exec | projectsId , locationsId , repositoriesId , pullRequestsId | 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. | |
unresolve | exec | projectsId , locationsId , repositoriesId , pullRequestsId | Unresolves 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.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
projectsId | string | |
pullRequestCommentsId | string | |
pullRequestsId | string | |
repositoriesId | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
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;
Lists pull request comments.
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- batch_create
- Manifest
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
;
Batch 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.
INSERT INTO google.securesourcemanager.pull_request_comments (
data__requests,
projectsId,
locationsId,
repositoriesId,
pullRequestsId
)
SELECT
'{{ requests }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ repositoriesId }}',
'{{ pullRequestsId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: pull_request_comments
props:
- name: projectsId
value: string
description: Required parameter for the pull_request_comments resource.
- name: locationsId
value: string
description: Required parameter for the pull_request_comments resource.
- name: repositoriesId
value: string
description: Required parameter for the pull_request_comments resource.
- name: pullRequestsId
value: string
description: Required parameter for the pull_request_comments resource.
- name: name
value: string
description: >
Identifier. 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}`
- name: review
value: object
description: >
Optional. The review summary comment.
- name: comment
value: object
description: >
Optional. The general pull request comment.
- name: code
value: object
description: >
Optional. The comment on a code line.
- name: requests
value: array
description: >
Required. The request message specifying the resources to create. There should be exactly one CreatePullRequestCommentRequest with CommentDetail being REVIEW in the list, and no more than 100 CreatePullRequestCommentRequests with CommentDetail being CODE in the list
UPDATE
examples
- patch
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
- delete
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
- resolve
- unresolve
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 }}
}';
Unresolves 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.
EXEC google.securesourcemanager.pull_request_comments.unresolve
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@pullRequestsId='{{ pullRequestsId }}' --required
@@json=
'{
"names": "{{ names }}",
"autoFill": {{ autoFill }}
}';