Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [eventarc-publishing,securitycentermanagement] Add GroundedGenerationService API #5778

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/google-cloud-eventarc-publishing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
1. [Select or create a Cloud Platform project][projects].
1. [Enable billing for your project][billing].
1. [Enable the Eventarc Publishing API API][enable_api].
1. [Set up authentication with a service account][auth] so you can access the
1. [Set up authentication][auth] so you can access the
API from your local workstation.

### Installing the client library
Expand All @@ -62,6 +62,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Publisher.publish | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish.js,packages/google-cloud-eventarc-publishing/samples/README.md) |
| Publisher.publish_channel_connection_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish_channel_connection_events.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish_channel_connection_events.js,packages/google-cloud-eventarc-publishing/samples/README.md) |
| Publisher.publish_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish_events.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish_events.js,packages/google-cloud-eventarc-publishing/samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-eventarc-publishing/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-eventarc-publishing/samples/quickstart.js,packages/google-cloud-eventarc-publishing/samples/README.md) |
Expand Down Expand Up @@ -134,4 +135,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)
[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=eventarcpublishing.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/getting-started
[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.eventarc.publishing.v1;

import "google/api/field_behavior.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.Eventarc.Publishing.V1";
option go_package = "cloud.google.com/go/eventarc/publishing/apiv1/publishingpb;publishingpb";
option java_multiple_files = true;
option java_outer_classname = "CloudEventProto";
option java_package = "com.google.cloud.eventarc.publishing.v1";
option php_namespace = "Google\\Cloud\\Eventarc\\Publishing\\V1";
option ruby_package = "Google::Cloud::Eventarc::Publishing::V1";

// CloudEvent represents a vendor-neutral specification for defining the format
// of event data.
message CloudEvent {
// The following abstract data types are available for use in attributes.
message CloudEventAttributeValue {
// The value of the attribute.
oneof attr {
// Boolean value.
bool ce_boolean = 1;

// Integer value.
int32 ce_integer = 2;

// String value.
string ce_string = 3;

// Bytes value.
bytes ce_bytes = 4;

// URI value.
string ce_uri = 5;

// URI-reference value.
string ce_uri_ref = 6;

// Timestamp value.
google.protobuf.Timestamp ce_timestamp = 7;
}
}

// Required. Identifies the event. Producers MUST ensure that source + id is
// unique for each distinct event.
string id = 1 [(google.api.field_behavior) = REQUIRED];

// Required. Identifies the context in which an event happened.
// URI-reference
string source = 2 [(google.api.field_behavior) = REQUIRED];

// Required. The version of the CloudEvents specification which the event
// uses.
string spec_version = 3 [(google.api.field_behavior) = REQUIRED];

// Required. This attribute contains a value describing the type of event
// related to the originating occurrence.
string type = 4 [(google.api.field_behavior) = REQUIRED];

// Optional. Used for Optional & Extension Attributes
map<string, CloudEventAttributeValue> attributes = 5
[(google.api.field_behavior) = OPTIONAL];

// The event payload. It should be encoded into a media format which is
// specified by the 'datacontenttype' attribute (e.g. application/json), and
// adheres to the dataschema format when those respective attributes are
// present.
oneof data {
// Optional. Binary data.
bytes binary_data = 6 [(google.api.field_behavior) = OPTIONAL];

// Optional. Text data.
string text_data = 7 [(google.api.field_behavior) = OPTIONAL];

// Optional. Proto data.
google.protobuf.Any proto_data = 8 [(google.api.field_behavior) = OPTIONAL];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.eventarc.publishing.v1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/field_info.proto";
import "google/cloud/eventarc/publishing/v1/cloud_event.proto";
import "google/protobuf/any.proto";

option csharp_namespace = "Google.Cloud.Eventarc.Publishing.V1";
Expand Down Expand Up @@ -64,45 +68,89 @@ service Publisher {
body: "*"
};
}

// Publish events to a subscriber's channel.
rpc PublishEvents(PublishEventsRequest) returns (PublishEventsResponse) {
option (google.api.http) = {
post: "/v1/{channel=projects/*/locations/*/channels/*}:publishEvents"
body: "*"
};
}

// Publish events to a message bus.
rpc Publish(PublishRequest) returns (PublishResponse) {
option (google.api.http) = {
post: "/v1/{message_bus=projects/*/locations/*/messageBuses/*}:publish"
body: "*"
};
}
}

// The request message for the PublishChannelConnectionEvents method.
message PublishChannelConnectionEventsRequest {
// The channel_connection that the events are published from. For example:
// `projects/{partner_project_id}/locations/{location}/channelConnections/{channel_connection_id}`.
string channel_connection = 1;

// The CloudEvents v1.0 events to publish. No other types are allowed.
// If this field is set, then the `text_events` fields must not be set.
repeated google.protobuf.Any events = 2;

// The text representation of events to publish.
// CloudEvent v1.0 in JSON format is the only allowed type. Refer to
// https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
// for specification.
// If this field is set, then the `events` fields must not be set.
repeated string text_events = 3;
}

// The response message for the PublishChannelConnectionEvents method.
message PublishChannelConnectionEventsResponse {}

// The request message for the PublishEvents method.
message PublishEventsRequest {
// The full name of the channel to publish to. For example:
// `projects/{project}/locations/{location}/channels/{channel-id}`.
string channel = 1;

// The CloudEvents v1.0 events to publish. No other types are allowed.
// If this field is set, then the `text_events` fields must not be set.
repeated google.protobuf.Any events = 2;

// The text representation of events to publish.
// CloudEvent v1.0 in JSON format is the only allowed type. Refer to
// https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
// for specification.
// If this field is set, then the `events` fields must not be set.
repeated string text_events = 3;
}

// The response message for the PublishEvents method.
message PublishEventsResponse {}

// The request message for the Publish method.
message PublishRequest {
// Required. The full name of the message bus to publish events to. Format:
// `projects/{project}/locations/{location}/messageBuses/{messageBus}`.
string message_bus = 1 [(google.api.field_behavior) = REQUIRED];

oneof format {
// The Protobuf format of the CloudEvent being published. Specification can
// be found here:
// https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/protobuf-format.md
CloudEvent proto_message = 2;

// The JSON format of the CloudEvent being published. Specification can be
// found here:
// https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
string json_message = 3;

// The Avro format of the CloudEvent being published. Specification can
// be found here:
// https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-format.md
bytes avro_message = 4;
}
}

// The response message for the Publish method.
message PublishResponse {}
Loading
Loading