xref: /aosp_15_r20/external/googleapis/google/cloud/support/v2/comment_service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.support.v2;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/support/v2/comment.proto";
24
25option csharp_namespace = "Google.Cloud.Support.V2";
26option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb";
27option java_multiple_files = true;
28option java_outer_classname = "CommentServiceProto";
29option java_package = "com.google.cloud.support.v2";
30option php_namespace = "Google\\Cloud\\Support\\V2";
31option ruby_package = "Google::Cloud::Support::V2";
32
33// A service to manage comments on cases.
34service CommentService {
35  option (google.api.default_host) = "cloudsupport.googleapis.com";
36  option (google.api.oauth_scopes) =
37      "https://www.googleapis.com/auth/cloud-platform";
38
39  // Retrieve all Comments associated with the Case object.
40  rpc ListComments(ListCommentsRequest) returns (ListCommentsResponse) {
41    option (google.api.http) = {
42      get: "/v2/{parent=projects/*/cases/*}/comments"
43      additional_bindings {
44        get: "/v2/{parent=organizations/*/cases/*}/comments"
45      }
46    };
47    option (google.api.method_signature) = "parent";
48  }
49
50  // Add a new comment to the specified Case.
51  // The comment object must have the following fields set: body.
52  rpc CreateComment(CreateCommentRequest) returns (Comment) {
53    option (google.api.http) = {
54      post: "/v2/{parent=projects/*/cases/*}/comments"
55      body: "comment"
56      additional_bindings {
57        post: "/v2/{parent=organizations/*/cases/*}/comments"
58        body: "comment"
59      }
60    };
61    option (google.api.method_signature) = "parent,comment";
62  }
63}
64
65// The request message for the ListComments endpoint.
66message ListCommentsRequest {
67  // Required. The resource name of Case object for which comments should be
68  // listed.
69  string parent = 1 [
70    (google.api.field_behavior) = REQUIRED,
71    (google.api.resource_reference) = {
72      type: "cloudsupport.googleapis.com/Case"
73    }
74  ];
75
76  // The maximum number of comments fetched with each request. Defaults to 10.
77  int32 page_size = 4;
78
79  // A token identifying the page of results to return. If unspecified, the
80  // first page is retrieved.
81  string page_token = 5;
82}
83
84// The response message for the ListComments endpoint.
85message ListCommentsResponse {
86  // The list of Comments associated with the given Case.
87  repeated Comment comments = 1;
88
89  // A token to retrieve the next page of results. This should be set in the
90  // `page_token` field of subsequent `ListCommentsRequest` message that is
91  // issued. If unspecified, there are no more results to retrieve.
92  string next_page_token = 2;
93}
94
95// The request message for CreateComment endpoint.
96message CreateCommentRequest {
97  // Required. The resource name of Case to which this comment should be added.
98  string parent = 1 [
99    (google.api.field_behavior) = REQUIRED,
100    (google.api.resource_reference) = {
101      type: "cloudsupport.googleapis.com/Case"
102    }
103  ];
104
105  // Required. The Comment object to be added to this Case.
106  Comment comment = 2 [(google.api.field_behavior) = REQUIRED];
107}
108