diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 14cd0cf2ff92..ad42b888dee9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -734,6 +734,7 @@ packages: /@azure/ai-form-recognizer/3.1.0-beta.3: resolution: {integrity: sha512-+4QtFKNyxAmdqpcYjuAtmWKm/MuOe9kZsbpS9jA9h0YHzngNj5gc67AA4egV9BXOq9x+1phjYTNC/rxiOUr1uQ==} engines: {node: '>=8.0.0'} + deprecated: Please migrate to a supported (non-beta) version of this package dependencies: '@azure/core-auth': 1.4.0 '@azure/core-http': 1.2.6 @@ -3998,7 +3999,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230405 + typescript: 5.1.0-dev.20230406 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8861,8 +8862,8 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230405: - resolution: {integrity: sha512-4unWRVmR6URHndao/lK2XCSabqveeczgOSGNNQbfZW7Hu4b+YND5DlpVQOL/Yaz9olB1FgeZidZwYnTQbOXc6w==} + /typescript/5.1.0-dev.20230406: + resolution: {integrity: sha512-FYnJSNhyGIzc9fCHcPTS/YyboOKfchGpKhrDIcNCqvODooe7BNOWGx6sjMu8xTav8E0905iuPa6TOueq/C6gxg==} engines: {node: '>=12.20'} hasBin: true dev: false @@ -11470,7 +11471,7 @@ packages: dev: false file:projects/arm-datadog.tgz: - resolution: {integrity: sha512-XvqF8JSwyqZ8jhh4WQfZx/rXEJFEfNeEf80hwxG7OXXnP7Eu6ORxDnndVfLUtXtfuBNxdv6FQkV3UEUsBaqssg==, tarball: file:projects/arm-datadog.tgz} + resolution: {integrity: sha512-EKh4G7xNg42p7sfgnR0C6GLILQBYwrA+mLfRtjJNAgFqgQ2LgA6m/0Cdu/YzIW6Fu69MUaFYaXVnAKYcDo+s4w==, tarball: file:projects/arm-datadog.tgz} name: '@rush-temp/arm-datadog' version: 0.0.0 dependencies: @@ -11484,7 +11485,8 @@ packages: '@types/node': 14.18.42 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -15680,7 +15682,7 @@ packages: dev: false file:projects/communication-call-automation.tgz: - resolution: {integrity: sha512-BCxCcEVIqXSsumZ5b/0E4S4wAsI6WI7EsbY8tNQX/yEMYeMOKchffplek8nBnjjMXJh93itkE3Im9HTTAd4HBQ==, tarball: file:projects/communication-call-automation.tgz} + resolution: {integrity: sha512-5/l5GYmYlgc007crbcLNODtwZn7Ge10AZ7fONGz/FWCszObt2YQn/6xXttfS8zKo6XNmUFqlUd6qGhJnyv0FjA==, tarball: file:projects/communication-call-automation.tgz} name: '@rush-temp/communication-call-automation' version: 0.0.0 dependencies: @@ -15722,7 +15724,6 @@ packages: transitivePeerDependencies: - bufferutil - debug - - encoding - supports-color - utf-8-validate dev: false @@ -17171,7 +17172,7 @@ packages: dev: false file:projects/eventgrid.tgz: - resolution: {integrity: sha512-55L6D3Zr5nZu7iJ/bEuLzhKZ2AG4xeZ3aqkU2H9n3h1/bCp8g9Z4IhCZ3zBj5tSyZolhXot3cbINTIHlvDZZtA==, tarball: file:projects/eventgrid.tgz} + resolution: {integrity: sha512-/v2/2q6QmBLAy9IctuvCXDMjEedZw7eU0nNBrsQYr1zZqFHDyQRVJXLYYZVsIjWpuYTb6c/o7fkUhfe8YIuFAg==, tarball: file:projects/eventgrid.tgz} name: '@rush-temp/eventgrid' version: 0.0.0 dependencies: @@ -18744,7 +18745,7 @@ packages: dev: false file:projects/perf-service-bus.tgz: - resolution: {integrity: sha512-X1NvwwnX9KW680X8qYAvWSab7HtqQCZXw/alWYUXwIV5glv3ivLmPYQ5Piid4yK4GyhBRMmd1zmgHk+MHPXiOQ==, tarball: file:projects/perf-service-bus.tgz} + resolution: {integrity: sha512-wioVHbwMitD5Oi7RoiJr6nKap7VrDmz+QfijZnl1FWfCgRdtrCyIpYp2oC+VDnmCiPQavSFrLpW+6qmzGR1jrg==, tarball: file:projects/perf-service-bus.tgz} name: '@rush-temp/perf-service-bus' version: 0.0.0 dependencies: diff --git a/sdk/datadog/arm-datadog/LICENSE b/sdk/datadog/arm-datadog/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/datadog/arm-datadog/LICENSE +++ b/sdk/datadog/arm-datadog/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/datadog/arm-datadog/_meta.json b/sdk/datadog/arm-datadog/_meta.json index 22bec84e7966..581a1b0cd92d 100644 --- a/sdk/datadog/arm-datadog/_meta.json +++ b/sdk/datadog/arm-datadog/_meta.json @@ -1,8 +1,8 @@ { - "commit": "e6a2296d02ec6c4b2c32479198bfbcb9b16ea247", - "readme": "specification\\datadog\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.8.4 --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\\datadog\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", + "commit": "f8bf8ad751a0a70b9dc7577d999ee9d875c7bdbd", + "readme": "specification/datadog/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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/datadog/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.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/datadog/arm-datadog/package.json b/sdk/datadog/arm-datadog/package.json index af8910692645..7546bdacc9b0 100644 --- a/sdk/datadog/arm-datadog/package.json +++ b/sdk/datadog/arm-datadog/package.json @@ -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" @@ -33,12 +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": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -49,7 +50,6 @@ "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/datadog/arm-datadog", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -111,12 +111,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-datadog?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/datadog/arm-datadog" +} \ No newline at end of file diff --git a/sdk/datadog/arm-datadog/review/arm-datadog.api.md b/sdk/datadog/arm-datadog/review/arm-datadog.api.md index c0a0c8859bc1..5fab54e2252c 100644 --- a/sdk/datadog/arm-datadog/review/arm-datadog.api.md +++ b/sdk/datadog/arm-datadog/review/arm-datadog.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 type CreatedByType = string; @@ -129,10 +129,10 @@ export interface DatadogOrganizationProperties { apiKey?: string; applicationKey?: string; enterpriseAppId?: string; - readonly id?: string; + id?: string; linkingAuthCode?: string; linkingClientId?: string; - readonly name?: string; + name?: string; redirectUri?: string; } @@ -407,11 +407,11 @@ export interface MonitorProperties { // @public export interface Monitors { - beginCreate(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise, MonitorsCreateResponse>>; + beginCreate(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise, MonitorsCreateResponse>>; beginCreateAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, monitorName: string, options?: MonitorsUpdateOptionalParams): Promise, MonitorsUpdateResponse>>; + beginUpdate(resourceGroupName: string, monitorName: string, options?: MonitorsUpdateOptionalParams): Promise, MonitorsUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, monitorName: string, options?: MonitorsUpdateOptionalParams): Promise; get(resourceGroupName: string, monitorName: string, options?: MonitorsGetOptionalParams): Promise; getDefaultKey(resourceGroupName: string, monitorName: string, options?: MonitorsGetDefaultKeyOptionalParams): Promise; @@ -618,7 +618,7 @@ export interface ResourceSku { // @public export interface SingleSignOnConfigurations { - beginCreateOrUpdate(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams): Promise, SingleSignOnConfigurationsCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams): Promise, SingleSignOnConfigurationsCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams): Promise; get(resourceGroupName: string, monitorName: string, configurationName: string, options?: SingleSignOnConfigurationsGetOptionalParams): Promise; list(resourceGroupName: string, monitorName: string, options?: SingleSignOnConfigurationsListOptionalParams): PagedAsyncIterableIterator; diff --git a/sdk/datadog/arm-datadog/src/lroImpl.ts b/sdk/datadog/arm-datadog/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/datadog/arm-datadog/src/lroImpl.ts +++ b/sdk/datadog/arm-datadog/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/datadog/arm-datadog/src/microsoftDatadogClient.ts b/sdk/datadog/arm-datadog/src/microsoftDatadogClient.ts index db554916b745..742998fc2e9b 100644 --- a/sdk/datadog/arm-datadog/src/microsoftDatadogClient.ts +++ b/sdk/datadog/arm-datadog/src/microsoftDatadogClient.ts @@ -115,7 +115,7 @@ export class MicrosoftDatadogClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-03-01"; + this.apiVersion = options.apiVersion || "2022-06-01"; this.marketplaceAgreements = new MarketplaceAgreementsImpl(this); this.monitors = new MonitorsImpl(this); this.operations = new OperationsImpl(this); diff --git a/sdk/datadog/arm-datadog/src/models/index.ts b/sdk/datadog/arm-datadog/src/models/index.ts index fd3a3b0b19af..077731a05fae 100644 --- a/sdk/datadog/arm-datadog/src/models/index.ts +++ b/sdk/datadog/arm-datadog/src/models/index.ts @@ -319,16 +319,10 @@ export interface MonitorProperties { /** Datadog organization properties */ export interface DatadogOrganizationProperties { - /** - * Name of the Datadog organization. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Id of the Datadog organization. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; + /** Name of the Datadog organization. */ + name?: string; + /** Id of the Datadog organization. */ + id?: string; /** The auth code used to linking to an existing datadog organization. */ linkingAuthCode?: string; /** The client_id from an existing in exchange for an auth token to link organization. */ diff --git a/sdk/datadog/arm-datadog/src/models/mappers.ts b/sdk/datadog/arm-datadog/src/models/mappers.ts index 46b9c4dae1f7..c9aac343d459 100644 --- a/sdk/datadog/arm-datadog/src/models/mappers.ts +++ b/sdk/datadog/arm-datadog/src/models/mappers.ts @@ -856,14 +856,12 @@ export const DatadogOrganizationProperties: coreClient.CompositeMapper = { modelProperties: { name: { serializedName: "name", - readOnly: true, type: { name: "String" } }, id: { serializedName: "id", - readOnly: true, type: { name: "String" } diff --git a/sdk/datadog/arm-datadog/src/models/parameters.ts b/sdk/datadog/arm-datadog/src/models/parameters.ts index 87b66fb1b926..2621a1f7eea2 100644 --- a/sdk/datadog/arm-datadog/src/models/parameters.ts +++ b/sdk/datadog/arm-datadog/src/models/parameters.ts @@ -61,7 +61,7 @@ export const subscriptionId: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-03-01", + defaultValue: "2022-06-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/datadog/arm-datadog/src/operations/marketplaceAgreements.ts b/sdk/datadog/arm-datadog/src/operations/marketplaceAgreements.ts index 8f920fb81045..8758ae798302 100644 --- a/sdk/datadog/arm-datadog/src/operations/marketplaceAgreements.ts +++ b/sdk/datadog/arm-datadog/src/operations/marketplaceAgreements.ts @@ -178,7 +178,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/datadog/arm-datadog/src/operations/monitors.ts b/sdk/datadog/arm-datadog/src/operations/monitors.ts index 5bf275fece52..5273b6576172 100644 --- a/sdk/datadog/arm-datadog/src/operations/monitors.ts +++ b/sdk/datadog/arm-datadog/src/operations/monitors.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 { MicrosoftDatadogClient } from "../microsoftDatadogClient"; -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 { DatadogApiKey, MonitorsListApiKeysNextOptionalParams, @@ -678,8 +682,8 @@ export class MonitorsImpl implements Monitors { monitorName: string, options?: MonitorsCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, MonitorsCreateResponse > > { @@ -689,7 +693,7 @@ export class MonitorsImpl implements Monitors { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -722,15 +726,18 @@ export class MonitorsImpl implements Monitors { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, monitorName, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, monitorName, options }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + MonitorsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -766,8 +773,8 @@ export class MonitorsImpl implements Monitors { monitorName: string, options?: MonitorsUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, MonitorsUpdateResponse > > { @@ -777,7 +784,7 @@ export class MonitorsImpl implements Monitors { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -810,13 +817,16 @@ export class MonitorsImpl implements Monitors { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, monitorName, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, monitorName, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + MonitorsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -852,14 +862,14 @@ export class MonitorsImpl implements Monitors { resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams - ): 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 ) => { @@ -892,13 +902,13 @@ export class MonitorsImpl implements Monitors { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, monitorName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, monitorName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -1365,7 +1375,6 @@ const listApiKeysNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1387,7 +1396,6 @@ const listHostsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1409,7 +1417,6 @@ const listLinkedResourcesNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1431,7 +1438,6 @@ const listMonitoredResourcesNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1453,7 +1459,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1473,7 +1478,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/datadog/arm-datadog/src/operations/operations.ts b/sdk/datadog/arm-datadog/src/operations/operations.ts index 91abff9ad776..6a4e8a442ebe 100644 --- a/sdk/datadog/arm-datadog/src/operations/operations.ts +++ b/sdk/datadog/arm-datadog/src/operations/operations.ts @@ -35,7 +35,7 @@ export class OperationsImpl implements Operations { } /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2022-06-01 api version. * @param options The options parameters. */ public list( @@ -89,7 +89,7 @@ export class OperationsImpl implements Operations { } /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2022-06-01 api version. * @param options The options parameters. */ private _list( @@ -143,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/datadog/arm-datadog/src/operations/singleSignOnConfigurations.ts b/sdk/datadog/arm-datadog/src/operations/singleSignOnConfigurations.ts index 7e152fc34c15..0b3bc274676e 100644 --- a/sdk/datadog/arm-datadog/src/operations/singleSignOnConfigurations.ts +++ b/sdk/datadog/arm-datadog/src/operations/singleSignOnConfigurations.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 { MicrosoftDatadogClient } from "../microsoftDatadogClient"; -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 { DatadogSingleSignOnResource, SingleSignOnConfigurationsListNextOptionalParams, @@ -147,8 +151,8 @@ export class SingleSignOnConfigurationsImpl configurationName: string, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, SingleSignOnConfigurationsCreateOrUpdateResponse > > { @@ -158,7 +162,7 @@ export class SingleSignOnConfigurationsImpl ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -191,15 +195,18 @@ export class SingleSignOnConfigurationsImpl }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, monitorName, configurationName, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, monitorName, configurationName, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + SingleSignOnConfigurationsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -358,7 +365,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/datadog/arm-datadog/src/operations/tagRules.ts b/sdk/datadog/arm-datadog/src/operations/tagRules.ts index 38d07554f953..50eae80f7c16 100644 --- a/sdk/datadog/arm-datadog/src/operations/tagRules.ts +++ b/sdk/datadog/arm-datadog/src/operations/tagRules.ts @@ -272,7 +272,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/monitors.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/monitors.ts index 4b37fde1d63e..ea773af4e238 100644 --- a/sdk/datadog/arm-datadog/src/operationsInterfaces/monitors.ts +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/monitors.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 { DatadogApiKey, MonitorsListApiKeysOptionalParams, @@ -141,8 +141,8 @@ export interface Monitors { monitorName: string, options?: MonitorsCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, MonitorsCreateResponse > >; @@ -168,8 +168,8 @@ export interface Monitors { monitorName: string, options?: MonitorsUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, MonitorsUpdateResponse > >; @@ -194,7 +194,7 @@ export interface Monitors { resourceGroupName: string, monitorName: string, options?: MonitorsDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Delete a monitor resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/operations.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/operations.ts index accb65d930a9..498b71f6ae66 100644 --- a/sdk/datadog/arm-datadog/src/operationsInterfaces/operations.ts +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/operations.ts @@ -13,7 +13,7 @@ import { OperationResult, OperationsListOptionalParams } from "../models"; /** Interface representing a Operations. */ export interface Operations { /** - * List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. + * List all operations provided by Microsoft.Datadog for the 2022-06-01 api version. * @param options The options parameters. */ list( diff --git a/sdk/datadog/arm-datadog/src/operationsInterfaces/singleSignOnConfigurations.ts b/sdk/datadog/arm-datadog/src/operationsInterfaces/singleSignOnConfigurations.ts index b17f511b90e3..730dbf4960e7 100644 --- a/sdk/datadog/arm-datadog/src/operationsInterfaces/singleSignOnConfigurations.ts +++ b/sdk/datadog/arm-datadog/src/operationsInterfaces/singleSignOnConfigurations.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 { DatadogSingleSignOnResource, SingleSignOnConfigurationsListOptionalParams, @@ -44,8 +44,8 @@ export interface SingleSignOnConfigurations { configurationName: string, options?: SingleSignOnConfigurationsCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, SingleSignOnConfigurationsCreateOrUpdateResponse > >; diff --git a/sdk/datadog/arm-datadog/src/pagingHelper.ts b/sdk/datadog/arm-datadog/src/pagingHelper.ts index d85fc13bce1e..269a2b9814b5 100644 --- a/sdk/datadog/arm-datadog/src/pagingHelper.ts +++ b/sdk/datadog/arm-datadog/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { diff --git a/sdk/datadog/arm-datadog/tsconfig.json b/sdk/datadog/arm-datadog/tsconfig.json index e10856bd8d0b..3e6ae96443f3 100644 --- a/sdk/datadog/arm-datadog/tsconfig.json +++ b/sdk/datadog/arm-datadog/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-datadog": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"