Skip to content

Commit

Permalink
feat: Add topic retention options
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 389879008

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Aug 10 07:28:42 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 7b6a2ceed6cacf676b3918b1703b3ddd6322444c
Source-Link: googleapis/googleapis@7b6a2ce
  • Loading branch information
yoshi-automation authored and jskeet committed Aug 10, 2021
1 parent 9c8f71f commit 4cc3e58
Show file tree
Hide file tree
Showing 8 changed files with 388 additions and 238 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public void CreateTopicRequestObject()
KmsKeyName = "",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new Duration(),
};
// Make the request
Topic response = publisherServiceApiClient.CreateTopic(request);
Expand All @@ -64,6 +65,7 @@ public async Task CreateTopicRequestObjectAsync()
KmsKeyName = "",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new Duration(),
};
// Make the request
Topic response = await publisherServiceApiClient.CreateTopicAsync(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public void CreateSubscriptionRequestObject()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new Duration(),
};
// Make the request
Subscription response = subscriberServiceApiClient.CreateSubscription(request);
Expand Down Expand Up @@ -79,6 +80,7 @@ public async Task CreateSubscriptionRequestObjectAsync()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new Duration(),
};
// Make the request
Subscription response = await subscriberServiceApiClient.CreateSubscriptionAsync(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public void CreateTopicRequestObject()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
Topic expectedResponse = new Topic
{
Expand All @@ -60,6 +61,7 @@ public void CreateTopicRequestObject()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateTopic(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand All @@ -86,6 +88,7 @@ public void CreateTopicRequestObject()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
Topic expectedResponse = new Topic
{
Expand All @@ -101,6 +104,7 @@ public void CreateTopicRequestObject()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateTopicAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Topic>(stt::Task.FromResult(expectedResponse), null, null, null, null));
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -133,6 +137,7 @@ public void CreateTopic()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateTopic(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -163,6 +168,7 @@ public void CreateTopic()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateTopicAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Topic>(stt::Task.FromResult(expectedResponse), null, null, null, null));
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -195,6 +201,7 @@ public void CreateTopicResourceNames()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateTopic(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -225,6 +232,7 @@ public void CreateTopicResourceNames()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateTopicAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Topic>(stt::Task.FromResult(expectedResponse), null, null, null, null));
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -258,6 +266,7 @@ public void UpdateTopicRequestObject()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.UpdateTopic(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -289,6 +298,7 @@ public void UpdateTopicRequestObject()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.UpdateTopicAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Topic>(stt::Task.FromResult(expectedResponse), null, null, null, null));
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -483,6 +493,7 @@ public void GetTopicRequestObject()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetTopic(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -513,6 +524,7 @@ public void GetTopicRequestObject()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetTopicAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Topic>(stt::Task.FromResult(expectedResponse), null, null, null, null));
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -545,6 +557,7 @@ public void GetTopic()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetTopic(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -575,6 +588,7 @@ public void GetTopic()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetTopicAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Topic>(stt::Task.FromResult(expectedResponse), null, null, null, null));
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -607,6 +621,7 @@ public void GetTopicResourceNames()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetTopic(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -637,6 +652,7 @@ public void GetTopicResourceNames()
KmsKeyName = "kms_key_name06bd122b",
SchemaSettings = new SchemaSettings(),
SatisfiesPzs = false,
MessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetTopicAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Topic>(stt::Task.FromResult(expectedResponse), null, null, null, null));
PublisherServiceApiClient client = new PublisherServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void CreateSubscriptionRequestObject()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
Subscription expectedResponse = new Subscription
{
Expand All @@ -74,6 +75,7 @@ public void CreateSubscriptionRequestObject()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateSubscription(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -107,6 +109,7 @@ public void CreateSubscriptionRequestObject()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
Subscription expectedResponse = new Subscription
{
Expand All @@ -129,6 +132,7 @@ public void CreateSubscriptionRequestObject()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateSubscriptionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Subscription>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -171,6 +175,7 @@ public void CreateSubscription()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateSubscription(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -211,6 +216,7 @@ public void CreateSubscription()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateSubscriptionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Subscription>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -253,6 +259,7 @@ public void CreateSubscriptionResourceNames()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateSubscription(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -293,6 +300,7 @@ public void CreateSubscriptionResourceNames()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.CreateSubscriptionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Subscription>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -332,6 +340,7 @@ public void GetSubscriptionRequestObject()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetSubscription(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -369,6 +378,7 @@ public void GetSubscriptionRequestObject()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetSubscriptionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Subscription>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -408,6 +418,7 @@ public void GetSubscription()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetSubscription(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -445,6 +456,7 @@ public void GetSubscription()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetSubscriptionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Subscription>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -484,6 +496,7 @@ public void GetSubscriptionResourceNames()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetSubscription(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -521,6 +534,7 @@ public void GetSubscriptionResourceNames()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.GetSubscriptionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Subscription>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -561,6 +575,7 @@ public void UpdateSubscriptionRequestObject()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.UpdateSubscription(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -599,6 +614,7 @@ public void UpdateSubscriptionRequestObject()
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
TopicMessageRetentionDuration = new wkt::Duration(),
};
mockGrpcClient.Setup(x => x.UpdateSubscriptionAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<Subscription>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SubscriberServiceApiClient client = new SubscriberServiceApiClientImpl(mockGrpcClient.Object, null);
Expand Down

0 comments on commit 4cc3e58

Please sign in to comment.