• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14syntax = "proto3";
15
16package google.cloud.eventarc.publishing.v1;
17
18import "google/api/annotations.proto";
19import "google/api/client.proto";
20import "google/protobuf/any.proto";
21
22option csharp_namespace = "Google.Cloud.Eventarc.Publishing.V1";
23option go_package = "cloud.google.com/go/eventarc/publishing/apiv1/publishingpb;publishingpb";
24option java_multiple_files = true;
25option java_outer_classname = "PublisherProto";
26option java_package = "com.google.cloud.eventarc.publishing.v1";
27option php_namespace = "Google\\Cloud\\Eventarc\\Publishing\\V1";
28option ruby_package = "Google::Cloud::Eventarc::Publishing::V1";
29
30// Eventarc processes events generated by an event provider and delivers them to
31// a subscriber.
32//
33// An event provider is a software-as-a-service (SaaS) system or
34// product that can generate and deliver events through Eventarc.
35//
36// A third-party event provider is an event provider from outside of Google.
37//
38// A partner is a third-party event provider that is integrated with Eventarc.
39//
40// A subscriber is a GCP customer interested in receiving events.
41//
42// Channel is a first-class Eventarc resource that is created and managed
43// by the subscriber in their GCP project. A Channel represents a subscriber's
44// intent to receive events from an event provider. A Channel is associated with
45// exactly one event provider.
46//
47// ChannelConnection is a first-class Eventarc resource that
48// is created and managed by the partner in their GCP project. A
49// ChannelConnection represents a connection between a partner and a
50// subscriber's Channel. A ChannelConnection has a one-to-one mapping with a
51// Channel.
52//
53// Publisher allows an event provider to publish events to Eventarc.
54service Publisher {
55  option (google.api.default_host) = "eventarcpublishing.googleapis.com";
56  option (google.api.oauth_scopes) =
57      "https://www.googleapis.com/auth/cloud-platform";
58
59  // Publish events to a ChannelConnection in a partner's project.
60  rpc PublishChannelConnectionEvents(PublishChannelConnectionEventsRequest)
61      returns (PublishChannelConnectionEventsResponse) {
62    option (google.api.http) = {
63      post: "/v1/{channel_connection=projects/*/locations/*/channelConnections/*}:publishEvents"
64      body: "*"
65    };
66  }
67  // Publish events to a subscriber's channel.
68  rpc PublishEvents(PublishEventsRequest) returns (PublishEventsResponse) {
69    option (google.api.http) = {
70      post: "/v1/{channel=projects/*/locations/*/channels/*}:publishEvents"
71      body: "*"
72    };
73  }
74}
75// The request message for the PublishChannelConnectionEvents method.
76message PublishChannelConnectionEventsRequest {
77  // The channel_connection that the events are published from. For example:
78  // `projects/{partner_project_id}/locations/{location}/channelConnections/{channel_connection_id}`.
79  string channel_connection = 1;
80  // The CloudEvents v1.0 events to publish. No other types are allowed.
81  // If this field is set, then the `text_events` fields must not be set.
82  repeated google.protobuf.Any events = 2;
83  // The text representation of events to publish.
84  // CloudEvent v1.0 in JSON format is the only allowed type. Refer to
85  // https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
86  // for specification.
87  // If this field is set, then the `events` fields must not be set.
88  repeated string text_events = 3;
89}
90// The response message for the PublishChannelConnectionEvents method.
91message PublishChannelConnectionEventsResponse {}
92// The request message for the PublishEvents method.
93message PublishEventsRequest {
94  // The full name of the channel to publish to. For example:
95  // `projects/{project}/locations/{location}/channels/{channel-id}`.
96  string channel = 1;
97  // The CloudEvents v1.0 events to publish. No other types are allowed.
98  // If this field is set, then the `text_events` fields must not be set.
99  repeated google.protobuf.Any events = 2;
100  // The text representation of events to publish.
101  // CloudEvent v1.0 in JSON format is the only allowed type. Refer to
102  // https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
103  // for specification.
104  // If this field is set, then the `events` fields must not be set.
105  repeated string text_events = 3;
106}
107// The response message for the PublishEvents method.
108message PublishEventsResponse {}
109