pull_requests
Creates, updates, deletes, gets or lists a pull_requests
resource.
Overview
Name | pull_requests |
Type | Resource |
Id | google.securesourcemanager.pull_requests |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. A unique identifier for a PullRequest. The number appended at the end is generated by the server. Format: projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request_id} |
base | object | Required. The branch to merge changes in. (id: Branch) |
body | string | Optional. The pull request body. Provides a detailed description of the changes. |
closeTime | string (google-datetime) | Output only. Close timestamp (if closed or merged). Cleared when pull request is re-opened. |
createTime | string (google-datetime) | Output only. Creation timestamp. |
head | object | Immutable. The branch containing the changes to be merged. (id: Branch) |
state | string | Output only. State of the pull request (open, closed or merged). |
title | string | Required. The pull request title. |
updateTime | string (google-datetime) | Output only. Last updated timestamp. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. A unique identifier for a PullRequest. The number appended at the end is generated by the server. Format: projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request_id} |
base | object | Required. The branch to merge changes in. (id: Branch) |
body | string | Optional. The pull request body. Provides a detailed description of the changes. |
closeTime | string (google-datetime) | Output only. Close timestamp (if closed or merged). Cleared when pull request is re-opened. |
createTime | string (google-datetime) | Output only. Creation timestamp. |
head | object | Immutable. The branch containing the changes to be merged. (id: Branch) |
state | string | Output only. State of the pull request (open, closed or merged). |
title | string | Required. The pull request title. |
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 | Gets a pull request. | |
list | select | projectsId , locationsId , repositoriesId | pageSize , pageToken | Lists pull requests in a repository. |
create | insert | projectsId , locationsId , repositoriesId | Creates a pull request. | |
patch | update | projectsId , locationsId , repositoriesId , pullRequestsId | updateMask | Updates a pull request. |
merge | exec | projectsId , locationsId , repositoriesId , pullRequestsId | Merges a pull request. | |
open | exec | projectsId , locationsId , repositoriesId , pullRequestsId | Opens a pull request. | |
close | exec | projectsId , locationsId , repositoriesId , pullRequestsId | Closes a pull request without merging. |
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 | |
pullRequestsId | string | |
repositoriesId | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
Gets a pull request.
SELECT
name,
base,
body,
closeTime,
createTime,
head,
state,
title,
updateTime
FROM google.securesourcemanager.pull_requests
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
AND pullRequestsId = '{{ pullRequestsId }}' -- required;
Lists pull requests in a repository.
SELECT
name,
base,
body,
closeTime,
createTime,
head,
state,
title,
updateTime
FROM google.securesourcemanager.pull_requests
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
Creates a pull request.
INSERT INTO google.securesourcemanager.pull_requests (
data__title,
data__body,
data__base,
data__head,
projectsId,
locationsId,
repositoriesId
)
SELECT
'{{ title }}',
'{{ body }}',
'{{ base }}',
'{{ head }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ repositoriesId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: pull_requests
props:
- name: projectsId
value: string
description: Required parameter for the pull_requests resource.
- name: locationsId
value: string
description: Required parameter for the pull_requests resource.
- name: repositoriesId
value: string
description: Required parameter for the pull_requests resource.
- name: title
value: string
description: >
Required. The pull request title.
- name: body
value: string
description: >
Optional. The pull request body. Provides a detailed description of the changes.
- name: base
value: object
description: >
Required. The branch to merge changes in.
- name: head
value: object
description: >
Immutable. The branch containing the changes to be merged.
UPDATE
examples
- patch
Updates a pull request.
UPDATE google.securesourcemanager.pull_requests
SET
data__title = '{{ title }}',
data__body = '{{ body }}',
data__base = '{{ base }}',
data__head = '{{ head }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND pullRequestsId = '{{ pullRequestsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;
Lifecycle Methods
- merge
- open
- close
Merges a pull request.
EXEC google.securesourcemanager.pull_requests.merge
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@pullRequestsId='{{ pullRequestsId }}' --required;
Opens a pull request.
EXEC google.securesourcemanager.pull_requests.open
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@pullRequestsId='{{ pullRequestsId }}' --required;
Closes a pull request without merging.
EXEC google.securesourcemanager.pull_requests.close
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@pullRequestsId='{{ pullRequestsId }}' --required;