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/case.proto"; 24import "google/cloud/support/v2/escalation.proto"; 25import "google/protobuf/field_mask.proto"; 26 27option csharp_namespace = "Google.Cloud.Support.V2"; 28option go_package = "cloud.google.com/go/support/apiv2/supportpb;supportpb"; 29option java_multiple_files = true; 30option java_outer_classname = "CaseServiceProto"; 31option java_package = "com.google.cloud.support.v2"; 32option php_namespace = "Google\\Cloud\\Support\\V2"; 33option ruby_package = "Google::Cloud::Support::V2"; 34 35// A service to manage Google Cloud support cases. 36service CaseService { 37 option (google.api.default_host) = "cloudsupport.googleapis.com"; 38 option (google.api.oauth_scopes) = 39 "https://www.googleapis.com/auth/cloud-platform"; 40 41 // Retrieve the specified case. 42 rpc GetCase(GetCaseRequest) returns (Case) { 43 option (google.api.http) = { 44 get: "/v2/{name=projects/*/cases/*}" 45 additional_bindings { get: "/v2/{name=organizations/*/cases/*}" } 46 }; 47 option (google.api.method_signature) = "name"; 48 } 49 50 // Retrieve all cases under the specified parent. 51 // 52 // Note: Listing cases under an Organization returns only the cases directly 53 // parented by that organization. To retrieve all cases under an organization, 54 // including cases parented by projects under that organization, use 55 // `cases.search`. 56 rpc ListCases(ListCasesRequest) returns (ListCasesResponse) { 57 option (google.api.http) = { 58 get: "/v2/{parent=projects/*}/cases" 59 additional_bindings { get: "/v2/{parent=organizations/*}/cases" } 60 }; 61 option (google.api.method_signature) = "parent"; 62 } 63 64 // Search cases using the specified query. 65 rpc SearchCases(SearchCasesRequest) returns (SearchCasesResponse) { 66 option (google.api.http) = { 67 get: "/v2/{parent=projects/*}/cases:search" 68 additional_bindings { get: "/v2/{parent=organizations/*}/cases:search" } 69 }; 70 } 71 72 // Create a new case and associate it with the given Google Cloud Resource. 73 // The case object must have the following fields set: `display_name`, 74 // `description`, `classification`, and `priority`. 75 rpc CreateCase(CreateCaseRequest) returns (Case) { 76 option (google.api.http) = { 77 post: "/v2/{parent=projects/*}/cases" 78 body: "case" 79 additional_bindings { 80 post: "/v2/{parent=organizations/*}/cases" 81 body: "case" 82 } 83 }; 84 option (google.api.method_signature) = "parent,case"; 85 } 86 87 // Update the specified case. Only a subset of fields can be updated. 88 rpc UpdateCase(UpdateCaseRequest) returns (Case) { 89 option (google.api.http) = { 90 patch: "/v2/{case.name=projects/*/cases/*}" 91 body: "case" 92 additional_bindings { 93 patch: "/v2/{case.name=organizations/*/cases/*}" 94 body: "case" 95 } 96 }; 97 option (google.api.method_signature) = "case,update_mask"; 98 } 99 100 // Escalate a case. Escalating a case will initiate the Google Cloud Support 101 // escalation management process. 102 // 103 // This operation is only available to certain Customer Care tiers. Go to 104 // https://cloud.google.com/support and look for 'Technical support 105 // escalations' in the feature list to find out which tiers are able to 106 // perform escalations. 107 rpc EscalateCase(EscalateCaseRequest) returns (Case) { 108 option (google.api.http) = { 109 post: "/v2/{name=projects/*/cases/*}:escalate" 110 body: "*" 111 additional_bindings { 112 post: "/v2/{name=organizations/*/cases/*}:escalate" 113 body: "*" 114 } 115 }; 116 } 117 118 // Close the specified case. 119 rpc CloseCase(CloseCaseRequest) returns (Case) { 120 option (google.api.http) = { 121 post: "/v2/{name=projects/*/cases/*}:close" 122 body: "*" 123 additional_bindings { 124 post: "/v2/{name=organizations/*/cases/*}:close" 125 body: "*" 126 } 127 }; 128 } 129 130 // Retrieve valid classifications to be used when creating a support case. 131 // The classications are hierarchical, with each classification containing 132 // all levels of the hierarchy, separated by " > ". For example "Technical 133 // Issue > Compute > Compute Engine". 134 rpc SearchCaseClassifications(SearchCaseClassificationsRequest) 135 returns (SearchCaseClassificationsResponse) { 136 option (google.api.http) = { 137 get: "/v2/caseClassifications:search" 138 }; 139 } 140} 141 142// The request message for the GetCase endpoint. 143message GetCaseRequest { 144 // Required. The fully qualified name of a case to be retrieved. 145 string name = 1 [ 146 (google.api.field_behavior) = REQUIRED, 147 (google.api.resource_reference) = { 148 type: "cloudsupport.googleapis.com/Case" 149 } 150 ]; 151} 152 153// The request message for the CreateCase endpoint. 154message CreateCaseRequest { 155 // Required. The name of the Google Cloud Resource under which the case should 156 // be created. 157 string parent = 1 [ 158 (google.api.field_behavior) = REQUIRED, 159 (google.api.resource_reference) = { 160 child_type: "cloudsupport.googleapis.com/Case" 161 } 162 ]; 163 164 // Required. The case to be created. 165 Case case = 2 [(google.api.field_behavior) = REQUIRED]; 166} 167 168// The request message for the ListCases endpoint. 169message ListCasesRequest { 170 // Required. The fully qualified name of parent resource to list cases under. 171 string parent = 1 [ 172 (google.api.field_behavior) = REQUIRED, 173 (google.api.resource_reference) = { 174 child_type: "cloudsupport.googleapis.com/Case" 175 } 176 ]; 177 178 // An expression written in filter language. If non-empty, the query returns 179 // the cases that match the filter. Else, the query doesn't filter the cases. 180 // 181 // Filter expressions use the following fields with the operators equals (`=`) 182 // and `AND`: 183 // 184 // - `state`: The accepted values are `OPEN` or `CLOSED`. 185 // - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You 186 // can specify multiple values for priority using the `OR` operator. For 187 // example, `priority=P1 OR priority=P2`. 188 // - `creator.email`: The email address of the case creator. 189 // 190 // Examples: 191 // 192 // - `state=CLOSED` 193 // - `state=OPEN AND creator.email="[email protected]"` 194 // - `state=OPEN AND (priority=P0 OR priority=P1)` 195 string filter = 2; 196 197 // The maximum number of cases fetched with each request. Defaults to 10. 198 int32 page_size = 4; 199 200 // A token identifying the page of results to return. If unspecified, the 201 // first page is retrieved. 202 string page_token = 5; 203} 204 205// The response message for the ListCases endpoint. 206message ListCasesResponse { 207 // The list of cases associated with the Google Cloud Resource, after any 208 // filters have been applied. 209 repeated Case cases = 1; 210 211 // A token to retrieve the next page of results. This should be set in the 212 // `page_token` field of the subsequent `ListCasesRequest` message that is 213 // issued. If unspecified, there are no more results to retrieve. 214 string next_page_token = 2; 215} 216 217// The request message for the SearchCases endpoint. 218message SearchCasesRequest { 219 // The fully qualified name of parent resource to search cases under. 220 string parent = 4; 221 222 // An expression written in filter language. 223 // 224 // A query uses the following fields with the operators equals (`=`) and 225 // `AND`: 226 // 227 // - `organization`: An organization name in the form 228 // `organizations/<organization_id>`. 229 // - `project`: A project name in the form `projects/<project_id>`. 230 // - `state`: The accepted values are `OPEN` or `CLOSED`. 231 // - `priority`: The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You 232 // can specify multiple values for priority using the `OR` operator. For 233 // example, `priority=P1 OR priority=P2`. 234 // - `creator.email`: The email address of the case creator. 235 // - `billingAccount`: A billing account in the form 236 // `billingAccounts/<billing_account_id>` 237 // 238 // You must specify either `organization` or `project`. 239 // 240 // To search across `displayName`, `description`, and comments, use a global 241 // restriction with no keyword or operator. For example, `"my search"`. 242 // 243 // To search only cases updated after a certain date, use `update_time` 244 // restricted with that particular date, time, and timezone in ISO datetime 245 // format. For example, `update_time>"2020-01-01T00:00:00-05:00"`. 246 // `update_time` only supports the greater than operator (`>`). 247 // 248 // Examples: 249 // 250 // - `organization="organizations/123456789"` 251 // - `project="projects/my-project-id"` 252 // - `project="projects/123456789"` 253 // - `billing_account="billingAccounts/123456-A0B0C0-CUZ789"` 254 // - `organization="organizations/123456789" AND state=CLOSED` 255 // - `project="projects/my-project-id" AND creator.email="[email protected]"` 256 // - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` 257 string query = 1; 258 259 // The maximum number of cases fetched with each request. The default page 260 // size is 10. 261 int32 page_size = 2; 262 263 // A token identifying the page of results to return. If unspecified, the 264 // first page is retrieved. 265 string page_token = 3; 266} 267 268// The response message for the SearchCases endpoint. 269message SearchCasesResponse { 270 // The list of cases associated with the Google Cloud Resource, after any 271 // filters have been applied. 272 repeated Case cases = 1; 273 274 // A token to retrieve the next page of results. This should be set in the 275 // `page_token` field of subsequent `SearchCaseRequest` message that is 276 // issued. If unspecified, there are no more results to retrieve. 277 string next_page_token = 2; 278} 279 280// The request message for the EscalateCase endpoint. 281message EscalateCaseRequest { 282 // Required. The fully qualified name of the Case resource to be escalated. 283 string name = 1 [ 284 (google.api.field_behavior) = REQUIRED, 285 (google.api.resource_reference) = { 286 type: "cloudsupport.googleapis.com/Case" 287 } 288 ]; 289 290 // The escalation object to be sent with the escalation request. 291 Escalation escalation = 2; 292} 293 294// The request message for the UpdateCase endpoint 295message UpdateCaseRequest { 296 // Required. The case object to update. 297 Case case = 1 [(google.api.field_behavior) = REQUIRED]; 298 299 // A list of attributes of the case object that should be updated 300 // as part of this request. Supported values are `priority`, `display_name`, 301 // and `subscriber_email_addresses`. If no fields are specified, all supported 302 // fields are updated. 303 // 304 // WARNING: If you do not provide a field mask, then you might accidentally 305 // clear some fields. For example, if you leave the field mask empty and do 306 // not provide a value for `subscriber_email_addresses`, then 307 // `subscriber_email_addresses` is updated to empty. 308 google.protobuf.FieldMask update_mask = 2; 309} 310 311// The request message for the CloseCase endpoint. 312message CloseCaseRequest { 313 // Required. The fully qualified name of the case resource to be closed. 314 string name = 1 [ 315 (google.api.field_behavior) = REQUIRED, 316 (google.api.resource_reference) = { 317 type: "cloudsupport.googleapis.com/Case" 318 } 319 ]; 320} 321 322// The request message for SearchCaseClassifications endpoint. 323message SearchCaseClassificationsRequest { 324 // An expression written in the Google Cloud filter language. If non-empty, 325 // then only cases whose fields match the filter are returned. If empty, then 326 // no messages are filtered out. 327 string query = 1; 328 329 // The maximum number of cases fetched with each request. 330 int32 page_size = 2; 331 332 // A token identifying the page of results to return. If unspecified, the 333 // first page is retrieved. 334 string page_token = 3; 335} 336 337// The response message for SearchCaseClassifications endpoint. 338message SearchCaseClassificationsResponse { 339 // The classifications retrieved. 340 repeated CaseClassification case_classifications = 1; 341 342 // A token to retrieve the next page of results. This should be set in the 343 // `page_token` field of subsequent `SearchCaseClassificationsRequest` message 344 // that is issued. If unspecified, there are no more results to retrieve. 345 string next_page_token = 2; 346} 347