Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions sdk/servicebus/arm-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# Release History

## 6.2.0-beta.2 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

## 6.2.0-beta.1 (2023-02-08)

## 6.2.0-beta.2 (2023-04-06)

**Features**

Expand Down
8 changes: 4 additions & 4 deletions sdk/servicebus/arm-servicebus/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "48c0c2036efcf0ccae7c0592a597699aac75ec4d",
"commit": "49c42520b1e6d7dc1d5ace715b0ff54b2dabf788",
"readme": "specification/servicebus/resource-manager/readme.md",
"autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\servicebus\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true",
"autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/servicebus/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.6.1",
"use": "@autorest/typescript@6.0.0-rc.7"
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.0",
"use": "@autorest/typescript@6.0.0-rc.10"
}
20 changes: 6 additions & 14 deletions sdk/servicebus/arm-servicebus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"node": ">=14.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/core-lro": "^2.5.0",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.6.1",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.0",
"tslib": "^2.2.0"
Expand All @@ -33,13 +33,13 @@
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-multi-entry": "^6.0.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"mkdirp": "^1.0.4",
"mkdirp": "^2.1.2",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~4.8.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"dotenv": "^8.2.0",
"dotenv": "^16.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.0.0",
Expand Down Expand Up @@ -111,13 +111,5 @@
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicebus/arm-servicebus",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-servicebus?view=azure-node-preview"
}
}
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicebus/arm-servicebus"
}
12 changes: 6 additions & 6 deletions sdk/servicebus/arm-servicebus/review/arm-servicebus.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import * as coreAuth from '@azure/core-auth';
import * as coreClient from '@azure/core-client';
import { OperationState } from '@azure/core-lro';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { PollerLike } from '@azure/core-lro';
import { PollOperationState } from '@azure/core-lro';
import { SimplePollerLike } from '@azure/core-lro';

