Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
[Service Bus] Renaming ListRequestOptions {top, skip} -> {maxCount, s…
Browse files Browse the repository at this point in the history
…kip} (Azure#9664)

* top -> maxCount

* update tests

* API Report

* improve helper method for test

* changelog

* Update sdk/servicebus/service-bus/CHANGELOG.md

Co-authored-by: Ramya Rao <ramya.rao.a@outlook.com>

* fix changelog format

Co-authored-by: Ramya Rao <ramya.rao.a@outlook.com>
  • Loading branch information
2 people authored and sadasant committed Jun 27, 2020
1 parent 507c627 commit e035738
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 33 deletions.
4 changes: 3 additions & 1 deletion sdk/servicebus/service-bus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
[PR 9284](https://github.com/Azure/azure-sdk-for-js/pull/9284)
- Bug - Messages scheduled in parallel with the `scheduleMessage` method have the same sequence number in response.
Fixed in [PR 9503](https://github.com/Azure/azure-sdk-for-js/pull/9503)
- Management api updates
- Management api updates (Includes breaking changes)
- Following return types are changed to improve the API surface.
- [Create,Get,Update]QueueResponse as QueueResponse, DeleteQueueResponse as Response, GetQueueRuntimeInfoResponse as QueueRuntimeInfoResponse.
Similarly for topics, subscriptions and rules.
[PR 9432](https://github.com/Azure/azure-sdk-for-js/pull/9432)
- Updated `ISO-8601 timestamp string` to the `Date` type for the createdOn, accessedOn and modifiedOn properties in the responses for the `runtimeInfo` methods for Queue, Topic and Subscription.
[PR 9434](https://github.com/Azure/azure-sdk-for-js/pull/9434)
- The property `top` in the options passed to any of the methods that get information for multiple entities like `getQueues` or `getQueuesRuntimeInfo` is renamed to `maxCount`.
[PR 9664](https://github.com/Azure/azure-sdk-for-js/pull/9664)

## 7.0.0-preview.3 (2020-06-08)

Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/service-bus/review/service-bus.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export interface GetMessageIteratorOptions extends OperationOptions, WaitTimeOpt

// @public
export interface ListRequestOptions {
maxCount?: number;
skip?: number;
top?: number;
}

// @public
Expand Down
34 changes: 10 additions & 24 deletions sdk/servicebus/service-bus/src/serviceBusAtomManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export interface ListRequestOptions {
/**
* Count of entities to fetch.
*/
top?: number;
maxCount?: number;

/**
* Count of entities to skip from being fetched.
Expand Down Expand Up @@ -413,9 +413,7 @@ export class ServiceBusManagementClient extends ServiceClient {
* https://docs.microsoft.com/en-us/dotnet/api/system.net.httpstatuscode?view=netframework-4.8
*/
async getQueues(options?: ListRequestOptions): Promise<QueuesResponse> {
log.httpAtomXml(
`Performing management operation - listQueues() with options: ${options}`
);
log.httpAtomXml(`Performing management operation - listQueues() with options: ${options}`);
const response: HttpOperationResponse = await this.listResources(
"$Resources/Queues",
options,
Expand All @@ -438,12 +436,8 @@ export class ServiceBusManagementClient extends ServiceClient {
* @throws `RestError` with code that is a value from the standard set of HTTP status codes as documented at
* https://docs.microsoft.com/en-us/dotnet/api/system.net.httpstatuscode?view=netframework-4.8
*/
async getQueuesRuntimeInfo(
options?: ListRequestOptions
): Promise<QueuesRuntimeInfoResponse> {
log.httpAtomXml(
`Performing management operation - listQueues() with options: ${options}`
);
async getQueuesRuntimeInfo(options?: ListRequestOptions): Promise<QueuesRuntimeInfoResponse> {
log.httpAtomXml(`Performing management operation - listQueues() with options: ${options}`);
const response: HttpOperationResponse = await this.listResources(
"$Resources/Queues",
options,
Expand Down Expand Up @@ -655,9 +649,7 @@ export class ServiceBusManagementClient extends ServiceClient {
* https://docs.microsoft.com/en-us/dotnet/api/system.net.httpstatuscode?view=netframework-4.8
*/
async getTopics(options?: ListRequestOptions): Promise<TopicsResponse> {
log.httpAtomXml(
`Performing management operation - listTopics() with options: ${options}`
);
log.httpAtomXml(`Performing management operation - listTopics() with options: ${options}`);
const response: HttpOperationResponse = await this.listResources(
"$Resources/Topics",
options,
Expand All @@ -680,12 +672,8 @@ export class ServiceBusManagementClient extends ServiceClient {
* @throws `RestError` with code that is a value from the standard set of HTTP status codes as documented at
* https://docs.microsoft.com/en-us/dotnet/api/system.net.httpstatuscode?view=netframework-4.8
*/
async getTopicsRuntimeInfo(
options?: ListRequestOptions
): Promise<TopicsRuntimeInfoResponse> {
log.httpAtomXml(
`Performing management operation - listTopics() with options: ${options}`
);
async getTopicsRuntimeInfo(options?: ListRequestOptions): Promise<TopicsRuntimeInfoResponse> {
log.httpAtomXml(`Performing management operation - listTopics() with options: ${options}`);
const response: HttpOperationResponse = await this.listResources(
"$Resources/Topics",
options,
Expand Down Expand Up @@ -1167,9 +1155,7 @@ export class ServiceBusManagementClient extends ServiceClient {
subscriptionName: string,
options?: ListRequestOptions
): Promise<RulesResponse> {
log.httpAtomXml(
`Performing management operation - listRules() with options: ${options}`
);
log.httpAtomXml(`Performing management operation - listRules() with options: ${options}`);
const fullPath = this.getSubscriptionPath(topicName, subscriptionName) + "/Rules/";
const response: HttpOperationResponse = await this.listResources(
fullPath,
Expand Down Expand Up @@ -1361,8 +1347,8 @@ export class ServiceBusManagementClient extends ServiceClient {
if (listRequestOptions.skip) {
queryParams["$skip"] = listRequestOptions.skip.toString();
}
if (listRequestOptions.top) {
queryParams["$top"] = listRequestOptions.top.toString();
if (listRequestOptions.maxCount) {
queryParams["$top"] = listRequestOptions.maxCount.toString();
}
}

Expand Down
14 changes: 7 additions & 7 deletions sdk/servicebus/service-bus/test/atomManagement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2533,19 +2533,19 @@ async function listEntities(
topicPath?: string,
subscriptionPath?: string,
skip?: number,
top?: number
maxCount?: number
): Promise<any> {
switch (testEntityType) {
case EntityType.QUEUE:
const queueResponse = await serviceBusAtomManagementClient.getQueues({
skip: skip,
top: top
skip,
maxCount
});
return queueResponse;
case EntityType.TOPIC:
const topicResponse = await serviceBusAtomManagementClient.getTopics({
skip: skip,
top: top
skip,
maxCount
});
return topicResponse;
case EntityType.SUBSCRIPTION:
Expand All @@ -2556,7 +2556,7 @@ async function listEntities(
}
const subscriptionResponse = await serviceBusAtomManagementClient.getSubscriptions(
topicPath,
{ skip: skip, top: top }
{ skip, maxCount }
);
return subscriptionResponse;
case EntityType.RULE:
Expand All @@ -2568,7 +2568,7 @@ async function listEntities(
const ruleResponse = await serviceBusAtomManagementClient.getRules(
topicPath,
subscriptionPath,
{ skip: skip, top: top }
{ skip, maxCount }
);
return ruleResponse;
}
Expand Down

0 comments on commit e035738

Please sign in to comment.