Skip to content

Commit

Permalink
feat: Introduce the event publishing using JSON representation of Clo…
Browse files Browse the repository at this point in the history
…udEvents

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: googleapis/googleapis@079ef84

Source-Link: googleapis/googleapis-gen@dd62dfc
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRXZlbnRhcmMuUHVibGlzaGluZy5WMS8uT3dsQm90LnlhbWwiLCJoIjoiZGQ2MmRmYzE3NGFiYjI1YmYyZTUwYTJhNTQ2NTFkYTcwZGFlZDc4MSJ9
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Nov 7, 2022
1 parent e832ba9 commit 9e59b13
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public async Task PublishChannelConnectionEventsRequestObjectAsync()
{
ChannelConnection = "",
Events = { new Any(), },
TextEvents = { "", },
};
// Make the request
PublishChannelConnectionEventsResponse response = await publisherClient.PublishChannelConnectionEventsAsync(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void PublishChannelConnectionEventsRequestObject()
{
ChannelConnection = "",
Events = { new Any(), },
TextEvents = { "", },
};
// Make the request
PublishChannelConnectionEventsResponse response = publisherClient.PublishChannelConnectionEvents(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public async Task PublishEventsRequestObjectAsync()
{
Channel = "",
Events = { new Any(), },
TextEvents = { "", },
};
// Make the request
PublishEventsResponse response = await publisherClient.PublishEventsAsync(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void PublishEventsRequestObject()
{
Channel = "",
Events = { new Any(), },
TextEvents = { "", },
};
// Make the request
PublishEventsResponse response = publisherClient.PublishEvents(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public void PublishChannelConnectionEventsRequestObject()
{
ChannelConnection = "",
Events = { new Any(), },
TextEvents = { "", },
};
// Make the request
PublishChannelConnectionEventsResponse response = publisherClient.PublishChannelConnectionEvents(request);
Expand All @@ -51,6 +52,7 @@ public async Task PublishChannelConnectionEventsRequestObjectAsync()
{
ChannelConnection = "",
Events = { new Any(), },
TextEvents = { "", },
};
// Make the request
PublishChannelConnectionEventsResponse response = await publisherClient.PublishChannelConnectionEventsAsync(request);
Expand All @@ -68,6 +70,7 @@ public void PublishEventsRequestObject()
{
Channel = "",
Events = { new Any(), },
TextEvents = { "", },
};
// Make the request
PublishEventsResponse response = publisherClient.PublishEvents(request);
Expand All @@ -86,6 +89,7 @@ public async Task PublishEventsRequestObjectAsync()
{
Channel = "",
Events = { new Any(), },
TextEvents = { "", },
};
// Make the request
PublishEventsResponse response = await publisherClient.PublishEventsAsync(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<grpccore::CallOptions>())).Returns(expectedResponse);
Expand All @@ -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<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<PublishChannelConnectionEventsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
Expand All @@ -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<grpccore::CallOptions>())).Returns(expectedResponse);
Expand All @@ -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<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<PublishEventsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
Expand Down

0 comments on commit 9e59b13

Please sign in to comment.