Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/google-cloud-support/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/node_modules
**/.coverage
build/
docs/
protos/
system-test/
samples/generated/
4 changes: 4 additions & 0 deletions packages/google-cloud-support/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./node_modules/gts",
"root": true
}
6 changes: 4 additions & 2 deletions packages/google-cloud-support/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ

| Sample | Source Code |
| --------------------------- | --------------------------------- |
| get attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_attachment_service.get_attachment.js) |
| list attachments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_attachment_service.list_attachments.js) |
| close case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.close_case.js) |
| create case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.create_case.js) |
Expand All @@ -68,6 +69,7 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ
| search cases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.search_cases.js) |
| update case | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/case_service.update_case.js) |
| create comment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/comment_service.create_comment.js) |
| get comment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/comment_service.get_comment.js) |
| list comments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/comment_service.list_comments.js) |
| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2/snippet_metadata_google.cloud.support.v2.json) |
| get attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/samples/generated/v2beta/case_attachment_service.get_attachment.js) |
Expand Down Expand Up @@ -118,7 +120,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages]

## Contributing

Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/CONTRIBUTING.md).
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md).

Please note that this `README.md`
and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
Expand All @@ -128,7 +130,7 @@ are generated from a central template.

Apache Version 2.0

See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-support/LICENSE)
See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)

[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
[projects]: https://console.cloud.google.com/project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,44 @@ service CaseAttachmentService {
};
option (google.api.method_signature) = "parent";
}

// Retrieve an attachment associated with a support case.
//
// EXAMPLES:
//
// cURL:
//
// ```shell
// attachment="projects/some-project/cases/23598314/attachments/0684M00000P3h1fQAB"
// curl \
// --header "Authorization: Bearer $(gcloud auth print-access-token)" \
// "https://cloudsupport.googleapis.com/v2/$attachment"
// ```
//
// 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()
// .attachments()
// .get(name="projects/some-project/cases/43595344/attachments/0684M00000P3h1fQAB")
// )
// print(request.execute())
// ```
rpc GetAttachment(GetAttachmentRequest) returns (Attachment) {
option (google.api.http) = {
get: "/v2/{name=*/*/cases/*/attachments/*}"
};
option (google.api.method_signature) = "name";
}
}

// The request message for the ListAttachments endpoint.
Expand Down Expand Up @@ -74,6 +112,17 @@ message ListAttachmentsRequest {
string page_token = 3;
}

// Request for getting an attachment.
message GetAttachmentRequest {
// Required. The name of the attachment to get.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "cloudsupport.googleapis.com/Attachment"
}
];
}

// The response message for the ListAttachments endpoint.
message ListAttachmentsResponse {
// The list of attachments associated with a case.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,43 @@ service CommentService {
};
option (google.api.method_signature) = "parent,comment";
}

// Retrieve a comment.
//
// EXAMPLES:
//
// cURL:
//
// ```shell
// comment="projects/some-project/cases/43595344/comments/234567890"
// curl \
// --header "Authorization: Bearer $(gcloud auth print-access-token)" \
// "https://cloudsupport.googleapis.com/v2/$comment"
// ```
//
// 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().get(
// name="projects/some-project/cases/43595344/comments/234567890",
// )
// print(request.execute())
// ```
rpc GetComment(GetCommentRequest) returns (Comment) {
option (google.api.http) = {
get: "/v2/{name=*/*/cases/*/comments/*}"
};
option (google.api.method_signature) = "name";
}
}

// The request message for the ListComments endpoint.
Expand Down Expand Up @@ -105,3 +142,14 @@ message CreateCommentRequest {
// Required. The comment to be added.
Comment comment = 2 [(google.api.field_behavior) = REQUIRED];
}

// The request message for the GetComment endpoint.
message GetCommentRequest {
// Required. The name of the comment to retrieve.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "cloudsupport.googleapis.com/Comment"
}
];
}
Loading
Loading