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.apps.alertcenter.v1beta1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/protobuf/any.proto"; 23import "google/protobuf/empty.proto"; 24import "google/protobuf/timestamp.proto"; 25import "google/rpc/status.proto"; 26 27option csharp_namespace = "Google.Apps.AlertCenter.V1Beta1"; 28option go_package = "google.golang.org/genproto/googleapis/apps/alertcenter/v1beta1;alertcenter"; 29option java_multiple_files = true; 30option java_outer_classname = "AlertCenterProto"; 31option java_package = "com.google.apps.alertcenter.v1beta1"; 32option objc_class_prefix = "GAIC"; 33option php_namespace = "Google\\Apps\\AlertCenter\\V1beta1"; 34option ruby_package = "Google::Apps::AlertCenter::V1beta1"; 35 36// Google Workspace Alert Center API (beta). 37service AlertCenterService { 38 option (google.api.default_host) = "alertcenter.googleapis.com"; 39 option (google.api.oauth_scopes) = 40 "https://www.googleapis.com/auth/apps.alerts"; 41 42 // Lists the alerts. 43 rpc ListAlerts(ListAlertsRequest) returns (ListAlertsResponse) { 44 option (google.api.http) = { 45 get: "/v1beta1/alerts" 46 }; 47 } 48 49 // Gets the specified alert. Attempting to get a nonexistent alert returns 50 // `NOT_FOUND` error. 51 rpc GetAlert(GetAlertRequest) returns (Alert) { 52 option (google.api.http) = { 53 get: "/v1beta1/alerts/{alert_id}" 54 }; 55 } 56 57 // Marks the specified alert for deletion. An alert that has been marked for 58 // deletion is removed from Alert Center after 30 days. 59 // Marking an alert for deletion has no effect on an alert which has 60 // already been marked for deletion. Attempting to mark a nonexistent alert 61 // for deletion results in a `NOT_FOUND` error. 62 rpc DeleteAlert(DeleteAlertRequest) returns (google.protobuf.Empty) { 63 option (google.api.http) = { 64 delete: "/v1beta1/alerts/{alert_id}" 65 }; 66 } 67 68 // Restores, or "undeletes", an alert that was marked for deletion within the 69 // past 30 days. Attempting to undelete an alert which was marked for deletion 70 // over 30 days ago (which has been removed from the Alert Center database) or 71 // a nonexistent alert returns a `NOT_FOUND` error. Attempting to 72 // undelete an alert which has not been marked for deletion has no effect. 73 rpc UndeleteAlert(UndeleteAlertRequest) returns (Alert) { 74 option (google.api.http) = { 75 post: "/v1beta1/alerts/{alert_id}:undelete" 76 body: "*" 77 }; 78 } 79 80 // Creates new feedback for an alert. Attempting to create a feedback for 81 // a non-existent alert returns `NOT_FOUND` error. Attempting to create a 82 // feedback for an alert that is marked for deletion returns 83 // `FAILED_PRECONDITION' error. 84 rpc CreateAlertFeedback(CreateAlertFeedbackRequest) returns (AlertFeedback) { 85 option (google.api.http) = { 86 post: "/v1beta1/alerts/{alert_id}/feedback" 87 body: "feedback" 88 }; 89 } 90 91 // Lists all the feedback for an alert. Attempting to list feedbacks for 92 // a non-existent alert returns `NOT_FOUND` error. 93 rpc ListAlertFeedback(ListAlertFeedbackRequest) 94 returns (ListAlertFeedbackResponse) { 95 option (google.api.http) = { 96 get: "/v1beta1/alerts/{alert_id}/feedback" 97 }; 98 } 99 100 // Returns the metadata of an alert. Attempting to get metadata for 101 // a non-existent alert returns `NOT_FOUND` error. 102 rpc GetAlertMetadata(GetAlertMetadataRequest) returns (AlertMetadata) { 103 option (google.api.http) = { 104 get: "/v1beta1/alerts/{alert_id}/metadata" 105 }; 106 } 107 108 // Returns customer-level settings. 109 rpc GetSettings(GetSettingsRequest) returns (Settings) { 110 option (google.api.http) = { 111 get: "/v1beta1/settings" 112 }; 113 } 114 115 // Updates the customer-level settings. 116 rpc UpdateSettings(UpdateSettingsRequest) returns (Settings) { 117 option (google.api.http) = { 118 patch: "/v1beta1/settings" 119 body: "settings" 120 }; 121 } 122 123 // Performs batch delete operation on alerts. 124 rpc BatchDeleteAlerts(BatchDeleteAlertsRequest) 125 returns (BatchDeleteAlertsResponse) { 126 option (google.api.http) = { 127 post: "/v1beta1/alerts:batchDelete" 128 body: "*" 129 }; 130 } 131 132 // Performs batch undelete operation on alerts. 133 rpc BatchUndeleteAlerts(BatchUndeleteAlertsRequest) 134 returns (BatchUndeleteAlertsResponse) { 135 option (google.api.http) = { 136 post: "/v1beta1/alerts:batchUndelete" 137 body: "*" 138 }; 139 } 140} 141 142// An alert affecting a customer. 143message Alert { 144 // Output only. The unique identifier of the Google Workspace account of the 145 // customer. 146 string customer_id = 1; 147 148 // Output only. The unique identifier for the alert. 149 string alert_id = 2; 150 151 // Output only. The time this alert was created. 152 google.protobuf.Timestamp create_time = 3; 153 154 // Required. The time the event that caused this alert was started or 155 // detected. 156 google.protobuf.Timestamp start_time = 4; 157 158 // Optional. The time the event that caused this alert ceased being active. 159 // If provided, the end time must not be earlier than the start time. 160 // If not provided, it indicates an ongoing alert. 161 google.protobuf.Timestamp end_time = 5; 162 163 // Required. The type of the alert. 164 // This is output only after alert is created. 165 // For a list of available alert types see 166 // [Google Workspace Alert 167 // types](https://developers.google.com/admin-sdk/alertcenter/reference/alert-types). 168 string type = 6; 169 170 // Required. A unique identifier for the system that reported the alert. 171 // This is output only after alert is created. 172 // 173 // Supported sources are any of the following: 174 // 175 // * Google Operations 176 // * Mobile device management 177 // * Gmail phishing 178 // * Data Loss Prevention 179 // * Domain wide takeout 180 // * State sponsored attack 181 // * Google identity 182 // * Apps outage 183 string source = 7; 184 185 // Optional. The data associated with this alert, for example 186 // [google.apps.alertcenter.type.DeviceCompromised] 187 // [google.apps.alertcenter.type.DeviceCompromised]. 188 google.protobuf.Any data = 8; 189 190 // Output only. An optional 191 // [Security Investigation Tool](https://support.google.com/a/answer/7575955) 192 // query for this alert. 193 string security_investigation_tool_link = 9; 194 195 // Output only. `True` if this alert is marked for deletion. 196 bool deleted = 11; 197 198 // Output only. The metadata associated with this alert. 199 AlertMetadata metadata = 12; 200 201 // Output only. The time this alert was last updated. 202 google.protobuf.Timestamp update_time = 13; 203 204 // Optional. `etag` is used for optimistic concurrency control as a way to 205 // help prevent simultaneous updates of an alert from overwriting each other. 206 // It is strongly suggested that systems make use of the `etag` in the 207 // read-modify-write cycle to perform alert updates in order to avoid race 208 // conditions: An `etag` is returned in the response which contains alerts, 209 // and systems are expected to put that etag in the request to update alert to 210 // ensure that their change will be applied to the same version of the alert. 211 // 212 // If no `etag` is provided in the call to update alert, then the existing 213 // alert is overwritten blindly. 214 string etag = 14; 215} 216 217// A customer feedback about an alert. 218message AlertFeedback { 219 // Output only. The unique identifier of the Google Workspace account of the 220 // customer. 221 string customer_id = 1; 222 223 // Output only. The alert identifier. 224 string alert_id = 2; 225 226 // Output only. The unique identifier for the feedback. 227 string feedback_id = 3; 228 229 // Output only. The time this feedback was created. 230 google.protobuf.Timestamp create_time = 4; 231 232 // Required. The type of the feedback. 233 AlertFeedbackType type = 5; 234 235 // Output only. The email of the user that provided the feedback. 236 string email = 6; 237} 238 239// An alert metadata. 240message AlertMetadata { 241 // Output only. The unique identifier of the Google Workspace account of the 242 // customer. 243 string customer_id = 1; 244 245 // Output only. The alert identifier. 246 string alert_id = 2; 247 248 // The current status of the alert. 249 // The supported values are the following: 250 // 251 // * NOT_STARTED 252 // * IN_PROGRESS 253 // * CLOSED 254 string status = 4; 255 256 // The email address of the user assigned to the alert. 257 string assignee = 5; 258 259 // Output only. The time this metadata was last updated. 260 google.protobuf.Timestamp update_time = 6; 261 262 // The severity value of the alert. Alert Center will set this field at alert 263 // creation time, default's to an empty string when it could not be 264 // determined. 265 // The supported values for update actions on this field are the following: 266 // 267 // * HIGH 268 // * MEDIUM 269 // * LOW 270 string severity = 7; 271 272 // Optional. `etag` is used for optimistic concurrency control as a way to 273 // help prevent simultaneous updates of an alert metadata from overwriting 274 // each other. It is strongly suggested that systems make use of the `etag` in 275 // the read-modify-write cycle to perform metadata updates in order to avoid 276 // race conditions: An `etag` is returned in the response which contains alert 277 // metadata, and systems are expected to put that etag in the request to 278 // update alert metadata to ensure that their change will be applied to the 279 // same version of the alert metadata. 280 // 281 // If no `etag` is provided in the call to update alert metadata, then the 282 // existing alert metadata is overwritten blindly. 283 string etag = 8; 284} 285 286// The type of alert feedback. 287enum AlertFeedbackType { 288 // The feedback type is not specified. 289 ALERT_FEEDBACK_TYPE_UNSPECIFIED = 0; 290 291 // The alert report is not useful. 292 NOT_USEFUL = 1; 293 294 // The alert report is somewhat useful. 295 SOMEWHAT_USEFUL = 2; 296 297 // The alert report is very useful. 298 VERY_USEFUL = 3; 299} 300 301// Customer-level settings. 302message Settings { 303 // Settings for callback notifications. 304 // For more details see [Google Workspace Alert 305 // Notification](https://developers.google.com/admin-sdk/alertcenter/guides/notifications). 306 message Notification { 307 // The format of the payload. 308 enum PayloadFormat { 309 // Payload format is not specified (will use JSON as default). 310 PAYLOAD_FORMAT_UNSPECIFIED = 0; 311 312 // Use JSON. 313 JSON = 1; 314 } 315 316 // A reference to a Cloud Pubsub topic. 317 // 318 // To register for notifications, the owner of the topic must grant 319 // `[email protected]` the 320 // `projects.topics.publish` permission. 321 message CloudPubsubTopic { 322 // The `name` field of a Cloud Pubsub [Topic] 323 // (https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#Topic). 324 string topic_name = 1; 325 326 // Optional. The format of the payload that would be sent. 327 // If not specified the format will be JSON. 328 PayloadFormat payload_format = 2; 329 } 330 331 // Exactly one destination to be specified. 332 oneof destination { 333 // A Google Cloud Pub/sub topic destination. 334 CloudPubsubTopic cloud_pubsub_topic = 1; 335 } 336 } 337 338 // The list of notifications. 339 repeated Notification notifications = 1; 340} 341 342// A request to perform batch delete on alerts. 343message BatchDeleteAlertsRequest { 344 // Optional. The unique identifier of the Google Workspace account of the 345 // customer the alerts are associated with. The `customer_id` must have the 346 // initial "C" stripped (for example, `046psxkn`). Inferred from the caller 347 // identity if not provided. [Find your customer 348 // ID](https://support.google.com/cloudidentity/answer/10070793). 349 string customer_id = 1; 350 351 // Required. The list of alert IDs to delete. 352 repeated string alert_id = 2; 353} 354 355// Response to batch delete operation on alerts. 356message BatchDeleteAlertsResponse { 357 // The successful list of alert IDs. 358 repeated string success_alert_ids = 1; 359 360 // The status details for each failed `alert_id`. 361 map<string, google.rpc.Status> failed_alert_status = 2; 362} 363 364// A request to perform batch undelete on alerts. 365message BatchUndeleteAlertsRequest { 366 // Optional. The unique identifier of the Google Workspace account of the 367 // customer the alerts are associated with. The `customer_id` must have the 368 // initial "C" stripped (for example, `046psxkn`). Inferred from the caller 369 // identity if not provided. [Find your customer 370 // ID](https://support.google.com/cloudidentity/answer/10070793). 371 string customer_id = 1; 372 373 // Required. The list of alert IDs to undelete. 374 repeated string alert_id = 2; 375} 376 377// Response to batch undelete operation on alerts. 378message BatchUndeleteAlertsResponse { 379 // The successful list of alert IDs. 380 repeated string success_alert_ids = 1; 381 382 // The status details for each failed `alert_id`. 383 map<string, google.rpc.Status> failed_alert_status = 2; 384} 385 386// An alert listing request. 387message ListAlertsRequest { 388 // Optional. The unique identifier of the Google Workspace account of the 389 // customer the alerts are associated with. The `customer_id` must have the 390 // initial "C" stripped (for example, `046psxkn`). Inferred from the caller 391 // identity if not provided. [Find your customer 392 // ID](https://support.google.com/cloudidentity/answer/10070793). 393 string customer_id = 1; 394 395 // Optional. The requested page size. Server may return fewer items than 396 // requested. If unspecified, server picks an appropriate default. 397 int32 page_size = 2; 398 399 // Optional. A token identifying a page of results the server should return. 400 // If empty, a new iteration is started. To continue an iteration, pass in 401 // the value from the previous ListAlertsResponse's 402 // [next_page_token][google.apps.alertcenter.v1beta1.ListAlertsResponse.next_page_token] 403 // field. 404 string page_token = 3; 405 406 // Optional. A query string for filtering alert results. 407 // For more details, see [Query 408 // filters](https://developers.google.com/admin-sdk/alertcenter/guides/query-filters) 409 // and [Supported query filter 410 // fields](https://developers.google.com/admin-sdk/alertcenter/reference/filter-fields#alerts.list). 411 string filter = 4; 412 413 // Optional. The sort order of the list results. 414 // If not specified results may be returned in arbitrary order. 415 // You can sort the results in descending order based on the creation 416 // timestamp using `order_by="create_time desc"`. 417 // Currently, supported sorting are `create_time asc`, `create_time desc`, 418 // `update_time desc` 419 string order_by = 5; 420} 421 422// Response message for an alert listing request. 423message ListAlertsResponse { 424 // The list of alerts. 425 repeated Alert alerts = 1; 426 427 // The token for the next page. If not empty, indicates that there may be more 428 // alerts that match the listing request; this value can be used in a 429 // subsequent 430 // [ListAlertsRequest][google.apps.alertcenter.v1beta1.ListAlertsRequest] to 431 // get alerts continuing from last result of the current list call. 432 string next_page_token = 2; 433} 434 435// Request for a specific alert. 436message GetAlertRequest { 437 // Optional. The unique identifier of the Google Workspace account of the 438 // customer the alert is associated with. The `customer_id` must have the 439 // initial "C" stripped (for example, `046psxkn`). Inferred from the caller 440 // identity if not provided. [Find your customer 441 // ID](https://support.google.com/cloudidentity/answer/10070793). 442 string customer_id = 1; 443 444 // Required. The identifier of the alert to retrieve. 445 string alert_id = 2; 446} 447 448// A request to mark a specific alert for deletion. 449message DeleteAlertRequest { 450 // Optional. The unique identifier of the Google Workspace account of the 451 // customer the alert is associated with. The `customer_id` must have the 452 // initial "C" stripped (for example, `046psxkn`). Inferred from the caller 453 // identity if not provided. [Find your customer 454 // ID](https://support.google.com/cloudidentity/answer/10070793). 455 string customer_id = 1; 456 457 // Required. The identifier of the alert to delete. 458 string alert_id = 2; 459} 460 461// A request to undelete a specific alert that was marked for deletion. 462message UndeleteAlertRequest { 463 // Optional. The unique identifier of the Google Workspace account of the 464 // customer the alert is associated with. The `customer_id` must have the 465 // initial "C" stripped (for example, `046psxkn`). Inferred from the caller 466 // identity if not provided. [Find your customer 467 // ID](https://support.google.com/cloudidentity/answer/10070793). 468 string customer_id = 1; 469 470 // Required. The identifier of the alert to undelete. 471 string alert_id = 2; 472} 473 474// A request to create a new alert feedback. 475message CreateAlertFeedbackRequest { 476 // Optional. The unique identifier of the Google Workspace account of the 477 // customer the alert is associated with. The `customer_id` must have the 478 // initial "C" stripped (for example, `046psxkn`). Inferred from the caller 479 // identity if not provided. [Find your customer 480 // ID](https://support.google.com/cloudidentity/answer/10070793). 481 string customer_id = 1; 482 483 // Required. The identifier of the alert this feedback belongs to. 484 string alert_id = 2; 485 486 // Required. The new alert feedback to create. 487 AlertFeedback feedback = 3; 488} 489 490// An alert feedback listing request. 491message ListAlertFeedbackRequest { 492 // Optional. The unique identifier of the Google Workspace account of the 493 // customer the alert is associated with. The `customer_id` must have the 494 // initial "C" stripped (for example, `046psxkn`). Inferred from the caller 495 // identity if not provided. [Find your customer 496 // ID](https://support.google.com/cloudidentity/answer/10070793). 497 string customer_id = 1; 498 499 // Required. The alert identifier. 500 // The "-" wildcard could be used to represent all alerts. 501 string alert_id = 2; 502 503 // Optional. A query string for filtering alert feedback results. 504 // For more details, see [Query 505 // filters](https://developers.google.com/admin-sdk/alertcenter/guides/query-filters) 506 // and [Supported query filter 507 // fields](https://developers.google.com/admin-sdk/alertcenter/reference/filter-fields#alerts.feedback.list). 508 string filter = 3; 509} 510 511// Response message for an alert feedback listing request. 512message ListAlertFeedbackResponse { 513 // The list of alert feedback. 514 // Feedback entries for each alert are ordered by creation time descending. 515 repeated AlertFeedback feedback = 1; 516} 517 518// Get the alert metadata. 519message GetAlertMetadataRequest { 520 // Optional. The unique identifier of the Google Workspace account of the 521 // customer the alert metadata is associated with. The `customer_id` must 522 // have the initial "C" stripped (for example, `046psxkn`). Inferred from the 523 // caller identity if not provided. [Find your customer 524 // ID](https://support.google.com/cloudidentity/answer/10070793). 525 string customer_id = 1; 526 527 // Required. The identifier of the alert this metadata belongs to. 528 string alert_id = 2; 529} 530 531// Get the customer level settings. 532message GetSettingsRequest { 533 // Optional. The unique identifier of the Google Workspace account of the 534 // customer the alert settings are associated with. The `customer_id` must/ 535 // have the initial "C" stripped (for example, `046psxkn`). Inferred from the 536 // caller identity if not provided. [Find your customer 537 // ID](https://support.google.com/cloudidentity/answer/10070793). 538 string customer_id = 1; 539} 540 541// Update the customer level settings. 542message UpdateSettingsRequest { 543 // Optional. The unique identifier of the Google Workspace account of the 544 // customer the alert settings are associated with. The `customer_id` must 545 // have the initial "C" stripped (for example, `046psxkn`). Inferred from the 546 // caller identity if not provided. [Find your customer 547 // ID](https://support.google.com/cloudidentity/answer/10070793). 548 string customer_id = 1; 549 550 // The customer settings to update. 551 Settings settings = 2; 552} 553