From 9e59b13261111da71197061589a8716f0fb4cd4d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 4 Nov 2022 22:07:38 +0000 Subject: [PATCH] feat: Introduce the event publishing using JSON representation of CloudEvents Clients can now use either the Protobuf or the JSON CloudEvents representation when interacting with Eventarc Publishing API. This change benefits both Channel and ChannelConnection consumers. PiperOrigin-RevId: 486208303 Source-Link: https://github.com/googleapis/googleapis/commit/079ef843a85546a6d352f8936f5a8442c60f9601 Source-Link: https://github.com/googleapis/googleapis-gen/commit/dd62dfc174abb25bf2e50a2a54651da70daed781 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRXZlbnRhcmMuUHVibGlzaGluZy5WMS8uT3dsQm90LnlhbWwiLCJoIjoiZGQ2MmRmYzE3NGFiYjI1YmYyZTUwYTJhNTQ2NTFkYTcwZGFlZDc4MSJ9 --- ...ectionEventsRequestObjectAsyncSnippet.g.cs | 1 + ...lConnectionEventsRequestObjectSnippet.g.cs | 1 + ...ublishEventsRequestObjectAsyncSnippet.g.cs | 1 + ...ent.PublishEventsRequestObjectSnippet.g.cs | 1 + .../PublisherClientSnippets.g.cs | 4 + .../PublisherClientTest.g.cs | 16 +++ .../Publisher.g.cs | 121 ++++++++++++++---- .../PublisherGrpc.g.cs | 1 - 8 files changed, 119 insertions(+), 27 deletions(-) diff --git a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishChannelConnectionEventsRequestObjectAsyncSnippet.g.cs b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishChannelConnectionEventsRequestObjectAsyncSnippet.g.cs index 74b226de3d0e..5a42940d24c6 100644 --- a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishChannelConnectionEventsRequestObjectAsyncSnippet.g.cs +++ b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishChannelConnectionEventsRequestObjectAsyncSnippet.g.cs @@ -37,6 +37,7 @@ public async Task PublishChannelConnectionEventsRequestObjectAsync() { ChannelConnection = "", Events = { new Any(), }, + TextEvents = { "", }, }; // Make the request PublishChannelConnectionEventsResponse response = await publisherClient.PublishChannelConnectionEventsAsync(request); diff --git a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishChannelConnectionEventsRequestObjectSnippet.g.cs b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishChannelConnectionEventsRequestObjectSnippet.g.cs index 1da894aa09fc..21e4e971377e 100644 --- a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishChannelConnectionEventsRequestObjectSnippet.g.cs +++ b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishChannelConnectionEventsRequestObjectSnippet.g.cs @@ -36,6 +36,7 @@ public void PublishChannelConnectionEventsRequestObject() { ChannelConnection = "", Events = { new Any(), }, + TextEvents = { "", }, }; // Make the request PublishChannelConnectionEventsResponse response = publisherClient.PublishChannelConnectionEvents(request); diff --git a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishEventsRequestObjectAsyncSnippet.g.cs b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishEventsRequestObjectAsyncSnippet.g.cs index ab97489a8191..e18539fe55f5 100644 --- a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishEventsRequestObjectAsyncSnippet.g.cs +++ b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishEventsRequestObjectAsyncSnippet.g.cs @@ -37,6 +37,7 @@ public async Task PublishEventsRequestObjectAsync() { Channel = "", Events = { new Any(), }, + TextEvents = { "", }, }; // Make the request PublishEventsResponse response = await publisherClient.PublishEventsAsync(request); diff --git a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishEventsRequestObjectSnippet.g.cs b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishEventsRequestObjectSnippet.g.cs index 2cc83d4b0eca..c6070cfb3f6c 100644 --- a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishEventsRequestObjectSnippet.g.cs +++ b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.GeneratedSnippets/PublisherClient.PublishEventsRequestObjectSnippet.g.cs @@ -36,6 +36,7 @@ public void PublishEventsRequestObject() { Channel = "", Events = { new Any(), }, + TextEvents = { "", }, }; // Make the request PublishEventsResponse response = publisherClient.PublishEvents(request); diff --git a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.Snippets/PublisherClientSnippets.g.cs b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.Snippets/PublisherClientSnippets.g.cs index d0420e58d47b..3d7fd6a27867 100644 --- a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.Snippets/PublisherClientSnippets.g.cs +++ b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.Snippets/PublisherClientSnippets.g.cs @@ -33,6 +33,7 @@ public void PublishChannelConnectionEventsRequestObject() { ChannelConnection = "", Events = { new Any(), }, + TextEvents = { "", }, }; // Make the request PublishChannelConnectionEventsResponse response = publisherClient.PublishChannelConnectionEvents(request); @@ -51,6 +52,7 @@ public async Task PublishChannelConnectionEventsRequestObjectAsync() { ChannelConnection = "", Events = { new Any(), }, + TextEvents = { "", }, }; // Make the request PublishChannelConnectionEventsResponse response = await publisherClient.PublishChannelConnectionEventsAsync(request); @@ -68,6 +70,7 @@ public void PublishEventsRequestObject() { Channel = "", Events = { new Any(), }, + TextEvents = { "", }, }; // Make the request PublishEventsResponse response = publisherClient.PublishEvents(request); @@ -86,6 +89,7 @@ public async Task PublishEventsRequestObjectAsync() { Channel = "", Events = { new Any(), }, + TextEvents = { "", }, }; // Make the request PublishEventsResponse response = await publisherClient.PublishEventsAsync(request); diff --git a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.Tests/PublisherClientTest.g.cs b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.Tests/PublisherClientTest.g.cs index dc53ec935348..370576b1cfdd 100644 --- a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.Tests/PublisherClientTest.g.cs +++ b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1.Tests/PublisherClientTest.g.cs @@ -36,6 +36,10 @@ public void PublishChannelConnectionEventsRequestObject() { ChannelConnection = "channel_connection1ad4645e", Events = { new wkt::Any(), }, + TextEvents = + { + "text_events2754ee7c", + }, }; PublishChannelConnectionEventsResponse expectedResponse = new PublishChannelConnectionEventsResponse { }; mockGrpcClient.Setup(x => x.PublishChannelConnectionEvents(request, moq::It.IsAny())).Returns(expectedResponse); @@ -53,6 +57,10 @@ public void PublishChannelConnectionEventsRequestObject() { ChannelConnection = "channel_connection1ad4645e", Events = { new wkt::Any(), }, + TextEvents = + { + "text_events2754ee7c", + }, }; PublishChannelConnectionEventsResponse expectedResponse = new PublishChannelConnectionEventsResponse { }; mockGrpcClient.Setup(x => x.PublishChannelConnectionEventsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); @@ -72,6 +80,10 @@ public void PublishEventsRequestObject() { Channel = "channeledd285c4", Events = { new wkt::Any(), }, + TextEvents = + { + "text_events2754ee7c", + }, }; PublishEventsResponse expectedResponse = new PublishEventsResponse { }; mockGrpcClient.Setup(x => x.PublishEvents(request, moq::It.IsAny())).Returns(expectedResponse); @@ -89,6 +101,10 @@ public void PublishEventsRequestObject() { Channel = "channeledd285c4", Events = { new wkt::Any(), }, + TextEvents = + { + "text_events2754ee7c", + }, }; PublishEventsResponse expectedResponse = new PublishEventsResponse { }; mockGrpcClient.Setup(x => x.PublishEventsAsync(request, moq::It.IsAny())).Returns(new grpccore::AsyncUnaryCall(stt::Task.FromResult(expectedResponse), null, null, null, null)); diff --git a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1/Publisher.g.cs b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1/Publisher.g.cs index 4660ab2ba27f..4a14f4c72d29 100644 --- a/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1/Publisher.g.cs +++ b/apis/Google.Cloud.Eventarc.Publishing.V1/Google.Cloud.Eventarc.Publishing.V1/Publisher.g.cs @@ -27,38 +27,39 @@ public static partial class PublisherReflection { "CjNnb29nbGUvY2xvdWQvZXZlbnRhcmMvcHVibGlzaGluZy92MS9wdWJsaXNo", "ZXIucHJvdG8SI2dvb2dsZS5jbG91ZC5ldmVudGFyYy5wdWJsaXNoaW5nLnYx", "Ghxnb29nbGUvYXBpL2Fubm90YXRpb25zLnByb3RvGhdnb29nbGUvYXBpL2Ns", - "aWVudC5wcm90bxoZZ29vZ2xlL3Byb3RvYnVmL2FueS5wcm90byJpCiVQdWJs",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aW5nLnYx", + "LlB1Ymxpc2hDaGFubmVsQ29ubmVjdGlvbkV2ZW50c1Jlc3BvbnNlIl2C0+ST", + "AlciUi92MS97Y2hhbm5lbF9jb25uZWN0aW9uPXByb2plY3RzLyovbG9jYXRp", + "b25zLyovY2hhbm5lbENvbm5lY3Rpb25zLyp9OnB1Ymxpc2hFdmVudHM6ASoS", + "0AEKDVB1Ymxpc2hFdmVudHMSOS5nb29nbGUuY2xvdWQuZXZlbnRhcmMucHVi", + "bGlzaGluZy52MS5QdWJsaXNoRXZlbnRzUmVxdWVzdBo6Lmdvb2dsZS5jbG91", + "ZC5ldmVudGFyYy5wdWJsaXNoaW5nLnYxLlB1Ymxpc2hFdmVudHNSZXNwb25z", + "ZSJIgtPkkwJCIj0vdjEve2NoYW5uZWw9cHJvamVjdHMvKi9sb2NhdGlvbnMv", + "Ki9jaGFubmVscy8qfTpwdWJsaXNoRXZlbnRzOgEqGlXKQSFldmVudGFyY3B1", + "Ymxpc2hpbmcuZ29vZ2xlYXBpcy5jb23SQS5odHRwczovL3d3dy5nb29nbGVh", + "cGlzLmNvbS9hdXRoL2Nsb3VkLXBsYXRmb3JtQv8BCidjb20uZ29vZ2xlLmNs", + "b3VkLmV2ZW50YXJjLnB1Ymxpc2hpbmcudjFCDlB1Ymxpc2hlclByb3RvUAFa", + "TGdvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvY2xvdWQv", + "ZXZlbnRhcmMvcHVibGlzaGluZy92MTtwdWJsaXNoZXKqAiNHb29nbGUuQ2xv", + "dWQuRXZlbnRhcmMuUHVibGlzaGluZy5WMcoCI0dvb2dsZVxDbG91ZFxFdmVu", + "dGFyY1xQdWJsaXNoaW5nXFYx6gInR29vZ2xlOjpDbG91ZDo6RXZlbnRhcmM6", + "OlB1Ymxpc2hpbmc6OlYxYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Api.ClientReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.AnyReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Eventarc.Publishing.V1.PublishChannelConnectionEventsRequest), global::Google.Cloud.Eventarc.Publishing.V1.PublishChannelConnectionEventsRequest.Parser, new[]{ "ChannelConnection", "Events" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Eventarc.Publishing.V1.PublishChannelConnectionEventsRequest), global::Google.Cloud.Eventarc.Publishing.V1.PublishChannelConnectionEventsRequest.Parser, new[]{ "ChannelConnection", "Events", "TextEvents" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Eventarc.Publishing.V1.PublishChannelConnectionEventsResponse), global::Google.Cloud.Eventarc.Publishing.V1.PublishChannelConnectionEventsResponse.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Eventarc.Publishing.V1.PublishEventsRequest), global::Google.Cloud.Eventarc.Publishing.V1.PublishEventsRequest.Parser, new[]{ "Channel", "Events" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Eventarc.Publishing.V1.PublishEventsRequest), global::Google.Cloud.Eventarc.Publishing.V1.PublishEventsRequest.Parser, new[]{ "Channel", "Events", "TextEvents" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Eventarc.Publishing.V1.PublishEventsResponse), global::Google.Cloud.Eventarc.Publishing.V1.PublishEventsResponse.Parser, null, null, null, null, null) })); } @@ -105,6 +106,7 @@ public sealed partial class PublishChannelConnectionEventsRequest : pb::IMessage public PublishChannelConnectionEventsRequest(PublishChannelConnectionEventsRequest other) : this() { channelConnection_ = other.channelConnection_; events_ = other.events_.Clone(); + textEvents_ = other.textEvents_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -137,6 +139,7 @@ public sealed partial class PublishChannelConnectionEventsRequest : pb::IMessage private readonly pbc::RepeatedField events_ = new pbc::RepeatedField(); /// /// 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. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -144,6 +147,24 @@ public sealed partial class PublishChannelConnectionEventsRequest : pb::IMessage get { return events_; } } + /// Field number for the "text_events" field. + public const int TextEventsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_textEvents_codec + = pb::FieldCodec.ForString(26); + private readonly pbc::RepeatedField textEvents_ = new pbc::RepeatedField(); + /// + /// 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. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TextEvents { + get { return textEvents_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -161,6 +182,7 @@ public sealed partial class PublishChannelConnectionEventsRequest : pb::IMessage } if (ChannelConnection != other.ChannelConnection) return false; if(!events_.Equals(other.events_)) return false; + if(!textEvents_.Equals(other.textEvents_)) return false; return Equals(_unknownFields, other._unknownFields); } @@ -170,6 +192,7 @@ public sealed partial class PublishChannelConnectionEventsRequest : pb::IMessage int hash = 1; if (ChannelConnection.Length != 0) hash ^= ChannelConnection.GetHashCode(); hash ^= events_.GetHashCode(); + hash ^= textEvents_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -193,6 +216,7 @@ public sealed partial class PublishChannelConnectionEventsRequest : pb::IMessage output.WriteString(ChannelConnection); } events_.WriteTo(output, _repeated_events_codec); + textEvents_.WriteTo(output, _repeated_textEvents_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -208,6 +232,7 @@ public sealed partial class PublishChannelConnectionEventsRequest : pb::IMessage output.WriteString(ChannelConnection); } events_.WriteTo(ref output, _repeated_events_codec); + textEvents_.WriteTo(ref output, _repeated_textEvents_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -222,6 +247,7 @@ public sealed partial class PublishChannelConnectionEventsRequest : pb::IMessage size += 1 + pb::CodedOutputStream.ComputeStringSize(ChannelConnection); } size += events_.CalculateSize(_repeated_events_codec); + size += textEvents_.CalculateSize(_repeated_textEvents_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -238,6 +264,7 @@ public sealed partial class PublishChannelConnectionEventsRequest : pb::IMessage ChannelConnection = other.ChannelConnection; } events_.Add(other.events_); + textEvents_.Add(other.textEvents_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -261,6 +288,10 @@ public sealed partial class PublishChannelConnectionEventsRequest : pb::IMessage events_.AddEntriesFrom(input, _repeated_events_codec); break; } + case 26: { + textEvents_.AddEntriesFrom(input, _repeated_textEvents_codec); + break; + } } } #endif @@ -284,6 +315,10 @@ public sealed partial class PublishChannelConnectionEventsRequest : pb::IMessage events_.AddEntriesFrom(ref input, _repeated_events_codec); break; } + case 26: { + textEvents_.AddEntriesFrom(ref input, _repeated_textEvents_codec); + break; + } } } } @@ -485,6 +520,7 @@ public sealed partial class PublishEventsRequest : pb::IMessage events_ = new pbc::RepeatedField(); /// /// 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. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -524,6 +561,24 @@ public sealed partial class PublishEventsRequest : pb::IMessageField number for the "text_events" field. + public const int TextEventsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_textEvents_codec + = pb::FieldCodec.ForString(26); + private readonly pbc::RepeatedField textEvents_ = new pbc::RepeatedField(); + /// + /// 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. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TextEvents { + get { return textEvents_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -541,6 +596,7 @@ public sealed partial class PublishEventsRequest : pb::IMessage