Skip to content

Commit

Permalink
feat: [advisorynotifications] adding project level methods to advisor…
Browse files Browse the repository at this point in the history
…ynotifications.googleapis.com (#4874)

* feat: adding project level methods to advisorynotifications.googleapis.com

docs: adding docs for new project level methods

adding GetNotification and ListNotifications methods for notifications parented at the project level

PiperOrigin-RevId: 588795150

Source-Link: googleapis/googleapis@967b05b

Source-Link: googleapis/googleapis-gen@bdd6f86
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFkdmlzb3J5bm90aWZpY2F0aW9ucy8uT3dsQm90LnlhbWwiLCJoIjoiYmRkNmY4NmI4NzFiMTdkZmQ0MTBlYzNhMjE3NjFmM2Y2NGQ4MjI3NyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Dec 11, 2023
1 parent 52f3cd5 commit 49f2918
Show file tree
Hide file tree
Showing 9 changed files with 276 additions and 125 deletions.
5 changes: 2 additions & 3 deletions packages/google-cloud-advisorynotifications/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ async function callListNotifications() {
};

// Run request
const iterable = await advisorynotificationsClient.listNotificationsAsync(
request
);
const iterable =
await advisorynotificationsClient.listNotificationsAsync(request);
for await (const response of iterable) {
console.log(response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ option ruby_package = "Google::Cloud::AdvisoryNotifications::V1";
option (google.api.resource_definition) = {
type: "advisorynotifications.googleapis.com/Location"
pattern: "organizations/{organization}/locations/{location}"
pattern: "projects/{project}/locations/{location}"
};

// Service to manage Security and Privacy Notifications.
Expand All @@ -45,6 +46,9 @@ service AdvisoryNotificationsService {
returns (ListNotificationsResponse) {
option (google.api.http) = {
get: "/v1/{parent=organizations/*/locations/*}/notifications"
additional_bindings {
get: "/v1/{parent=projects/*/locations/*}/notifications"
}
};
option (google.api.method_signature) = "parent";
}
Expand All @@ -53,6 +57,9 @@ service AdvisoryNotificationsService {
rpc GetNotification(GetNotificationRequest) returns (Notification) {
option (google.api.http) = {
get: "/v1/{name=organizations/*/locations/*/notifications/*}"
additional_bindings {
get: "/v1/{name=projects/*/locations/*/notifications/*}"
}
};
option (google.api.method_signature) = "name";
}
Expand Down Expand Up @@ -133,13 +140,15 @@ message Notification {
option (google.api.resource) = {
type: "advisorynotifications.googleapis.com/Notification"
pattern: "organizations/{organization}/locations/{location}/notifications/{notification}"
pattern: "projects/{project}/locations/{location}/notifications/{notification}"
plural: "notifications"
singular: "notification"
};

// The resource name of the notification.
// Format:
// organizations/{organization}/locations/{location}/notifications/{notification}.
// organizations/{organization}/locations/{location}/notifications/{notification}
// or projects/{project}/locations/{location}/notifications/{notification}.
string name = 1;

// The subject line of the notification.
Expand Down Expand Up @@ -228,7 +237,8 @@ message Csv {
// Request for fetching all notifications for a given parent.
message ListNotificationsRequest {
// Required. The parent, which owns this collection of notifications.
// Must be of the form "organizations/{organization}/locations/{location}".
// Must be of the form "organizations/{organization}/locations/{location}"
// or "projects/{project}/locations/{location}"
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -276,7 +286,8 @@ message ListNotificationsResponse {
message GetNotificationRequest {
// Required. A name of the notification to retrieve.
// Format:
// organizations/{organization}/locations/{location}/notifications/{notification}.
// organizations/{organization}/locations/{location}/notifications/{notification}
// or projects/{projects}/locations/{location}/notifications/{notification}.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down
16 changes: 12 additions & 4 deletions packages/google-cloud-advisorynotifications/protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function main(name) {
/**
* Required. A name of the notification to retrieve.
* Format:
* organizations/{organization}/locations/{location}/notifications/{notification}.
* organizations/{organization}/locations/{location}/notifications/{notification}
* or projects/{projects}/locations/{location}/notifications/{notification}.
*/
// const name = 'abc123'
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function main(parent) {
*/
/**
* Required. The parent, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}".
* Must be of the form "organizations/{organization}/locations/{location}"
* or "projects/{project}/locations/{location}"
*/
// const parent = 'abc123'
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"segments": [
{
"start": 25,
"end": 82,
"end": 83,
"type": "FULL"
}
],
Expand Down Expand Up @@ -78,7 +78,7 @@
"segments": [
{
"start": 25,
"end": 63,
"end": 64,
"type": "FULL"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ function main(parent) {
};

// Run request
const iterable = await advisorynotificationsClient.listNotificationsAsync(
request
);
const iterable =
await advisorynotificationsClient.listNotificationsAsync(request);
for await (const response of iterable) {
console.log(response);
}
Expand Down
Loading

0 comments on commit 49f2918

Please sign in to comment.