diff --git a/sdk/servicebus/service-bus/CHANGELOG.md b/sdk/servicebus/service-bus/CHANGELOG.md index 772b10aa7260..4f2c25158e15 100644 --- a/sdk/servicebus/service-bus/CHANGELOG.md +++ b/sdk/servicebus/service-bus/CHANGELOG.md @@ -21,7 +21,7 @@ - `userProperties` attribute under the `ServiceBusMessage`(and `ReceivedMessage`, `ReceivedMessageWithLock`) has been renamed to `properties`. Same change has been made to the `userProperties` attribute in the correlation-rule filter. [PR 10003](https://github.com/Azure/azure-sdk-for-js/pull/10003) -- The term `RuntimeInfo` is replaced with `RuntimeProperties` to better align with guidelines around the kind of suffixes we use for naming methods and interfaces. +- The terms `RuntimeInfo` and `Description` are replaced with `RuntimeProperties` and `Properties` to better align with guidelines around the kind of suffixes we use for naming methods and interfaces. ## 7.0.0-preview.4 (2020-07-07) diff --git a/sdk/servicebus/service-bus/review/service-bus.api.md b/sdk/servicebus/service-bus/review/service-bus.api.md index e16de76a4f56..4e63d8e36e7b 100644 --- a/sdk/servicebus/service-bus/review/service-bus.api.md +++ b/sdk/servicebus/service-bus/review/service-bus.api.md @@ -132,7 +132,7 @@ export interface PeekMessagesOptions extends OperationOptionsBase { } // @public -export interface QueueDescription { +export interface QueueProperties { authorizationRules?: AuthorizationRule[]; autoDeleteOnIdle?: string; deadLetteringOnMessageExpiration?: boolean; @@ -153,7 +153,7 @@ export interface QueueDescription { } // @public -export interface QueueResponse extends QueueDescription, Response { +export interface QueueResponse extends QueueProperties, Response { } // @public @@ -228,14 +228,14 @@ export interface Response { export { RetryOptions } // @public -export interface RuleDescription { +export interface RuleProperties { action?: SqlRuleAction; filter?: SqlRuleFilter | CorrelationRuleFilter; name: string; } // @public -export interface RuleResponse extends RuleDescription, Response { +export interface RuleResponse extends RuleProperties, Response { } // @public @@ -287,12 +287,12 @@ export class ServiceBusManagementClient extends ServiceClient { constructor(connectionString: string, options?: ServiceBusManagementClientOptions); constructor(fullyQualifiedNamespace: string, credential: TokenCredential, options?: ServiceBusManagementClientOptions); createQueue(queueName: string, operationOptions?: OperationOptions): Promise; - createQueue(queue: QueueDescription, operationOptions?: OperationOptions): Promise; - createRule(topicName: string, subscriptionName: string, rule: RuleDescription, operationOptions?: OperationOptions): Promise; + createQueue(queue: QueueProperties, operationOptions?: OperationOptions): Promise; + createRule(topicName: string, subscriptionName: string, rule: RuleProperties, operationOptions?: OperationOptions): Promise; createSubscription(topicName: string, subscriptionName: string, operationOptions?: OperationOptions): Promise; - createSubscription(subscription: SubscriptionDescription, operationOptions?: OperationOptions): Promise; + createSubscription(subscription: SubscriptionProperties, operationOptions?: OperationOptions): Promise; createTopic(topicName: string, operationOptions?: OperationOptions): Promise; - createTopic(topic: TopicDescription, operationOptions?: OperationOptions): Promise; + createTopic(topic: TopicProperties, operationOptions?: OperationOptions): Promise; deleteQueue(queueName: string, operationOptions?: OperationOptions): Promise; deleteRule(topicName: string, subscriptionName: string, ruleName: string, operationOptions?: OperationOptions): Promise; deleteSubscription(topicName: string, subscriptionName: string, operationOptions?: OperationOptions): Promise; @@ -300,25 +300,25 @@ export class ServiceBusManagementClient extends ServiceClient { getNamespaceProperties(operationOptions?: OperationOptions): Promise; getQueue(queueName: string, operationOptions?: OperationOptions): Promise; getQueueRuntimeProperties(queueName: string, operationOptions?: OperationOptions): Promise; - getQueues(options?: OperationOptions): PagedAsyncIterableIterator>; + getQueues(options?: OperationOptions): PagedAsyncIterableIterator>; getQueuesRuntimeProperties(options?: OperationOptions): PagedAsyncIterableIterator>; getRule(topicName: string, subscriptionName: string, ruleName: string, operationOptions?: OperationOptions): Promise; - getRules(topicName: string, subscriptionName: string, options?: OperationOptions): PagedAsyncIterableIterator>; + getRules(topicName: string, subscriptionName: string, options?: OperationOptions): PagedAsyncIterableIterator>; getSubscription(topicName: string, subscriptionName: string, operationOptions?: OperationOptions): Promise; getSubscriptionRuntimeProperties(topicName: string, subscriptionName: string, operationOptions?: OperationOptions): Promise; - getSubscriptions(topicName: string, options?: OperationOptions): PagedAsyncIterableIterator>; + getSubscriptions(topicName: string, options?: OperationOptions): PagedAsyncIterableIterator>; getSubscriptionsRuntimeProperties(topicName: string, options?: OperationOptions): PagedAsyncIterableIterator>; getTopic(topicName: string, operationOptions?: OperationOptions): Promise; getTopicRuntimeProperties(topicName: string, operationOptions?: OperationOptions): Promise; - getTopics(options?: OperationOptions): PagedAsyncIterableIterator>; + getTopics(options?: OperationOptions): PagedAsyncIterableIterator>; getTopicsRuntimeProperties(options?: OperationOptions): PagedAsyncIterableIterator>; queueExists(queueName: string, operationOptions?: OperationOptions): Promise; subscriptionExists(topicName: string, subscriptionName: string, operationOptions?: OperationOptions): Promise; topicExists(topicName: string, operationOptions?: OperationOptions): Promise; - updateQueue(queue: QueueDescription, operationOptions?: OperationOptions): Promise; - updateRule(topicName: string, subscriptionName: string, rule: RuleDescription, operationOptions?: OperationOptions): Promise; - updateSubscription(subscription: SubscriptionDescription, operationOptions?: OperationOptions): Promise; - updateTopic(topic: TopicDescription, operationOptions?: OperationOptions): Promise; + updateQueue(queue: QueueProperties, operationOptions?: OperationOptions): Promise; + updateRule(topicName: string, subscriptionName: string, rule: RuleProperties, operationOptions?: OperationOptions): Promise; + updateSubscription(subscription: SubscriptionProperties, operationOptions?: OperationOptions): Promise; + updateTopic(topic: TopicProperties, operationOptions?: OperationOptions): Promise; } // @public @@ -400,7 +400,7 @@ export interface SubscribeOptions extends OperationOptionsBase, MessageHandlerOp } // @public -export interface SubscriptionDescription { +export interface SubscriptionProperties { autoDeleteOnIdle?: string; deadLetteringOnFilterEvaluationExceptions?: boolean; deadLetteringOnMessageExpiration?: boolean; @@ -418,7 +418,7 @@ export interface SubscriptionDescription { } // @public -export interface SubscriptionResponse extends SubscriptionDescription, Response { +export interface SubscriptionResponse extends SubscriptionProperties, Response { } // @public @@ -441,7 +441,7 @@ export { TokenCredential } export { TokenType } // @public -export interface TopicDescription { +export interface TopicProperties { authorizationRules?: AuthorizationRule[]; autoDeleteOnIdle?: string; defaultMessageTtl?: string; @@ -457,7 +457,7 @@ export interface TopicDescription { } // @public -export interface TopicResponse extends TopicDescription, Response { +export interface TopicResponse extends TopicProperties, Response { } // @public diff --git a/sdk/servicebus/service-bus/src/index.ts b/sdk/servicebus/service-bus/src/index.ts index 1e340b84de5a..0eb1a11a1c10 100644 --- a/sdk/servicebus/service-bus/src/index.ts +++ b/sdk/servicebus/service-bus/src/index.ts @@ -33,18 +33,18 @@ export { Receiver } from "./receivers/receiver"; export { SessionReceiver } from "./receivers/sessionReceiver"; export { Sender } from "./sender"; export { NamespaceProperties } from "./serializers/namespaceResourceSerializer"; -export { QueueDescription, QueueRuntimeProperties } from "./serializers/queueResourceSerializer"; +export { QueueProperties, QueueRuntimeProperties } from "./serializers/queueResourceSerializer"; export { - RuleDescription, + RuleProperties, SqlParameter, SqlRuleAction, SqlRuleFilter } from "./serializers/ruleResourceSerializer"; export { - SubscriptionDescription, + SubscriptionProperties, SubscriptionRuntimeProperties } from "./serializers/subscriptionResourceSerializer"; -export { TopicDescription, TopicRuntimeProperties } from "./serializers/topicResourceSerializer"; +export { TopicProperties, TopicRuntimeProperties } from "./serializers/topicResourceSerializer"; export { EntitiesResponse, ListRequestOptions, diff --git a/sdk/servicebus/service-bus/src/serializers/queueResourceSerializer.ts b/sdk/servicebus/service-bus/src/serializers/queueResourceSerializer.ts index 28699014047d..a2557791cd6e 100644 --- a/sdk/servicebus/service-bus/src/serializers/queueResourceSerializer.ts +++ b/sdk/servicebus/service-bus/src/serializers/queueResourceSerializer.ts @@ -31,7 +31,7 @@ import { * converts values to string and ensures the right order as expected by the service * @param queue */ -export function buildQueueOptions(queue: QueueDescription): InternalQueueOptions { +export function buildQueueOptions(queue: QueueProperties): InternalQueueOptions { return { LockDuration: queue.lockDuration, MaxSizeInMegabytes: getStringOrUndefined(queue.maxSizeInMegabytes), @@ -59,7 +59,7 @@ export function buildQueueOptions(queue: QueueDescription): InternalQueueOptions * response from the service * @param rawQueue */ -export function buildQueue(rawQueue: any): QueueDescription { +export function buildQueue(rawQueue: any): QueueProperties { return { name: getString(rawQueue[Constants.QUEUE_NAME], "queueName"), @@ -128,7 +128,7 @@ export function buildQueueRuntimeProperties(rawQueue: any): QueueRuntimeProperti /** * Represents settable options on a queue */ -export interface QueueDescription { +export interface QueueProperties { /** * Name of the queue */ @@ -226,7 +226,7 @@ export interface QueueDescription { forwardTo?: string; /** - * The user provided metadata information associated with the queue description. + * The user provided metadata information associated with the queue. * Used to specify textual content such as tags, labels, etc. * Value must not exceed 1024 bytes encoded in utf-8. */ @@ -354,7 +354,7 @@ export interface InternalQueueOptions { ForwardTo?: string; /** - * The user provided metadata information associated with the queue description. + * The user provided metadata information associated with the queue. * Used to specify textual content such as tags, labels, etc. * Value must not exceed 1024 bytes encoded in utf-8. */ diff --git a/sdk/servicebus/service-bus/src/serializers/ruleResourceSerializer.ts b/sdk/servicebus/service-bus/src/serializers/ruleResourceSerializer.ts index f4fd045234d9..94b04fc06937 100644 --- a/sdk/servicebus/service-bus/src/serializers/ruleResourceSerializer.ts +++ b/sdk/servicebus/service-bus/src/serializers/ruleResourceSerializer.ts @@ -24,7 +24,7 @@ import { * response from the service * @param rawRule */ -export function buildRule(rawRule: any): RuleDescription { +export function buildRule(rawRule: any): RuleProperties { return { name: getString(rawRule["RuleName"], "ruleName"), filter: getTopicFilter(rawRule["Filter"]), @@ -88,7 +88,7 @@ function getRuleActionOrUndefined(value: any): SqlRuleAction | undefined { /** * Represents all attributes of a rule entity */ -export interface RuleDescription { +export interface RuleProperties { /** * Name of the rule */ @@ -146,7 +146,7 @@ export interface SqlRuleFilter { * RuleResourceSerializer for serializing / deserializing Rule entities */ export class RuleResourceSerializer implements AtomXmlSerializer { - serialize(rule: RuleDescription): object { + serialize(rule: RuleProperties): object { const resource: { Name: any; Filter: any; Action: any } = { Filter: {}, Action: {}, diff --git a/sdk/servicebus/service-bus/src/serializers/subscriptionResourceSerializer.ts b/sdk/servicebus/service-bus/src/serializers/subscriptionResourceSerializer.ts index d406e2db190c..8e996c37d90c 100644 --- a/sdk/servicebus/service-bus/src/serializers/subscriptionResourceSerializer.ts +++ b/sdk/servicebus/service-bus/src/serializers/subscriptionResourceSerializer.ts @@ -28,7 +28,7 @@ import { * @param subscription */ export function buildSubscriptionOptions( - subscription: SubscriptionDescription + subscription: SubscriptionProperties ): InternalSubscriptionOptions { return { LockDuration: subscription.lockDuration, @@ -57,7 +57,7 @@ export function buildSubscriptionOptions( * the response from the service * @param rawSubscription */ -export function buildSubscription(rawSubscription: any): SubscriptionDescription { +export function buildSubscription(rawSubscription: any): SubscriptionProperties { return { subscriptionName: getString(rawSubscription[Constants.SUBSCRIPTION_NAME], "subscriptionName"), topicName: getString(rawSubscription[Constants.TOPIC_NAME], "topicName"), @@ -103,7 +103,9 @@ export function buildSubscription(rawSubscription: any): SubscriptionDescription * the response from the service * @param rawSubscription */ -export function buildSubscriptionRuntimeProperties(rawSubscription: any): SubscriptionRuntimeProperties { +export function buildSubscriptionRuntimeProperties( + rawSubscription: any +): SubscriptionRuntimeProperties { return { subscriptionName: getString(rawSubscription[Constants.SUBSCRIPTION_NAME], "subscriptionName"), topicName: getString(rawSubscription[Constants.TOPIC_NAME], "topicName"), @@ -118,7 +120,7 @@ export function buildSubscriptionRuntimeProperties(rawSubscription: any): Subscr /** * Represents settable options on a subscription */ -export interface SubscriptionDescription { +export interface SubscriptionProperties { /** * Name of the subscription */ @@ -202,7 +204,7 @@ export interface SubscriptionDescription { forwardTo?: string; /** - * The user provided metadata information associated with the subscription description. + * The user provided metadata information associated with the subscription. * Used to specify textual content such as tags, labels, etc. * Value must not exceed 1024 bytes encoded in utf-8. */ @@ -305,7 +307,7 @@ export interface InternalSubscriptionOptions { ForwardTo?: string; /** - * The user provided metadata information associated with the subscription description. + * The user provided metadata information associated with the subscription. * Used to specify textual content such as tags, labels, etc. * Value must not exceed 1024 bytes encoded in utf-8. */ diff --git a/sdk/servicebus/service-bus/src/serializers/topicResourceSerializer.ts b/sdk/servicebus/service-bus/src/serializers/topicResourceSerializer.ts index af6c40ba7b8a..fb5db8efd880 100644 --- a/sdk/servicebus/service-bus/src/serializers/topicResourceSerializer.ts +++ b/sdk/servicebus/service-bus/src/serializers/topicResourceSerializer.ts @@ -29,7 +29,7 @@ import { * converts values to string and ensures the right order as expected by the service * @param topic */ -export function buildTopicOptions(topic: TopicDescription): InternalTopicOptions { +export function buildTopicOptions(topic: TopicProperties): InternalTopicOptions { return { DefaultMessageTimeToLive: topic.defaultMessageTtl, MaxSizeInMegabytes: getStringOrUndefined(topic.maxSizeInMegabytes), @@ -52,7 +52,7 @@ export function buildTopicOptions(topic: TopicDescription): InternalTopicOptions * response from the service * @param rawTopic */ -export function buildTopic(rawTopic: any): TopicDescription { +export function buildTopic(rawTopic: any): TopicProperties { return { name: getString(rawTopic[Constants.TOPIC_NAME], "topicName"), maxSizeInMegabytes: getInteger(rawTopic[Constants.MAX_SIZE_IN_MEGABYTES], "maxSizeInMegabytes"), @@ -107,7 +107,7 @@ export function buildTopicRuntimeProperties(rawTopic: any): TopicRuntimeProperti /** * Represents settable options on a topic */ -export interface TopicDescription { +export interface TopicProperties { /** * Name of the topic */ @@ -168,7 +168,7 @@ export interface TopicDescription { status?: EntityStatus; /** - * The user provided metadata information associated with the topic description. + * The user provided metadata information associated with the topic. * Used to specify textual content such as tags, labels, etc. * Value must not exceed 1024 bytes encoded in utf-8. */ @@ -256,7 +256,7 @@ export interface InternalTopicOptions { Status?: string; /** - * The user provided metadata information associated with the topic description. + * The user provided metadata information associated with the topic. * Used to specify textual content such as tags, labels, etc. * Value must not exceed 1024 bytes encoded in utf-8. */ diff --git a/sdk/servicebus/service-bus/src/serviceBusAtomManagementClient.ts b/sdk/servicebus/service-bus/src/serviceBusAtomManagementClient.ts index 7667505f23bb..fedc896bee6b 100644 --- a/sdk/servicebus/service-bus/src/serviceBusAtomManagementClient.ts +++ b/sdk/servicebus/service-bus/src/serviceBusAtomManagementClient.ts @@ -36,13 +36,13 @@ import { buildQueueOptions, buildQueueRuntimeProperties, InternalQueueOptions, - QueueDescription, + QueueProperties, QueueResourceSerializer, QueueRuntimeProperties } from "./serializers/queueResourceSerializer"; import { buildRule, - RuleDescription, + RuleProperties, RuleResourceSerializer } from "./serializers/ruleResourceSerializer"; import { @@ -50,7 +50,7 @@ import { buildSubscriptionOptions, buildSubscriptionRuntimeProperties, InternalSubscriptionOptions, - SubscriptionDescription, + SubscriptionProperties, SubscriptionResourceSerializer, SubscriptionRuntimeProperties } from "./serializers/subscriptionResourceSerializer"; @@ -59,7 +59,7 @@ import { buildTopicOptions, buildTopicRuntimeProperties, InternalTopicOptions, - TopicDescription, + TopicProperties, TopicResourceSerializer, TopicRuntimeProperties } from "./serializers/topicResourceSerializer"; @@ -126,12 +126,12 @@ export interface QueueRuntimePropertiesResponse extends QueueRuntimeProperties, /** * Represents result of create, get, and update operations on queue. */ -export interface QueueResponse extends QueueDescription, Response {} +export interface QueueResponse extends QueueProperties, Response {} /** * Represents result of create, get, and update operations on topic. */ -export interface TopicResponse extends TopicDescription, Response {} +export interface TopicResponse extends TopicProperties, Response {} /** * Represents runtime info of a topic. @@ -141,7 +141,7 @@ export interface TopicRuntimePropertiesResponse extends TopicRuntimeProperties, /** * Represents result of create, get, and update operations on subscription. */ -export interface SubscriptionResponse extends SubscriptionDescription, Response {} +export interface SubscriptionResponse extends SubscriptionProperties, Response {} /** * Represents runtime info of a subscription. @@ -153,7 +153,7 @@ export interface SubscriptionRuntimePropertiesResponse /** * Represents result of create, get, and update operations on rule. */ -export interface RuleResponse extends RuleDescription, Response {} +export interface RuleResponse extends RuleProperties, Response {} /** * All operations return promises that resolve to an object that has the relevant output. @@ -334,11 +334,11 @@ export class ServiceBusManagementClient extends ServiceClient { * https://docs.microsoft.com/en-us/dotnet/api/system.net.httpstatuscode?view=netframework-4.8 */ async createQueue( - queue: QueueDescription, + queue: QueueProperties, operationOptions?: OperationOptions ): Promise; async createQueue( - queueNameOrOptions: string | QueueDescription, + queueNameOrOptions: string | QueueProperties, operationOptions?: OperationOptions ): Promise { const { span, updatedOperationOptions } = createSpan( @@ -346,7 +346,7 @@ export class ServiceBusManagementClient extends ServiceClient { operationOptions ); try { - let queue: QueueDescription; + let queue: QueueProperties; if (typeof queueNameOrOptions === "string") { queue = { name: queueNameOrOptions }; } else { @@ -477,7 +477,7 @@ export class ServiceBusManagementClient extends ServiceClient { */ private async listQueues( options?: ListRequestOptions & OperationOptions - ): Promise> { + ): Promise> { const { span, updatedOperationOptions } = createSpan( "ServiceBusManagementClient-listQueues", options @@ -505,7 +505,7 @@ export class ServiceBusManagementClient extends ServiceClient { private async *listQueuesPage( marker?: string, options: OperationOptions & Pick = {} - ): AsyncIterableIterator> { + ): AsyncIterableIterator> { let listResponse; do { listResponse = await this.listQueues({ @@ -520,7 +520,7 @@ export class ServiceBusManagementClient extends ServiceClient { private async *listQueuesAll( options: OperationOptions = {} - ): AsyncIterableIterator { + ): AsyncIterableIterator { let marker: string | undefined; for await (const segment of this.listQueuesPage(marker, options)) { yield* segment; @@ -534,14 +534,14 @@ export class ServiceBusManagementClient extends ServiceClient { * * @param {OperationOptions} [options] * @returns {PagedAsyncIterableIterator< - * QueueDescription, - * EntitiesResponse, + * QueueProperties, + * EntitiesResponse, * >} An asyncIterableIterator that supports paging. * @memberof ServiceBusManagementClient */ public getQueues( options?: OperationOptions - ): PagedAsyncIterableIterator> { + ): PagedAsyncIterableIterator> { log.httpAtomXml(`Performing management operation - listQueues() with options: ${options}`); const iter = this.listQueuesAll(options); return { @@ -684,9 +684,9 @@ export class ServiceBusManagementClient extends ServiceClient { } /** - * Updates the queue based on the queue description provided. - * All properties on the queue description must be set even though only a subset of them are actually updatable. - * Therefore, the suggested flow is to use `getQueue()` to get the queue description with all properties set, + * Updates the queue based on the queue properties provided. + * All queue properties must be set even though only a subset of them are actually updatable. + * Therefore, the suggested flow is to use `getQueue()` to get the complete set of queue properties, * update as needed and then pass it to `updateQueue()`. * See https://docs.microsoft.com/en-us/rest/api/servicebus/update-queue for more details. * @@ -709,7 +709,7 @@ export class ServiceBusManagementClient extends ServiceClient { * https://docs.microsoft.com/en-us/dotnet/api/system.net.httpstatuscode?view=netframework-4.8 */ async updateQueue( - queue: QueueDescription, + queue: QueueProperties, operationOptions?: OperationOptions ): Promise { const { span, updatedOperationOptions } = createSpan( @@ -858,11 +858,11 @@ export class ServiceBusManagementClient extends ServiceClient { * https://docs.microsoft.com/en-us/dotnet/api/system.net.httpstatuscode?view=netframework-4.8 */ async createTopic( - topic: TopicDescription, + topic: TopicProperties, operationOptions?: OperationOptions ): Promise; async createTopic( - topicNameOrOptions: string | TopicDescription, + topicNameOrOptions: string | TopicProperties, operationOptions?: OperationOptions ): Promise { const { span, updatedOperationOptions } = createSpan( @@ -870,7 +870,7 @@ export class ServiceBusManagementClient extends ServiceClient { operationOptions ); try { - let topic: TopicDescription; + let topic: TopicProperties; if (typeof topicNameOrOptions === "string") { topic = { name: topicNameOrOptions }; } else { @@ -1001,7 +1001,7 @@ export class ServiceBusManagementClient extends ServiceClient { */ private async listTopics( options?: ListRequestOptions & OperationOptions - ): Promise> { + ): Promise> { const { span, updatedOperationOptions } = createSpan( "ServiceBusManagementClient-listTopics", options @@ -1029,7 +1029,7 @@ export class ServiceBusManagementClient extends ServiceClient { private async *listTopicsPage( marker?: string, options: OperationOptions & Pick = {} - ): AsyncIterableIterator> { + ): AsyncIterableIterator> { let listResponse; do { listResponse = await this.listTopics({ @@ -1044,7 +1044,7 @@ export class ServiceBusManagementClient extends ServiceClient { private async *listTopicsAll( options: OperationOptions = {} - ): AsyncIterableIterator { + ): AsyncIterableIterator { let marker: string | undefined; for await (const segment of this.listTopicsPage(marker, options)) { yield* segment; @@ -1059,14 +1059,14 @@ export class ServiceBusManagementClient extends ServiceClient { * * @param {OperationOptions} [options] * @returns {PagedAsyncIterableIterator< - * TopicDescription, - * EntitiesResponse, + * TopicProperties, + * EntitiesResponse, * >} An asyncIterableIterator that supports paging. * @memberof ServiceBusManagementClient */ public getTopics( options?: OperationOptions - ): PagedAsyncIterableIterator> { + ): PagedAsyncIterableIterator> { log.httpAtomXml(`Performing management operation - getTopics() with options: ${options}`); const iter = this.listTopicsAll(options); return { @@ -1210,9 +1210,9 @@ export class ServiceBusManagementClient extends ServiceClient { } /** - * Updates the topic based on the topic description provided. - * All properties on the topic description must be set even though only a subset of them are actually updatable. - * Therefore, the suggested flow is to use `getTopic()` to get the topic description with all properties set, + * Updates the topic based on the topic properties provided. + * All topic properties must be set even though only a subset of them are actually updatable. + * Therefore, the suggested flow is to use `getTopic()` to get the complete set of topic properties, * update as needed and then pass it to `updateTopic()`. * See https://docs.microsoft.com/en-us/rest/api/servicebus/update-topic for more details. * @@ -1232,7 +1232,7 @@ export class ServiceBusManagementClient extends ServiceClient { * https://docs.microsoft.com/en-us/dotnet/api/system.net.httpstatuscode?view=netframework-4.8 */ async updateTopic( - topic: TopicDescription, + topic: TopicProperties, operationOptions?: OperationOptions ): Promise { const { span, updatedOperationOptions } = createSpan( @@ -1387,15 +1387,15 @@ export class ServiceBusManagementClient extends ServiceClient { * https://docs.microsoft.com/en-us/dotnet/api/system.net.httpstatuscode?view=netframework-4.8 */ async createSubscription( - subscription: SubscriptionDescription, + subscription: SubscriptionProperties, operationOptions?: OperationOptions ): Promise; async createSubscription( - topicNameOrSubscriptionOptions: string | SubscriptionDescription, + topicNameOrSubscriptionOptions: string | SubscriptionProperties, subscriptionNameOrOperationOptions?: string | OperationOptions, operationOptions?: OperationOptions ): Promise { - let subscription: SubscriptionDescription; + let subscription: SubscriptionProperties; let operOptions: OperationOptions | undefined; if (typeof subscriptionNameOrOperationOptions === "string") { if (typeof topicNameOrSubscriptionOptions !== "string") { @@ -1407,7 +1407,7 @@ export class ServiceBusManagementClient extends ServiceClient { }; operOptions = operationOptions; } else { - subscription = topicNameOrSubscriptionOptions as SubscriptionDescription; + subscription = topicNameOrSubscriptionOptions as SubscriptionProperties; operOptions = subscriptionNameOrOperationOptions; } const { span, updatedOperationOptions } = createSpan( @@ -1557,7 +1557,7 @@ export class ServiceBusManagementClient extends ServiceClient { private async listSubscriptions( topicName: string, options?: ListRequestOptions & OperationOptions - ): Promise> { + ): Promise> { const { span, updatedOperationOptions } = createSpan( "ServiceBusManagementClient-listSubscriptions", options @@ -1588,7 +1588,7 @@ export class ServiceBusManagementClient extends ServiceClient { topicName: string, marker?: string, options: OperationOptions & Pick = {} - ): AsyncIterableIterator> { + ): AsyncIterableIterator> { let listResponse; do { listResponse = await this.listSubscriptions(topicName, { @@ -1604,7 +1604,7 @@ export class ServiceBusManagementClient extends ServiceClient { private async *listSubscriptionsAll( topicName: string, options: OperationOptions = {} - ): AsyncIterableIterator { + ): AsyncIterableIterator { let marker: string | undefined; for await (const segment of this.listSubscriptionsPage(topicName, marker, options)) { yield* segment; @@ -1622,18 +1622,15 @@ export class ServiceBusManagementClient extends ServiceClient { * @param {string} topicName * @param {OperationOptions} [options] * @returns {PagedAsyncIterableIterator< - * SubscriptionDescription, - * EntitiesResponse + * SubscriptionProperties, + * EntitiesResponse * >} An asyncIterableIterator that supports paging. * @memberof ServiceBusManagementClient */ public getSubscriptions( topicName: string, options?: OperationOptions - ): PagedAsyncIterableIterator< - SubscriptionDescription, - EntitiesResponse - > { + ): PagedAsyncIterableIterator> { log.httpAtomXml( `Performing management operation - getSubscriptions() with options: ${options}` ); @@ -1792,9 +1789,9 @@ export class ServiceBusManagementClient extends ServiceClient { } /** - * Updates the subscription based on the subscription description provided. - * All properties on the subscription description must be set even though only a subset of them are actually updatable. - * Therefore, the suggested flow is to use `getSubscription()` to get the subscription description with all properties set, + * Updates the subscription based on the subscription properties provided. + * All subscription properties must be set even though only a subset of them are actually updatable. + * Therefore, the suggested flow is to use `getSubscription()` to get the complete set of subscription properties, * update as needed and then pass it to `updateSubscription()`. * * @param subscription Object representing the subscription with one or more of the below properties updated @@ -1814,7 +1811,7 @@ export class ServiceBusManagementClient extends ServiceClient { * https://docs.microsoft.com/en-us/dotnet/api/system.net.httpstatuscode?view=netframework-4.8 */ async updateSubscription( - subscription: SubscriptionDescription, + subscription: SubscriptionProperties, operationOptions?: OperationOptions ): Promise { const { span, updatedOperationOptions } = createSpan( @@ -1972,7 +1969,7 @@ export class ServiceBusManagementClient extends ServiceClient { async createRule( topicName: string, subscriptionName: string, - rule: RuleDescription, + rule: RuleProperties, operationOptions?: OperationOptions ): Promise { const { span, updatedOperationOptions } = createSpan( @@ -2070,7 +2067,7 @@ export class ServiceBusManagementClient extends ServiceClient { topicName: string, subscriptionName: string, options?: ListRequestOptions & OperationOptions - ): Promise> { + ): Promise> { const { span, updatedOperationOptions } = createSpan( "ServiceBusManagementClient-listRules", options @@ -2101,7 +2098,7 @@ export class ServiceBusManagementClient extends ServiceClient { subscriptionName: string, marker?: string, options: OperationOptions & Pick = {} - ): AsyncIterableIterator> { + ): AsyncIterableIterator> { let listResponse; do { listResponse = await this.listRules(topicName, subscriptionName, { @@ -2118,7 +2115,7 @@ export class ServiceBusManagementClient extends ServiceClient { topicName: string, subscriptionName: string, options: OperationOptions = {} - ): AsyncIterableIterator { + ): AsyncIterableIterator { let marker: string | undefined; for await (const segment of this.listRulesPage(topicName, subscriptionName, marker, options)) { yield* segment; @@ -2134,14 +2131,14 @@ export class ServiceBusManagementClient extends ServiceClient { * @param {string} topicName * @param {string} subscriptionName * @param {OperationOptions} [options] - * @returns {PagedAsyncIterableIterator>} An asyncIterableIterator that supports paging. + * @returns {PagedAsyncIterableIterator>} An asyncIterableIterator that supports paging. * @memberof ServiceBusManagementClient */ public getRules( topicName: string, subscriptionName: string, options?: OperationOptions - ): PagedAsyncIterableIterator> { + ): PagedAsyncIterableIterator> { log.httpAtomXml(`Performing management operation - getRules() with options: ${options}`); const iter = this.listRulesAll(topicName, subscriptionName, options); return { @@ -2191,7 +2188,7 @@ export class ServiceBusManagementClient extends ServiceClient { async updateRule( topicName: string, subscriptionName: string, - rule: RuleDescription, + rule: RuleProperties, operationOptions?: OperationOptions ): Promise { const { span, updatedOperationOptions } = createSpan( @@ -2295,7 +2292,7 @@ export class ServiceBusManagementClient extends ServiceClient { | InternalQueueOptions | InternalTopicOptions | InternalSubscriptionOptions - | RuleDescription, + | RuleProperties, serializer: AtomXmlSerializer, isUpdate: boolean = false, operationOptions: OperationOptions = {} @@ -2531,9 +2528,9 @@ export class ServiceBusManagementClient extends ServiceClient { private buildListQueuesResponse( response: HttpOperationResponse - ): EntitiesResponse { + ): EntitiesResponse { try { - const queues: QueueDescription[] = []; + const queues: QueueProperties[] = []; const nextMarker = this.getMarkerFromNextLinkUrl(response.parsedBody.nextLink); if (!Array.isArray(response.parsedBody)) { throw new TypeError(`${response.parsedBody} was expected to be of type Array`); @@ -2545,7 +2542,7 @@ export class ServiceBusManagementClient extends ServiceClient { queues.push(queue); } } - const listQueuesResponse: EntitiesResponse = Object.assign(queues, { + const listQueuesResponse: EntitiesResponse = Object.assign(queues, { _response: response }); listQueuesResponse.continuationToken = nextMarker; @@ -2637,9 +2634,9 @@ export class ServiceBusManagementClient extends ServiceClient { private buildListTopicsResponse( response: HttpOperationResponse - ): EntitiesResponse { + ): EntitiesResponse { try { - const topics: TopicDescription[] = []; + const topics: TopicProperties[] = []; const nextMarker = this.getMarkerFromNextLinkUrl(response.parsedBody.nextLink); if (!Array.isArray(response.parsedBody)) { throw new TypeError(`${response.parsedBody} was expected to be of type Array`); @@ -2651,7 +2648,7 @@ export class ServiceBusManagementClient extends ServiceClient { topics.push(topic); } } - const listTopicsResponse: EntitiesResponse = Object.assign(topics, { + const listTopicsResponse: EntitiesResponse = Object.assign(topics, { _response: response }); listTopicsResponse.continuationToken = nextMarker; @@ -2742,9 +2739,9 @@ export class ServiceBusManagementClient extends ServiceClient { private buildListSubscriptionsResponse( response: HttpOperationResponse - ): EntitiesResponse { + ): EntitiesResponse { try { - const subscriptions: SubscriptionDescription[] = []; + const subscriptions: SubscriptionProperties[] = []; const nextMarker = this.getMarkerFromNextLinkUrl(response.parsedBody.nextLink); if (!Array.isArray(response.parsedBody)) { throw new TypeError(`${response.parsedBody} was expected to be of type Array`); @@ -2756,7 +2753,7 @@ export class ServiceBusManagementClient extends ServiceClient { subscriptions.push(subscription); } } - const listSubscriptionsResponse: EntitiesResponse = Object.assign( + const listSubscriptionsResponse: EntitiesResponse = Object.assign( subscriptions, { _response: response @@ -2857,9 +2854,9 @@ export class ServiceBusManagementClient extends ServiceClient { private buildListRulesResponse( response: HttpOperationResponse - ): EntitiesResponse { + ): EntitiesResponse { try { - const rules: RuleDescription[] = []; + const rules: RuleProperties[] = []; const nextMarker = this.getMarkerFromNextLinkUrl(response.parsedBody.nextLink); if (!Array.isArray(response.parsedBody)) { throw new TypeError(`${response.parsedBody} was expected to be of type Array`); @@ -2871,7 +2868,7 @@ export class ServiceBusManagementClient extends ServiceClient { rules.push(rule); } } - const listRulesResponse: EntitiesResponse = Object.assign(rules, { + const listRulesResponse: EntitiesResponse = Object.assign(rules, { _response: response }); listRulesResponse.continuationToken = nextMarker; diff --git a/sdk/servicebus/service-bus/test/atomManagement.spec.ts b/sdk/servicebus/service-bus/test/atomManagement.spec.ts index d4f6018a3820..115f329adac1 100644 --- a/sdk/servicebus/service-bus/test/atomManagement.spec.ts +++ b/sdk/servicebus/service-bus/test/atomManagement.spec.ts @@ -8,10 +8,10 @@ import chai from "chai"; import chaiAsPromised from "chai-as-promised"; import chaiExclude from "chai-exclude"; import * as dotenv from "dotenv"; -import { QueueDescription } from "../src/serializers/queueResourceSerializer"; -import { RuleDescription } from "../src/serializers/ruleResourceSerializer"; -import { SubscriptionDescription } from "../src/serializers/subscriptionResourceSerializer"; -import { TopicDescription } from "../src/serializers/topicResourceSerializer"; +import { QueueProperties } from "../src/serializers/queueResourceSerializer"; +import { RuleProperties } from "../src/serializers/ruleResourceSerializer"; +import { SubscriptionProperties } from "../src/serializers/subscriptionResourceSerializer"; +import { TopicProperties } from "../src/serializers/topicResourceSerializer"; import { ServiceBusManagementClient } from "../src/serviceBusAtomManagementClient"; import { EntityStatus } from "../src/util/utils"; import { EnvVarNames, getEnvVars } from "./utils/envVarUtils"; @@ -2372,10 +2372,10 @@ async function createEntity( topicPath?: string, subscriptionPath?: string, overrideOptions?: boolean, // If this is false, then the default options will be populated as used for basic testing. - queueOptions?: Omit, - topicOptions?: Omit, - subscriptionOptions?: Omit, - ruleOptions?: Omit + queueOptions?: Omit, + topicOptions?: Omit, + subscriptionOptions?: Omit, + ruleOptions?: Omit ): Promise { if (!overrideOptions) { if (queueOptions == undefined) { @@ -2510,10 +2510,14 @@ async function getEntityRuntimeProperties( ): Promise { switch (testEntityType) { case EntityType.QUEUE: - const queueResponse = await serviceBusAtomManagementClient.getQueueRuntimeProperties(entityPath); + const queueResponse = await serviceBusAtomManagementClient.getQueueRuntimeProperties( + entityPath + ); return queueResponse; case EntityType.TOPIC: - const topicResponse = await serviceBusAtomManagementClient.getTopicRuntimeProperties(entityPath); + const topicResponse = await serviceBusAtomManagementClient.getTopicRuntimeProperties( + entityPath + ); return topicResponse; case EntityType.SUBSCRIPTION: if (!topicPath) { @@ -2588,10 +2592,10 @@ async function updateEntity( topicPath?: string, subscriptionPath?: string, overrideOptions?: boolean, // If this is false, then the default options will be populated as used for basic testing. - queueOptions?: Omit, - topicOptions?: Omit, - subscriptionOptions?: Omit, - ruleOptions?: Omit + queueOptions?: Omit, + topicOptions?: Omit, + subscriptionOptions?: Omit, + ruleOptions?: Omit ): Promise { if (!overrideOptions) { if (queueOptions == undefined) { diff --git a/sdk/servicebus/service-bus/test/utils/managementUtils.ts b/sdk/servicebus/service-bus/test/utils/managementUtils.ts index d36fe73a6fd0..274c05a53c75 100644 --- a/sdk/servicebus/service-bus/test/utils/managementUtils.ts +++ b/sdk/servicebus/service-bus/test/utils/managementUtils.ts @@ -2,9 +2,9 @@ // Licensed under the MIT license. import { delay } from "../../src"; -import { QueueDescription } from "../../src/serializers/queueResourceSerializer"; -import { TopicDescription } from "../../src/serializers/topicResourceSerializer"; -import { SubscriptionDescription } from "../../src/serializers/subscriptionResourceSerializer"; +import { QueueProperties } from "../../src/serializers/queueResourceSerializer"; +import { TopicProperties } from "../../src/serializers/topicResourceSerializer"; +import { SubscriptionProperties } from "../../src/serializers/subscriptionResourceSerializer"; import { ServiceBusManagementClient } from "../../src/serviceBusAtomManagementClient"; import { EnvVarNames, getEnvVars } from "./envVarUtils"; @@ -78,7 +78,7 @@ async function retry( */ export async function recreateQueue( queueName: string, - parameters?: Omit + parameters?: Omit ): Promise { await getManagementClient(); @@ -116,7 +116,7 @@ export async function recreateQueue( */ export async function recreateTopic( topicName: string, - parameters?: Omit + parameters?: Omit ): Promise { await getManagementClient(); @@ -156,7 +156,7 @@ export async function recreateTopic( export async function recreateSubscription( topicName: string, subscriptionName: string, - parameters?: Omit + parameters?: Omit ): Promise { await getManagementClient(); /*