publisher.proto 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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.
  14. syntax = "proto3";
  15. package google.cloud.eventarc.publishing.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/protobuf/any.proto";
  19. option csharp_namespace = "Google.Cloud.Eventarc.Publishing.V1";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/eventarc/publishing/v1;publisher";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "PublisherProto";
  23. option java_package = "com.google.cloud.eventarc.publishing.v1";
  24. option php_namespace = "Google\\Cloud\\Eventarc\\Publishing\\V1";
  25. option ruby_package = "Google::Cloud::Eventarc::Publishing::V1";
  26. // Eventarc processes events generated by an event provider and delivers them to
  27. // a subscriber.
  28. //
  29. // An event provider is a software-as-a-service (SaaS) system or
  30. // product that can generate and deliver events through Eventarc.
  31. //
  32. // A third-party event provider is an event provider from outside of Google.
  33. //
  34. // A partner is a third-party event provider that is integrated with Eventarc.
  35. //
  36. // A subscriber is a GCP customer interested in receiving events.
  37. //
  38. // Channel is a first-class Eventarc resource that is created and managed
  39. // by the subscriber in their GCP project. A Channel represents a subscriber's
  40. // intent to receive events from an event provider. A Channel is associated with
  41. // exactly one event provider.
  42. //
  43. // ChannelConnection is a first-class Eventarc resource that
  44. // is created and managed by the partner in their GCP project. A
  45. // ChannelConnection represents a connection between a partner and a
  46. // subscriber's Channel. A ChannelConnection has a one-to-one mapping with a
  47. // Channel.
  48. //
  49. // Publisher allows an event provider to publish events to Eventarc.
  50. service Publisher {
  51. option (google.api.default_host) = "eventarcpublishing.googleapis.com";
  52. option (google.api.oauth_scopes) =
  53. "https://www.googleapis.com/auth/cloud-platform";
  54. // Publish events to a ChannelConnection in a partner's project.
  55. rpc PublishChannelConnectionEvents(PublishChannelConnectionEventsRequest)
  56. returns (PublishChannelConnectionEventsResponse) {
  57. option (google.api.http) = {
  58. post: "/v1/{channel_connection=projects/*/locations/*/channelConnections/*}:publishEvents"
  59. body: "*"
  60. };
  61. }
  62. // Publish events to a subscriber's channel.
  63. rpc PublishEvents(PublishEventsRequest) returns (PublishEventsResponse) {
  64. option (google.api.http) = {
  65. post: "/v1/{channel=projects/*/locations/*/channels/*}:publishEvents"
  66. body: "*"
  67. };
  68. }
  69. }
  70. // The request message for the PublishChannelConnectionEvents method.
  71. message PublishChannelConnectionEventsRequest {
  72. // The channel_connection that the events are published from. For example:
  73. // `projects/{partner_project_id}/locations/{location}/channelConnections/{channel_connection_id}`.
  74. string channel_connection = 1;
  75. // The CloudEvents v1.0 events to publish. No other types are allowed.
  76. // If this field is set, then the `text_events` fields must not be set.
  77. repeated google.protobuf.Any events = 2;
  78. // The text representation of events to publish.
  79. // CloudEvent v1.0 in JSON format is the only allowed type. Refer to
  80. // https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
  81. // for specification.
  82. // If this field is set, then the `events` fields must not be set.
  83. repeated string text_events = 3;
  84. }
  85. // The response message for the PublishChannelConnectionEvents method.
  86. message PublishChannelConnectionEventsResponse {}
  87. // The request message for the PublishEvents method.
  88. message PublishEventsRequest {
  89. // The full name of the channel to publish to. For example:
  90. // `projects/{project}/locations/{location}/channels/{channel-id}`.
  91. string channel = 1;
  92. // The CloudEvents v1.0 events to publish. No other types are allowed.
  93. // If this field is set, then the `text_events` fields must not be set.
  94. repeated google.protobuf.Any events = 2;
  95. // The text representation of events to publish.
  96. // CloudEvent v1.0 in JSON format is the only allowed type. Refer to
  97. // https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md
  98. // for specification.
  99. // If this field is set, then the `events` fields must not be set.
  100. repeated string text_events = 3;
  101. }
  102. // The response message for the PublishEvents method.
  103. message PublishEventsResponse {}