Skip to content

Commit

Permalink
feat: add new RPCs GetSettings, UpdateSettings and new messages Setti…
Browse files Browse the repository at this point in the history
…ngs, NotificationSettings, GetSettingsRequest, UpdateSettingsRequest

PiperOrigin-RevId: 568252764
  • Loading branch information
Google APIs authored and Copybara-Service committed Sep 25, 2023
1 parent 3cd21b1 commit c981bf5
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ documentation:

authentication:
rules:
- selector: google.cloud.advisorynotifications.v1.AdvisoryNotificationsService.GetNotification
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.advisorynotifications.v1.AdvisoryNotificationsService.ListNotifications
- selector: 'google.cloud.advisorynotifications.v1.AdvisoryNotificationsService.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
Expand Down
67 changes: 67 additions & 0 deletions google/cloud/advisorynotifications/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@ service AdvisoryNotificationsService {
};
option (google.api.method_signature) = "name";
}

// Get notification settings.
rpc GetSettings(GetSettingsRequest) returns (Settings) {
option (google.api.http) = {
get: "/v1/{name=organizations/*/locations/*/settings}"
};
option (google.api.method_signature) = "name";
}

// Update notification settings.
rpc UpdateSettings(UpdateSettingsRequest) returns (Settings) {
option (google.api.http) = {
patch: "/v1/{settings.name=organizations/*/locations/*/settings}"
body: "settings"
};
option (google.api.method_signature) = "settings";
}
}

// Notification view.
Expand Down Expand Up @@ -274,3 +291,53 @@ message GetNotificationRequest {
// this RPC will throw an error.
string language_code = 5;
}

// Settings for Advisory Notifications.
message Settings {
option (google.api.resource) = {
type: "advisorynotifications.googleapis.com/Settings"
pattern: "organizations/{organization}/locations/{location}/settings"
};

// Output only. The resource name of the settings to retrieve.
// Format:
// organizations/{organization}/locations/{location}/settings.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Required. Map of each notification type and its settings to get/set all
// settings at once. The server will validate the value for each notification
// type.
map<string, NotificationSettings> notification_settings = 2
[(google.api.field_behavior) = REQUIRED];

// Required. Fingerprint for optimistic concurrency returned in Get requests.
// Must be provided for Update requests. If the value provided does not match
// the value known to the server, ABORTED will be thrown, and the client
// should retry the read-modify-write cycle.
string etag = 3 [(google.api.field_behavior) = REQUIRED];
}

// Settings for each NotificationType.
message NotificationSettings {
// Whether the associated NotificationType is enabled.
bool enabled = 1;
}

// Request of GetSettings endpoint.
message GetSettingsRequest {
// Required. The resource name of the settings to retrieve.
// Format:
// organizations/{organization}/locations/{location}/settings.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "advisorynotifications.googleapis.com/Settings"
}
];
}

// Request of UpdateSettings endpoint.
message UpdateSettingsRequest {
// Required. New settings.
Settings settings = 1 [(google.api.field_behavior) = REQUIRED];
}

0 comments on commit c981bf5

Please sign in to comment.