From 0f3696be9e13b562c6000ec51919cd22d2f5579b Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Mon, 8 Apr 2024 12:10:17 -0700 Subject: [PATCH] [Service Bus] Model factory comments (#43276) * [Service Bus] Model factory comments The focus of these changes is to add doc comments to the `ServiceBusModelFactory` members, specifically helping callers to understand what model properties each argument populates. Because some of the parameter names differ from the associated model property names, there has been some confusion. --------- Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> --- .../Azure.Messaging.ServiceBus/CHANGELOG.md | 3 + .../src/Primitives/ServiceBusModelFactory.cs | 129 ++++++++++++++++-- 2 files changed, 121 insertions(+), 11 deletions(-) diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md b/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md index c76b340e8815..f6860458f590 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md @@ -9,10 +9,13 @@ ### Bugs Fixed - Fixed an edge case where a cancellation token signaled while waiting for a throttling delay would cause a failure to reset state and service operations would continue to apply the throttle delay going forward. ([#42952](https://github.com/Azure/azure-sdk-for-net/issues/42952)) + - Fixed an issue where the `ServiceBusSessionProcessor` was not respecting `ServiceBusSessionProcessorOptions.MaxConcurrentCallsPerSession` when `ServiceBusSessionProcessorOptions.SessionIds` was set to a value. ([#43157](https://github.com/Azure/azure-sdk-for-net/pull/43157)) ### Other Changes +- Added missing documentation for `ServiceBusModelFactory` members with a focus on clarifying what model properties each parameter to the factory methods will populate. In some cases, parameter names differ from the associated model properties, causing confusion. ([#42772](https://github.com/Azure/azure-sdk-for-net/issues/42772)) + ## 7.17.4 (2024-03-05) ### Bugs Fixed diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusModelFactory.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusModelFactory.cs index 39e405c17e03..b612dbc4f109 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusModelFactory.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusModelFactory.cs @@ -51,8 +51,31 @@ public static ServiceBusReceivedMessage ServiceBusReceivedMessage( lockTokenGuid, deliveryCount, lockedUntil, sequenceNumber, deadLetterSource, enqueuedSequenceNumber, enqueuedTime, ServiceBusMessageState.Active); /// - /// Creates a new ServiceBusReceivedMessage instance for mocking. + /// Creates a new instance for mocking. /// + /// The binary data to assign as the value of . + /// The message identifier to assign as the value of . + /// The partition key to assign as the value of . + /// The "via partition key" to assign as the value of . + /// The session identifier to assign as the value of . + /// The "reply to" session identifier to assign as the value of . + /// The time interval to assign as the value of . + /// The correlation identifier to assign as the value of . + /// The subject to assign as the value of . + /// The "to" value to assign as the value of . + /// The content type to assign as the value of . + /// The "reply to" value to assign as the value of . + /// The time stamp to assign as the value of . + /// The set of application properties to assign as the value of . + /// The token to assign as the value of . + /// The count to assign as the value of . + /// The "locked until" time stamp to assign as the value of . + /// The sequence number to assign as the value of . + /// The source to assign as the value of . + /// The sequence number to assign as the value of . + /// The time stamp to assign as the value of . + /// The state of the message to assign as the value of . + /// The populated instance to use for mocking. public static ServiceBusReceivedMessage ServiceBusReceivedMessage( BinaryData body = default, string messageId = default, @@ -141,8 +164,25 @@ public static ServiceBusReceivedMessage ServiceBusReceivedMessage( } /// - /// Creates a new instance for mocking. + /// Creates a new instance for mocking. /// + /// The name to assign as the value of . + /// The duration to assign as the value of . + /// The size to assign as the value of . + /// The boolean flag to assign as the value of . + /// The boolean flag to assign as the value of . + /// The time interval to assign as the value of . + /// The boolean flag to assign as the value of . + /// The boolean flag to assign as the value of . + /// The time interval to assign as the value of . + /// The count to assign as the value of . + /// The boolean flag to assign as the value of . + /// The status to assign as the value of . + /// The name of the "forward to" entity to assign as the value of . + /// The name of the "forward to" entity to assign as the value of . + /// The metadata to assign as the value of . + /// The boolean flag to assign as the value of . + /// The populated instance to use for mocking. public static QueueProperties QueueProperties( string name, TimeSpan lockDuration, @@ -181,7 +221,7 @@ public static QueueProperties QueueProperties( }; /// - /// Creates a new instance for mocking. + /// Creates a new instance for mocking. /// [EditorBrowsable(EditorBrowsableState.Never)] public static QueueProperties QueueProperties( @@ -224,7 +264,7 @@ public static QueueProperties QueueProperties( }; /// - /// Creates a new instance for mocking. + /// Creates a new instance for mocking. /// [EditorBrowsable(EditorBrowsableState.Never)] public static TopicProperties TopicProperties( @@ -251,8 +291,19 @@ public static TopicProperties TopicProperties( }; /// - /// Creates a new instance for mocking. + /// Creates a new instance for mocking. /// + /// The name to assign as the value of . + /// The size to assign as the value of . + /// The boolean flag to assign as the value of . + /// The time to live to assign as the value of . + /// The time interval to assign as the value of . + /// The time interval to assign as the value of . + /// The boolean flag to assign as the value of . + /// The status to assign as the value of . + /// The boolean flag to assign as the value of . + /// The message size to assign as the value of . + /// The populated instance to use for mocking. public static TopicProperties TopicProperties( string name, long maxSizeInMegabytes = default, @@ -279,8 +330,15 @@ public static TopicProperties TopicProperties( }; /// - /// Creates a new instance for mocking. + /// Creates a new instance for mocking. /// + /// The name to assign as the value of . + /// The time interval to assign as the value of . + /// The time interval to assign as the value of . + /// The SKU value to assign as the value of . + /// The unit value to assign as the value of . + /// The alias to assign as the value of . + /// The populated instance to use for mocking. public static NamespaceProperties NamespaceProperties( string name, DateTimeOffset createdTime, @@ -300,8 +358,22 @@ public static NamespaceProperties NamespaceProperties( }; /// - /// Creates a new instance for mocking. + /// Creates a new instance for mocking. /// + /// Name of the topic to assign as the value of . + /// Name of the subscription to assign as the value of . + /// Duration to assign as the value of . + /// The boolean flag to assign as the value of . + /// The time interval to assign as the value of . + /// The time interval to assign as the value of . + /// The boolean flag to assign as the value of . + /// The count to assign as the value of . + /// The boolean flag to assign as the value of . + /// The status to assign as the value of . + /// The "forward to" entity to assign as the value of . + /// The "forward to" entity to assign as the value of . + /// The metadata to assign as the value of . + /// The populated instance to use for mocking. public static SubscriptionProperties SubscriptionProperties( string topicName, string subscriptionName, @@ -332,8 +404,12 @@ public static SubscriptionProperties SubscriptionProperties( }; /// - /// Creates a new instance for mocking. + /// Creates a new instance for mocking. /// + /// The name to assign as the value of . + /// The filter to assign as the value of . + /// The action to assign as the value of . + /// The populated instance to use for mocking. public static RuleProperties RuleProperties( string name, RuleFilter filter = default, @@ -344,8 +420,20 @@ public static RuleProperties RuleProperties( }; /// - /// Creates a new instance for mocking. + /// Creates a new instance for mocking. /// + /// The name to assign as the value of . + /// The count to assign as the value of . + /// The count to assign as the value of . + /// The count to assign as the value of . + /// The count to assign as the value of . + /// The count to assign as the value of . + /// The count to assign as the value of . + /// The size to assign as the value of . + /// The time stamp to assign as the value of . + /// The time stamp to assign as the value of . + /// The time stamp to assign as the value of . + /// The populated instance to use for mocking. public static QueueRuntimeProperties QueueRuntimeProperties( string name, long activeMessageCount = default, @@ -373,8 +461,16 @@ public static QueueRuntimeProperties QueueRuntimeProperties( }; /// - /// Creates a new instance for mocking. + /// Creates a new instance for mocking. /// + /// The name to assign as the value of . + /// The count to assign as the value of . + /// The size to assign as the value of . + /// The count to assign as the value of . + /// The time stamp to assign as the value of . + /// The time stamp to assign as the value of . + /// The time stamp to assign as the value of . + /// The populated instance to use for mocking. public static TopicRuntimeProperties TopicRuntimeProperties( string name, long scheduledMessageCount = default, @@ -394,8 +490,19 @@ public static TopicRuntimeProperties TopicRuntimeProperties( }; /// - /// Creates a new instance for mocking. + /// Creates a new instance for mocking. /// + /// The name to assign as the value of . + /// The name to assign as the value of . + /// The count to assign as the value of . + /// The count to assign as the value of . + /// The count to assign as the value of . + /// The count to assign as the value of . + /// The count to assign as the value of . + /// The time stamp to assign as the value of . + /// The time stamp to assign as the value of . + /// The time stamp to assign as the value of . + /// The populated instance to use for mocking. public static SubscriptionRuntimeProperties SubscriptionRuntimeProperties( string topicName, string subscriptionName,