Skip to content

Commit c981bf5

Browse files
Google APIscopybara-github
authored andcommitted
feat: add new RPCs GetSettings, UpdateSettings and new messages Settings, NotificationSettings, GetSettingsRequest, UpdateSettingsRequest
PiperOrigin-RevId: 568252764
1 parent 3cd21b1 commit c981bf5

2 files changed

Lines changed: 68 additions & 5 deletions

File tree

google/cloud/advisorynotifications/v1/advisorynotifications_v1.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ documentation:
1111

1212
authentication:
1313
rules:
14-
- selector: google.cloud.advisorynotifications.v1.AdvisoryNotificationsService.GetNotification
15-
oauth:
16-
canonical_scopes: |-
17-
https://www.googleapis.com/auth/cloud-platform
18-
- selector: google.cloud.advisorynotifications.v1.AdvisoryNotificationsService.ListNotifications
14+
- selector: 'google.cloud.advisorynotifications.v1.AdvisoryNotificationsService.*'
1915
oauth:
2016
canonical_scopes: |-
2117
https://www.googleapis.com/auth/cloud-platform

google/cloud/advisorynotifications/v1/service.proto

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)