@@ -56,6 +56,23 @@ service AdvisoryNotificationsService {
5656 };
5757 option (google.api.method_signature ) = "name" ;
5858 }
59+
60+ // Get notification settings.
61+ rpc GetSettings (GetSettingsRequest ) returns (Settings ) {
62+ option (google.api.http ) = {
63+ get : "/v1/{name=organizations/*/locations/*/settings}"
64+ };
65+ option (google.api.method_signature ) = "name" ;
66+ }
67+
68+ // Update notification settings.
69+ rpc UpdateSettings (UpdateSettingsRequest ) returns (Settings ) {
70+ option (google.api.http ) = {
71+ patch : "/v1/{settings.name=organizations/*/locations/*/settings}"
72+ body : "settings"
73+ };
74+ option (google.api.method_signature ) = "settings" ;
75+ }
5976}
6077
6178// Notification view.
@@ -274,3 +291,53 @@ message GetNotificationRequest {
274291 // this RPC will throw an error.
275292 string language_code = 5 ;
276293}
294+
295+ // Settings for Advisory Notifications.
296+ message Settings {
297+ option (google.api.resource ) = {
298+ type : "advisorynotifications.googleapis.com/Settings"
299+ pattern : "organizations/{organization}/locations/{location}/settings"
300+ };
301+
302+ // Output only. The resource name of the settings to retrieve.
303+ // Format:
304+ // organizations/{organization}/locations/{location}/settings.
305+ string name = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
306+
307+ // Required. Map of each notification type and its settings to get/set all
308+ // settings at once. The server will validate the value for each notification
309+ // type.
310+ map <string , NotificationSettings > notification_settings = 2
311+ [(google.api.field_behavior ) = REQUIRED ];
312+
313+ // Required. Fingerprint for optimistic concurrency returned in Get requests.
314+ // Must be provided for Update requests. If the value provided does not match
315+ // the value known to the server, ABORTED will be thrown, and the client
316+ // should retry the read-modify-write cycle.
317+ string etag = 3 [(google.api.field_behavior ) = REQUIRED ];
318+ }
319+
320+ // Settings for each NotificationType.
321+ message NotificationSettings {
322+ // Whether the associated NotificationType is enabled.
323+ bool enabled = 1 ;
324+ }
325+
326+ // Request of GetSettings endpoint.
327+ message GetSettingsRequest {
328+ // Required. The resource name of the settings to retrieve.
329+ // Format:
330+ // organizations/{organization}/locations/{location}/settings.
331+ string name = 1 [
332+ (google.api.field_behavior ) = REQUIRED ,
333+ (google.api.resource_reference ) = {
334+ type : "advisorynotifications.googleapis.com/Settings"
335+ }
336+ ];
337+ }
338+
339+ // Request of UpdateSettings endpoint.
340+ message UpdateSettingsRequest {
341+ // Required. New settings.
342+ Settings settings = 1 [(google.api.field_behavior ) = REQUIRED ];
343+ }
0 commit comments