// @public
export interface AccessKeys {
Expand Down Expand Up @@ -336,7 +336,7 @@ export interface MigrationConfigProperties extends ProxyResource {

// @public
export interface MigrationConfigs {
beginCreateAndStartMigration(resourceGroupName: string, namespaceName: string, configName: MigrationConfigurationName, parameters: MigrationConfigProperties, options?: MigrationConfigsCreateAndStartMigrationOptionalParams): Promise<PollerLike<PollOperationState<MigrationConfigsCreateAndStartMigrationResponse>, MigrationConfigsCreateAndStartMigrationResponse>>;
beginCreateAndStartMigration(resourceGroupName: string, namespaceName: string, configName: MigrationConfigurationName, parameters: MigrationConfigProperties, options?: MigrationConfigsCreateAndStartMigrationOptionalParams): Promise<SimplePollerLike<OperationState<MigrationConfigsCreateAndStartMigrationResponse>, MigrationConfigsCreateAndStartMigrationResponse>>;
beginCreateAndStartMigrationAndWait(resourceGroupName: string, namespaceName: string, configName: MigrationConfigurationName, parameters: MigrationConfigProperties, options?: MigrationConfigsCreateAndStartMigrationOptionalParams): Promise<MigrationConfigsCreateAndStartMigrationResponse>;
completeMigration(resourceGroupName: string, namespaceName: string, configName: MigrationConfigurationName, options?: MigrationConfigsCompleteMigrationOptionalParams): Promise<void>;
delete(resourceGroupName: string, namespaceName: string, configName: MigrationConfigurationName, options?: MigrationConfigsDeleteOptionalParams): Promise<void>;
Expand Down Expand Up @@ -392,9 +392,9 @@ export type MigrationConfigurationName = string;

// @public
export interface Namespaces {
beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: SBNamespace, options?: NamespacesCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<NamespacesCreateOrUpdateResponse>, NamespacesCreateOrUpdateResponse>>;
beginCreateOrUpdate(resourceGroupName: string, namespaceName: string, parameters: SBNamespace, options?: NamespacesCreateOrUpdateOptionalParams): Promise<SimplePollerLike<OperationState<NamespacesCreateOrUpdateResponse>, NamespacesCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(resourceGroupName: string, namespaceName: string, parameters: SBNamespace, options?: NamespacesCreateOrUpdateOptionalParams): Promise<NamespacesCreateOrUpdateResponse>;
beginDelete(resourceGroupName: string, namespaceName: string, options?: NamespacesDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginDelete(resourceGroupName: string, namespaceName: string, options?: NamespacesDeleteOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>;
beginDeleteAndWait(resourceGroupName: string, namespaceName: string, options?: NamespacesDeleteOptionalParams): Promise<void>;
checkNameAvailability(parameters: CheckNameAvailability, options?: NamespacesCheckNameAvailabilityOptionalParams): Promise<NamespacesCheckNameAvailabilityResponse>;
createOrUpdateAuthorizationRule(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: SBAuthorizationRule, options?: NamespacesCreateOrUpdateAuthorizationRuleOptionalParams): Promise<NamespacesCreateOrUpdateAuthorizationRuleResponse>;
Expand Down Expand Up @@ -644,7 +644,7 @@ export interface PrivateEndpointConnectionListResult {

// @public
export interface PrivateEndpointConnections {
beginDelete(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginDelete(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>;
beginDeleteAndWait(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise<void>;
createOrUpdate(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise<PrivateEndpointConnectionsCreateOrUpdateResponse>;
get(resourceGroupName: string, namespaceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise<PrivateEndpointConnectionsGetResponse>;
Expand Down
54 changes: 31 additions & 23 deletions sdk/servicebus/arm-servicebus/src/lroImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,37 @@
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { AbortSignalLike } from "@azure/abort-controller";
import { LongRunningOperation, LroResponse } from "@azure/core-lro";

export class LroImpl<T> implements LongRunningOperation<T> {
constructor(
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
private args: Record<string, unknown>,
private spec: {
readonly requestBody?: unknown;
readonly path?: string;
readonly httpMethod: string;
} & Record<string, any>,
public requestPath: string = spec.path!,
public requestMethod: string = spec.httpMethod
) {}
public async sendInitialRequest(): Promise<LroResponse<T>> {
return this.sendOperationFn(this.args, this.spec);
}
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
const { requestBody, ...restSpec } = this.spec;
return this.sendOperationFn(this.args, {
...restSpec,
path,
httpMethod: "GET"
});
}
export function createLroSpec<T>(inputs: {
sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;
args: Record<string, unknown>;
spec: {
readonly requestBody?: unknown;
readonly path?: string;
readonly httpMethod: string;
} & Record<string, any>;
}): LongRunningOperation<T> {
const { args, spec, sendOperationFn } = inputs;
return {
requestMethod: spec.httpMethod,
requestPath: spec.path!,
sendInitialRequest: () => sendOperationFn(args, spec),
sendPollRequest: (
path: string,
options?: { abortSignal?: AbortSignalLike }
) => {
const { requestBody, ...restSpec } = spec;
return sendOperationFn(args, {
...restSpec,
httpMethod: "GET",
path,
abortSignal: options?.abortSignal
});
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,9 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
200: {
bodyMapper: Mappers.ArmDisasterRecovery
},
201: {},
201: {
bodyMapper: Mappers.ArmDisasterRecovery
},
default: {
bodyMapper: Mappers.ErrorResponse
}
Expand Down
37 changes: 25 additions & 12 deletions sdk/servicebus/arm-servicebus/src/operations/migrationConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { ServiceBusManagementClient } from "../serviceBusManagementClient";
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
import { LroImpl } from "../lroImpl";
import {
SimplePollerLike,
OperationState,
createHttpPoller
} from "@azure/core-lro";
import { createLroSpec } from "../lroImpl";
import {
MigrationConfigProperties,
MigrationConfigsListNextOptionalParams,
Expand Down Expand Up @@ -152,8 +156,8 @@ export class MigrationConfigsImpl implements MigrationConfigs {
parameters: MigrationConfigProperties,
options?: MigrationConfigsCreateAndStartMigrationOptionalParams
): Promise<
PollerLike<
PollOperationState<MigrationConfigsCreateAndStartMigrationResponse>,
SimplePollerLike<
OperationState<MigrationConfigsCreateAndStartMigrationResponse>,
MigrationConfigsCreateAndStartMigrationResponse
>
> {
Expand All @@ -163,7 +167,7 @@ export class MigrationConfigsImpl implements MigrationConfigs {
): Promise<MigrationConfigsCreateAndStartMigrationResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperation = async (
const sendOperationFn = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
Expand Down Expand Up @@ -196,13 +200,22 @@ export class MigrationConfigsImpl implements MigrationConfigs {
};
};

const lro = new LroImpl(
sendOperation,
{ resourceGroupName, namespaceName, configName, parameters, options },
createAndStartMigrationOperationSpec
);
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
const lro = createLroSpec({
sendOperationFn,
args: {
resourceGroupName,
namespaceName,
configName,
parameters,
options
},
spec: createAndStartMigrationOperationSpec
});
const poller = await createHttpPoller<
MigrationConfigsCreateAndStartMigrationResponse,
OperationState<MigrationConfigsCreateAndStartMigrationResponse>
>(lro, {
restoreFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs
});
await poller.poll();
Expand Down
Loading