diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7e571d240b06..a6c468bfc537 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4695,7 +4695,7 @@ packages: dependencies: semver: 7.5.1 shelljs: 0.8.5 - typescript: 5.2.0-dev.20230623 + typescript: 5.2.0-dev.20230624 dev: false /duplexer3/0.1.5: @@ -10149,8 +10149,8 @@ packages: hasBin: true dev: false - /typescript/5.2.0-dev.20230623: - resolution: {integrity: sha512-IduDyLpZBJFdoFuHAXj0QfHwkT6GXtkki03deolpXnPG4R+wiVZGIyyzdS0lfVbFCVejcINPxxBs7ce6E5mp+A==} + /typescript/5.2.0-dev.20230624: + resolution: {integrity: sha512-n/E1V9TddYiQdoaPXXt7yWU214+n0pGWk82auTMaAkOAj4HJy+TLtaeNt4QjDhMLiF2yFCjVma8qNgD24X6VxQ==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -15237,7 +15237,7 @@ packages: dev: false file:projects/arm-operationalinsights.tgz: - resolution: {integrity: sha512-HD3OCLwP4aovozs15FQORTf4fnOVHMLj94ZTLYeDMZTYR4GM1nmjTHqt6re8uibtuManYcf/dFsgUUIatd4Vqw==, tarball: file:projects/arm-operationalinsights.tgz} + resolution: {integrity: sha512-xXCBazs6RS5WNMrEuuCsYHdzF30IcV/hzse91HTJ8i/83Z77po3bxJ6YRa60+UfM1muRGiDBBXM3FE7JuTBU1w==, tarball: file:projects/arm-operationalinsights.tgz} name: '@rush-temp/arm-operationalinsights' version: 0.0.0 dependencies: @@ -15251,8 +15251,8 @@ packages: '@types/node': 14.18.47 chai: 4.3.7 cross-env: 7.0.3 - dotenv: 8.6.0 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -17923,7 +17923,7 @@ packages: dev: false file:projects/confidential-ledger.tgz: - resolution: {integrity: sha512-PFGdQJmKd/QIjnd0o3Yn9afHedMAGR/QPrL0HYCL/SvYVppbLhNmfiuCh3jAD0Pa7hz1M+JzTERWStBWCzQ2gg==, tarball: file:projects/confidential-ledger.tgz} + resolution: {integrity: sha512-cxXcoP19Ey/WDN+gBSbUX3c4qEjxEUb6xCNwYTPweJiPZyNoVpDzkkix60JgoGdj1A61jeMzvp5j7RhDXunoXg==, tarball: file:projects/confidential-ledger.tgz} name: '@rush-temp/confidential-ledger' version: 0.0.0 dependencies: @@ -17959,11 +17959,7 @@ packages: tslib: 2.5.2 typescript: 5.0.4 transitivePeerDependencies: - - bufferutil - - debug - - encoding - supports-color - - utf-8-validate dev: false file:projects/container-registry.tgz: diff --git a/sdk/operationalinsights/arm-operationalinsights/CHANGELOG.md b/sdk/operationalinsights/arm-operationalinsights/CHANGELOG.md index 204c75ca9f92..6f5d42c2c4e6 100644 --- a/sdk/operationalinsights/arm-operationalinsights/CHANGELOG.md +++ b/sdk/operationalinsights/arm-operationalinsights/CHANGELOG.md @@ -1,15 +1,12 @@ # Release History + +## 9.1.0 (2023-06-25) + +**Features** -## 9.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Enum KnownProvisioningStateEnum has a new value Deleting + + ## 9.0.0 (2023-02-09) **Features** diff --git a/sdk/operationalinsights/arm-operationalinsights/_meta.json b/sdk/operationalinsights/arm-operationalinsights/_meta.json index 48df46aa3efc..0220b64d2cfb 100644 --- a/sdk/operationalinsights/arm-operationalinsights/_meta.json +++ b/sdk/operationalinsights/arm-operationalinsights/_meta.json @@ -1,8 +1,8 @@ { - "commit": "c94b5583e56b7ffcfeaee8dbb9e09516c43fc324", + "commit": "8a9e811fa34b02f3fcb90178008d6278f33ddc31", "readme": "specification/operationalinsights/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\\operationalinsights\\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/operationalinsights/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "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.1", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/operationalinsights/arm-operationalinsights/package.json b/sdk/operationalinsights/arm-operationalinsights/package.json index 5c4f21441abe..2d7790525786 100644 --- a/sdk/operationalinsights/arm-operationalinsights/package.json +++ b/sdk/operationalinsights/arm-operationalinsights/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for OperationalInsightsManagementClient.", - "version": "9.0.1", + "version": "9.1.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.3", "@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" @@ -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": "~5.0.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", @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/operationalinsights/arm-operationalinsights", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-operationalinsights?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/operationalinsights/arm-operationalinsights" +} \ No newline at end of file diff --git a/sdk/operationalinsights/arm-operationalinsights/review/arm-operationalinsights.api.md b/sdk/operationalinsights/arm-operationalinsights/review/arm-operationalinsights.api.md index 02c65696148b..1281ef4077f2 100644 --- a/sdk/operationalinsights/arm-operationalinsights/review/arm-operationalinsights.api.md +++ b/sdk/operationalinsights/arm-operationalinsights/review/arm-operationalinsights.api.md @@ -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 AssociatedWorkspace { @@ -107,11 +107,11 @@ export interface ClusterPatch { // @public export interface Clusters { - beginCreateOrUpdate(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: ClustersCreateOrUpdateOptionalParams): Promise, ClustersCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: ClustersCreateOrUpdateOptionalParams): Promise, ClustersCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: ClustersCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, clusterName: string, parameters: ClusterPatch, options?: ClustersUpdateOptionalParams): Promise, ClustersUpdateResponse>>; + beginUpdate(resourceGroupName: string, clusterName: string, parameters: ClusterPatch, options?: ClustersUpdateOptionalParams): Promise, ClustersUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, clusterName: string, parameters: ClusterPatch, options?: ClustersUpdateOptionalParams): Promise; get(resourceGroupName: string, clusterName: string, options?: ClustersGetOptionalParams): Promise; list(options?: ClustersListOptionalParams): PagedAsyncIterableIterator; @@ -553,6 +553,7 @@ export enum KnownLinkedServiceEntityStatus { // @public export enum KnownProvisioningStateEnum { + Deleting = "Deleting", InProgress = "InProgress", Succeeded = "Succeeded", Updating = "Updating" @@ -669,9 +670,9 @@ export interface LinkedServiceListResult { // @public export interface LinkedServices { - beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, linkedServiceName: string, parameters: LinkedService, options?: LinkedServicesCreateOrUpdateOptionalParams): Promise, LinkedServicesCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, linkedServiceName: string, parameters: LinkedService, options?: LinkedServicesCreateOrUpdateOptionalParams): Promise, LinkedServicesCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, workspaceName: string, linkedServiceName: string, parameters: LinkedService, options?: LinkedServicesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, workspaceName: string, linkedServiceName: string, options?: LinkedServicesDeleteOptionalParams): Promise, LinkedServicesDeleteResponse>>; + beginDelete(resourceGroupName: string, workspaceName: string, linkedServiceName: string, options?: LinkedServicesDeleteOptionalParams): Promise, LinkedServicesDeleteResponse>>; beginDeleteAndWait(resourceGroupName: string, workspaceName: string, linkedServiceName: string, options?: LinkedServicesDeleteOptionalParams): Promise; get(resourceGroupName: string, workspaceName: string, linkedServiceName: string, options?: LinkedServicesGetOptionalParams): Promise; listByWorkspace(resourceGroupName: string, workspaceName: string, options?: LinkedServicesListByWorkspaceOptionalParams): PagedAsyncIterableIterator; @@ -1441,11 +1442,11 @@ export type TablePlanEnum = string; // @public export interface Tables { - beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, tableName: string, parameters: Table, options?: TablesCreateOrUpdateOptionalParams): Promise, TablesCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, tableName: string, parameters: Table, options?: TablesCreateOrUpdateOptionalParams): Promise, TablesCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, workspaceName: string, tableName: string, parameters: Table, options?: TablesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, workspaceName: string, tableName: string, options?: TablesDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, workspaceName: string, tableName: string, options?: TablesDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, workspaceName: string, tableName: string, options?: TablesDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, workspaceName: string, tableName: string, parameters: Table, options?: TablesUpdateOptionalParams): Promise, TablesUpdateResponse>>; + beginUpdate(resourceGroupName: string, workspaceName: string, tableName: string, parameters: Table, options?: TablesUpdateOptionalParams): Promise, TablesUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, workspaceName: string, tableName: string, parameters: Table, options?: TablesUpdateOptionalParams): Promise; cancelSearch(resourceGroupName: string, workspaceName: string, tableName: string, options?: TablesCancelSearchOptionalParams): Promise; get(resourceGroupName: string, workspaceName: string, tableName: string, options?: TablesGetOptionalParams): Promise; @@ -1689,9 +1690,9 @@ export interface WorkspacePurgeStatusResponse { // @public export interface Workspaces { - beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, parameters: Workspace, options?: WorkspacesCreateOrUpdateOptionalParams): Promise, WorkspacesCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, parameters: Workspace, options?: WorkspacesCreateOrUpdateOptionalParams): Promise, WorkspacesCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, workspaceName: string, parameters: Workspace, options?: WorkspacesCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, workspaceName: string, options?: WorkspacesDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, workspaceName: string, options?: WorkspacesDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, workspaceName: string, options?: WorkspacesDeleteOptionalParams): Promise; get(resourceGroupName: string, workspaceName: string, options?: WorkspacesGetOptionalParams): Promise; list(options?: WorkspacesListOptionalParams): PagedAsyncIterableIterator; diff --git a/sdk/operationalinsights/arm-operationalinsights/src/lroImpl.ts b/sdk/operationalinsights/arm-operationalinsights/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/lroImpl.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/lroImpl.ts @@ -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 implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + 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 + }); + } + }; } diff --git a/sdk/operationalinsights/arm-operationalinsights/src/models/index.ts b/sdk/operationalinsights/arm-operationalinsights/src/models/index.ts index e4a6ce39e9be..39985f163f69 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/models/index.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/models/index.ts @@ -1047,7 +1047,7 @@ export interface Table extends ProxyResource { readonly systemData?: SystemDataAutoGenerated; /** The table retention in days, between 4 and 730. Setting this property to -1 will default to the workspace retention. */ retentionInDays?: number; - /** The table total retention in days, between 4 and 2555. Setting this property to -1 will default to table retention. */ + /** The table total retention in days, between 4 and 2556. Setting this property to -1 will default to table retention. */ totalRetentionInDays?: number; /** * The table data archive retention in days. Calculated as (totalRetentionInDays-retentionInDays) @@ -1774,13 +1774,13 @@ export type ColumnTypeEnum = string; /** Known values of {@link ColumnDataTypeHintEnum} that the service accepts. */ export enum KnownColumnDataTypeHintEnum { - /** A string that matches the pattern of a URI, for example, scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment */ + /** A string that matches the pattern of a URI, for example, scheme:\//username:password@host:1234\/this\/is\/a\/path?k1=v1&k2=v2#fragment */ Uri = "uri", /** A standard 128-bit GUID following the standard shape, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx */ Guid = "guid", - /** An Azure Resource Model (ARM) path: /subscriptions/{...}/resourceGroups/{...}/providers/Microsoft.{...}/{...}/{...}/{...}... */ + /** An Azure Resource Model (ARM) path: \/subscriptions\/{...}\/resourceGroups\/{...}\/providers\/Microsoft.{...}\/{...}\/{...}\/{...}... */ ArmPath = "armPath", - /** A standard V4/V6 ip address following the standard shape, x.x.x.x/y:y:y:y:y:y:y:y */ + /** A standard V4\/V6 ip address following the standard shape, x.x.x.x\/y:y:y:y:y:y:y:y */ Ip = "ip" } @@ -1866,7 +1866,9 @@ export enum KnownProvisioningStateEnum { /** Table schema is stable and without changes, table data is being updated. */ InProgress = "InProgress", /** Table state is stable and without changes, table is unlocked and open for new updates. */ - Succeeded = "Succeeded" + Succeeded = "Succeeded", + /** Table state is deleting. */ + Deleting = "Deleting" } /** @@ -1876,7 +1878,8 @@ export enum KnownProvisioningStateEnum { * ### Known values supported by the service * **Updating**: Table schema is still being built and updated, table is currently locked for any changes till the procedure is done. \ * **InProgress**: Table schema is stable and without changes, table data is being updated. \ - * **Succeeded**: Table state is stable and without changes, table is unlocked and open for new updates. + * **Succeeded**: Table state is stable and without changes, table is unlocked and open for new updates. \ + * **Deleting**: Table state is deleting. */ export type ProvisioningStateEnum = string; /** Defines values for DataSourceType. */ diff --git a/sdk/operationalinsights/arm-operationalinsights/src/models/mappers.ts b/sdk/operationalinsights/arm-operationalinsights/src/models/mappers.ts index 32d6a1419d3b..4a6b3d8d2aaa 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/models/mappers.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/models/mappers.ts @@ -2667,7 +2667,7 @@ export const Table: coreClient.CompositeMapper = { }, totalRetentionInDays: { constraints: { - InclusiveMaximum: 2555, + InclusiveMaximum: 2556, InclusiveMinimum: 4 }, serializedName: "properties.totalRetentionInDays", diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operationalInsightsManagementClient.ts b/sdk/operationalinsights/arm-operationalinsights/src/operationalInsightsManagementClient.ts index 862c7d6b8948..7fe546c8f4b7 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operationalInsightsManagementClient.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operationalInsightsManagementClient.ts @@ -90,7 +90,7 @@ export class OperationalInsightsManagementClient extends coreClient.ServiceClien credential: credentials }; - const packageDetails = `azsdk-js-arm-operationalinsights/9.0.1`; + const packageDetails = `azsdk-js-arm-operationalinsights/9.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operations/clusters.ts b/sdk/operationalinsights/arm-operationalinsights/src/operations/clusters.ts index 90a05e20fed7..bf0c196d0234 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operations/clusters.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operations/clusters.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { OperationalInsightsManagementClient } from "../operationalInsightsManagementClient"; -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 { Cluster, ClustersListByResourceGroupNextOptionalParams, @@ -209,8 +213,8 @@ export class ClustersImpl implements Clusters { parameters: Cluster, options?: ClustersCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ClustersCreateOrUpdateResponse > > { @@ -220,7 +224,7 @@ export class ClustersImpl implements Clusters { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -253,13 +257,16 @@ export class ClustersImpl implements Clusters { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, parameters, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, parameters, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + ClustersCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -298,14 +305,14 @@ export class ClustersImpl implements Clusters { resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -338,13 +345,13 @@ export class ClustersImpl implements Clusters { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -400,8 +407,8 @@ export class ClustersImpl implements Clusters { parameters: ClusterPatch, options?: ClustersUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ClustersUpdateResponse > > { @@ -411,7 +418,7 @@ export class ClustersImpl implements Clusters { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -444,13 +451,16 @@ export class ClustersImpl implements Clusters { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, parameters, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, parameters, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + ClustersUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operations/linkedServices.ts b/sdk/operationalinsights/arm-operationalinsights/src/operations/linkedServices.ts index 2e849ee9a485..848c01afc6a8 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operations/linkedServices.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operations/linkedServices.ts @@ -12,8 +12,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { OperationalInsightsManagementClient } from "../operationalInsightsManagementClient"; -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 { LinkedService, LinkedServicesListByWorkspaceOptionalParams, @@ -120,8 +124,8 @@ export class LinkedServicesImpl implements LinkedServices { parameters: LinkedService, options?: LinkedServicesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LinkedServicesCreateOrUpdateResponse > > { @@ -131,7 +135,7 @@ export class LinkedServicesImpl implements LinkedServices { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -164,19 +168,22 @@ export class LinkedServicesImpl implements LinkedServices { }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, workspaceName, linkedServiceName, parameters, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + LinkedServicesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -221,8 +228,8 @@ export class LinkedServicesImpl implements LinkedServices { linkedServiceName: string, options?: LinkedServicesDeleteOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LinkedServicesDeleteResponse > > { @@ -232,7 +239,7 @@ export class LinkedServicesImpl implements LinkedServices { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -265,13 +272,16 @@ export class LinkedServicesImpl implements LinkedServices { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, workspaceName, linkedServiceName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, workspaceName, linkedServiceName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + LinkedServicesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operations/tables.ts b/sdk/operationalinsights/arm-operationalinsights/src/operations/tables.ts index b02bb21f2e33..f9c12f8d6e30 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operations/tables.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operations/tables.ts @@ -12,8 +12,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { OperationalInsightsManagementClient } from "../operationalInsightsManagementClient"; -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 { Table, TablesListByWorkspaceOptionalParams, @@ -140,8 +144,8 @@ export class TablesImpl implements Tables { parameters: Table, options?: TablesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, TablesCreateOrUpdateResponse > > { @@ -151,7 +155,7 @@ export class TablesImpl implements Tables { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -184,15 +188,24 @@ export class TablesImpl implements Tables { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, workspaceName, tableName, parameters, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + workspaceName, + tableName, + parameters, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + TablesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -238,7 +251,7 @@ export class TablesImpl implements Tables { parameters: Table, options?: TablesUpdateOptionalParams ): Promise< - PollerLike, TablesUpdateResponse> + SimplePollerLike, TablesUpdateResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -246,7 +259,7 @@ export class TablesImpl implements Tables { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -279,15 +292,24 @@ export class TablesImpl implements Tables { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, workspaceName, tableName, parameters, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + workspaceName, + tableName, + parameters, + options + }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + TablesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -349,14 +371,14 @@ export class TablesImpl implements Tables { workspaceName: string, tableName: string, options?: TablesDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -389,15 +411,15 @@ export class TablesImpl implements Tables { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, workspaceName, tableName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, workspaceName, tableName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operations/workspaces.ts b/sdk/operationalinsights/arm-operationalinsights/src/operations/workspaces.ts index c60866c149da..36e68140373d 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operations/workspaces.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operations/workspaces.ts @@ -12,8 +12,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { OperationalInsightsManagementClient } from "../operationalInsightsManagementClient"; -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 { Workspace, WorkspacesListOptionalParams, @@ -174,8 +178,8 @@ export class WorkspacesImpl implements Workspaces { parameters: Workspace, options?: WorkspacesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, WorkspacesCreateOrUpdateResponse > > { @@ -185,7 +189,7 @@ export class WorkspacesImpl implements Workspaces { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -218,13 +222,16 @@ export class WorkspacesImpl implements Workspaces { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, workspaceName, parameters, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, workspaceName, parameters, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + WorkspacesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -265,14 +272,14 @@ export class WorkspacesImpl implements Workspaces { resourceGroupName: string, workspaceName: string, options?: WorkspacesDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -305,13 +312,13 @@ export class WorkspacesImpl implements Workspaces { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, workspaceName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, workspaceName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/clusters.ts b/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/clusters.ts index b83f2160fb22..ce4acaefc9b6 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/clusters.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/clusters.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Cluster, ClustersListByResourceGroupOptionalParams, @@ -54,8 +54,8 @@ export interface Clusters { parameters: Cluster, options?: ClustersCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ClustersCreateOrUpdateResponse > >; @@ -82,7 +82,7 @@ export interface Clusters { resourceGroupName: string, clusterName: string, options?: ClustersDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes a cluster instance. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -118,8 +118,8 @@ export interface Clusters { parameters: ClusterPatch, options?: ClustersUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ClustersUpdateResponse > >; diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/linkedServices.ts b/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/linkedServices.ts index af9aafa9234b..5e2fbbbab696 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/linkedServices.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/linkedServices.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { LinkedService, LinkedServicesListByWorkspaceOptionalParams, @@ -48,8 +48,8 @@ export interface LinkedServices { parameters: LinkedService, options?: LinkedServicesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LinkedServicesCreateOrUpdateResponse > >; @@ -81,8 +81,8 @@ export interface LinkedServices { linkedServiceName: string, options?: LinkedServicesDeleteOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LinkedServicesDeleteResponse > >; diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/tables.ts b/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/tables.ts index 64f612d1abe0..b5b385dfc28e 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/tables.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/tables.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Table, TablesListByWorkspaceOptionalParams, @@ -51,8 +51,8 @@ export interface Tables { parameters: Table, options?: TablesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, TablesCreateOrUpdateResponse > >; @@ -86,7 +86,7 @@ export interface Tables { parameters: Table, options?: TablesUpdateOptionalParams ): Promise< - PollerLike, TablesUpdateResponse> + SimplePollerLike, TablesUpdateResponse> >; /** * Update a Log Analytics workspace table. @@ -128,7 +128,7 @@ export interface Tables { workspaceName: string, tableName: string, options?: TablesDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Delete a Log Analytics workspace table. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/workspaces.ts b/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/workspaces.ts index 3759fce290cb..69228e478c55 100644 --- a/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/workspaces.ts +++ b/sdk/operationalinsights/arm-operationalinsights/src/operationsInterfaces/workspaces.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Workspace, WorkspacesListOptionalParams, @@ -54,8 +54,8 @@ export interface Workspaces { parameters: Workspace, options?: WorkspacesCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, WorkspacesCreateOrUpdateResponse > >; @@ -84,7 +84,7 @@ export interface Workspaces { resourceGroupName: string, workspaceName: string, options?: WorkspacesDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the * same subscription, resource group and location. The name is kept for 14 days and cannot be used for diff --git a/sdk/operationalinsights/arm-operationalinsights/test/sampleTest.ts b/sdk/operationalinsights/arm-operationalinsights/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/operationalinsights/arm-operationalinsights/tsconfig.json b/sdk/operationalinsights/arm-operationalinsights/tsconfig.json index fccdcc69f6d3..3e6ae96443f3 100644 --- a/sdk/operationalinsights/arm-operationalinsights/tsconfig.json +++ b/sdk/operationalinsights/arm-operationalinsights/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-operationalinsights": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"