comments
Creates, updates, deletes, gets or lists a comments
resource.
Overview
Name | comments |
Type | Resource |
Id | google.cloudsupport.comments |
Fields
The following fields are returned by SELECT
queries:
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Identifier. The resource name of the comment. |
body | string | The full comment body. Maximum of 12800 characters. |
createTime | string (google-datetime) | Output only. The time when the comment was created. |
creator | object | Output only. The user or Google Support agent who created the comment. (id: Actor) |
plainTextBody | string | Output only. DEPRECATED. DO NOT USE. A duplicate of the body field. This field is only present for legacy reasons. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list | select | parentType , parent | pageSize , pageToken | List all the comments associated with a case. EXAMPLES: cURL: shell case="projects/some-project/cases/43595344" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case/comments" Python: python import googleapiclient.discovery api_version = "v2" supportApiService = googleapiclient.discovery.build( serviceName="cloudsupport", version=api_version, discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}", ) request = ( supportApiService.cases() .comments() .list(parent="projects/some-project/cases/43595344") ) print(request.execute()) |
create | insert | parentType , parent | Add a new comment to a case. The comment must have the following fields set: body . EXAMPLES: cURL: shell case="projects/some-project/cases/43591344" curl \ --request POST \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ --header 'Content-Type: application/json' \ --data '{ "body": "This is a test comment." }' \ "https://cloudsupport.googleapis.com/v2/$case/comments" Python: python import googleapiclient.discovery api_version = "v2" supportApiService = googleapiclient.discovery.build( serviceName="cloudsupport", version=api_version, discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}", ) request = ( supportApiService.cases() .comments() .create( parent="projects/some-project/cases/43595344", body={"body": "This is a test comment."}, ) ) print(request.execute()) |
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 |
---|---|---|
parent | string | |
parentType | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT
examples
- list
List all the comments associated with a case. EXAMPLES: cURL: shell case="projects/some-project/cases/43595344" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case/comments"
Python: python import googleapiclient.discovery api_version = "v2" supportApiService = googleapiclient.discovery.build( serviceName="cloudsupport", version=api_version, discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}", ) request = ( supportApiService.cases() .comments() .list(parent="projects/some-project/cases/43595344") ) print(request.execute())
SELECT
name,
body,
createTime,
creator,
plainTextBody
FROM google.cloudsupport.comments
WHERE parentType = '{{ parentType }}' -- required
AND parent = '{{ parent }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
Add a new comment to a case. The comment must have the following fields set: body
. EXAMPLES: cURL: shell case="projects/some-project/cases/43591344" curl \ --request POST \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ --header 'Content-Type: application/json' \ --data '{ "body": "This is a test comment." }' \ "https://cloudsupport.googleapis.com/v2/$case/comments"
Python: python import googleapiclient.discovery api_version = "v2" supportApiService = googleapiclient.discovery.build( serviceName="cloudsupport", version=api_version, discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}", ) request = ( supportApiService.cases() .comments() .create( parent="projects/some-project/cases/43595344", body={"body": "This is a test comment."}, ) ) print(request.execute())
INSERT INTO google.cloudsupport.comments (
data__body,
parentType,
parent
)
SELECT
'{{ body }}',
'{{ parentType }}',
'{{ parent }}'
RETURNING
name,
body,
createTime,
creator,
plainTextBody
;
# Description fields are for documentation purposes
- name: comments
props:
- name: parentType
value: string
description: Required parameter for the comments resource.
- name: parent
value: string
description: Required parameter for the comments resource.
- name: body
value: string
description: >
The full comment body. Maximum of 12800 characters.