From 91bb88bad1167bab3775f9a751811de9764f1de9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 22 Nov 2023 03:21:04 +0000 Subject: [PATCH] CodeGen from PR 3691 in openapi-env-test/azure-rest-api-specs Merge 9d299d7cf949f82280a26d453dca855affb9f351 into 41e238f9fd4ba837de65fca653a971f577529b12 --- common/config/rush/pnpm-lock.yaml | 75 +++-- .../arm-servicelinker/CHANGELOG.md | 20 +- sdk/servicelinker/arm-servicelinker/LICENSE | 2 +- .../arm-servicelinker/_meta.json | 12 +- .../arm-servicelinker/package.json | 30 +- .../review/arm-servicelinker.api.md | 22 +- .../arm-servicelinker/src/lroImpl.ts | 54 ++-- .../arm-servicelinker/src/models/index.ts | 137 +++++----- .../arm-servicelinker/src/models/mappers.ts | 256 +++++++++--------- .../src/operations/linker.ts | 194 +++---------- .../src/operationsInterfaces/linker.ts | 41 +-- .../src/serviceLinkerManagementClient.ts | 2 +- .../arm-servicelinker/tsconfig.json | 10 +- 13 files changed, 355 insertions(+), 500 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 99321d0907bc..79b87021eb67 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1,7 +1,7 @@ lockfileVersion: '6.0' settings: - autoInstallPeers: true + autoInstallPeers: false excludeLinksFromLockfile: false dependencies: @@ -3554,6 +3554,13 @@ packages: requiresBuild: true dev: false + /autorest@3.7.0: + resolution: {integrity: sha512-E6RXXd6S8Kyc0oNY7Ar0IARSMTodIrww7FBR0FZSuQT0J8P3udvqXFexr2K290fr8qm7kAl7OUsWq08FTbIJoA==} + engines: {node: '>=12.0.0'} + hasBin: true + requiresBuild: true + dev: false + /available-typed-arrays@1.0.5: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} @@ -4495,7 +4502,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20231030 + typescript: 5.4.0-dev.20231121 dev: false /eastasianwidth@0.2.0: @@ -9261,8 +9268,14 @@ packages: hasBin: true dev: false - /typescript@5.3.0-dev.20231030: - resolution: {integrity: sha512-azWrF0lAiu8cBHNr6yq3RDkU/DtQScvT48ea3Ngq6oXJ/GPO0n96wCFSRQA5UbZlVVf3fAAqsUfvOdohRbrPVg==} + /typescript@5.3.2: + resolution: {integrity: sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==} + engines: {node: '>=14.17'} + hasBin: true + dev: false + + /typescript@5.4.0-dev.20231121: + resolution: {integrity: sha512-/JUU1WLbuTBKfivcYHR+gvBAjMdhj1r2+flrnh8z7wdy2MDQgxRzSlfktNsbaqoYsOVolVDAPAoHpxVIvJlEgA==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -9894,7 +9907,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -9940,7 +9953,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -10170,7 +10183,7 @@ packages: dependencies: '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 dotenv: 8.6.0 eslint: 8.52.0 @@ -10242,7 +10255,7 @@ packages: '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -10334,7 +10347,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -10814,7 +10827,7 @@ packages: '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -11474,7 +11487,7 @@ packages: '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -11694,7 +11707,7 @@ packages: '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -13963,7 +13976,7 @@ packages: '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -15245,7 +15258,7 @@ packages: '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -15306,20 +15319,22 @@ packages: dev: false file:projects/arm-servicelinker.tgz: - resolution: {integrity: sha512-udECqWC7AR8a+LQyDFyjHN/2bdy4xCXgJNElaRUKiLajilsr5yoVpdjaKA2f6+BRuOKMSKtZD1wvGmOFJ1gviA==, tarball: file:projects/arm-servicelinker.tgz} + resolution: {integrity: sha512-V+HHcUJcge9Fxp7YIVHUVRaD/ai+Uhf/Dq4u7T8FxuV/6ms1kw5SvVCkLZ/qcprrwu6ZOjFyvBEe96ycumzYPg==, tarball: file:projects/arm-servicelinker.tgz} name: '@rush-temp/arm-servicelinker' version: 0.0.0 dependencies: '@azure/identity': 3.3.2 '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 + '@types/mocha': 10.0.3 '@types/node': 18.18.7 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 - mkdirp: 1.0.4 + esm: 3.2.25 + mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.7)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 @@ -16440,7 +16455,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 @@ -17603,7 +17618,7 @@ packages: name: '@rush-temp/dev-tool' version: 0.0.0 dependencies: - '@_ts/max': /typescript@5.2.2 + '@_ts/max': /typescript@5.3.2 '@_ts/min': /typescript@4.2.4 '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@rollup/plugin-commonjs': 25.0.7(rollup@3.29.4) @@ -17669,7 +17684,7 @@ packages: '@microsoft/api-extractor': 7.38.0(@types/node@18.18.7) '@types/chai': 4.3.9 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -18075,7 +18090,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -18120,7 +18135,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -18623,7 +18638,7 @@ packages: '@types/mocha': 10.0.3 '@types/node': 18.18.7 '@types/uuid': 8.3.4 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -18732,7 +18747,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -18778,7 +18793,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -18824,7 +18839,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -18870,7 +18885,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -19998,7 +20013,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -20043,7 +20058,7 @@ packages: '@types/chai': 4.3.9 '@types/mocha': 10.0.3 '@types/node': 18.18.7 - autorest: 3.6.3 + autorest: 3.7.0 c8: 8.0.1 chai: 4.3.10 cross-env: 7.0.3 @@ -20375,7 +20390,7 @@ packages: dev: false file:projects/storage-blob-changefeed.tgz: - resolution: {integrity: sha512-2LtIcl6t12irIaBaBSP/ytxkJA5VSRJ2RUg08UJEi/NVLHhjpx+NQQn/a/ebeAwpa2DefdSkfHRhgh7zn8Qzzg==, tarball: file:projects/storage-blob-changefeed.tgz} + resolution: {integrity: sha512-nBVNUHVbjsSyKfoA2uJNvG+jlJEW9Oq12K9Oha1C6GVY1rZhEpcWrkob0RJe/sCDdrMo0MBUnvL7+PkUsvhR8w==, tarball: file:projects/storage-blob-changefeed.tgz} name: '@rush-temp/storage-blob-changefeed' version: 0.0.0 dependencies: diff --git a/sdk/servicelinker/arm-servicelinker/CHANGELOG.md b/sdk/servicelinker/arm-servicelinker/CHANGELOG.md index b2b4092ccc22..13368a6a0105 100644 --- a/sdk/servicelinker/arm-servicelinker/CHANGELOG.md +++ b/sdk/servicelinker/arm-servicelinker/CHANGELOG.md @@ -1,15 +1,17 @@ # Release History + +## 3.0.0 (2023-11-22) + +**Features** -## 2.1.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Enum KnownClientType has a new value KafkaSpringBoot -### Other Changes +**Breaking Changes** + - Removed operation Linker.beginValidate + - Removed operation Linker.beginValidateAndWait + + ## 2.1.0 (2022-12-16) **Features** @@ -45,4 +47,4 @@ ## 1.0.0 (2022-04-27) -The package of @azure/arm-servicelinker is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +The package of @azure/arm-servicelinker is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/servicelinker/arm-servicelinker/LICENSE b/sdk/servicelinker/arm-servicelinker/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/servicelinker/arm-servicelinker/LICENSE +++ b/sdk/servicelinker/arm-servicelinker/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/servicelinker/arm-servicelinker/_meta.json b/sdk/servicelinker/arm-servicelinker/_meta.json index a88461956128..ae5e7b561680 100644 --- a/sdk/servicelinker/arm-servicelinker/_meta.json +++ b/sdk/servicelinker/arm-servicelinker/_meta.json @@ -1,8 +1,8 @@ { - "commit": "eeb81e9f8a12ad473e8df3a71f2d58682741bcd2", - "readme": "specification\\servicelinker\\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\\servicelinker\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.5.20221215.1 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", - "use": "@autorest/typescript@6.0.0-rc.5.20221215.1" + "commit": "5673035781e51f5eb54ca503c36fb1999354f530", + "readme": "specification/servicelinker/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --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/servicelinker/resource-manager/readme.md --use=@autorest/typescript@^6.0.11", + "repository_url": "https://github.com/openapi-env-test/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.4", + "use": "@autorest/typescript@^6.0.11" } \ No newline at end of file diff --git a/sdk/servicelinker/arm-servicelinker/package.json b/sdk/servicelinker/arm-servicelinker/package.json index 09f7d83e3866..4c1db2eca6c0 100644 --- a/sdk/servicelinker/arm-servicelinker/package.json +++ b/sdk/servicelinker/arm-servicelinker/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ServiceLinkerManagementClient.", - "version": "2.1.1", + "version": "3.0.0", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.4", "@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", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -29,20 +29,22 @@ "types": "./types/arm-servicelinker.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "typescript": "~5.2.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", "@azure/identity": "^3.3.0", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/dev-tool": "^1.0.0", "ts-node": "^10.0.0" }, "repository": { @@ -77,7 +79,7 @@ "extract-api": "api-extractor run --local", "lint": "echo skipped", "audit": "echo skipped", - "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -105,13 +107,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicelinker/arm-servicelinker", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-servicelinker?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicelinker/arm-servicelinker" +} \ No newline at end of file diff --git a/sdk/servicelinker/arm-servicelinker/review/arm-servicelinker.api.md b/sdk/servicelinker/arm-servicelinker/review/arm-servicelinker.api.md index 0d160013a145..af698ba06d9f 100644 --- a/sdk/servicelinker/arm-servicelinker/review/arm-servicelinker.api.md +++ b/sdk/servicelinker/arm-servicelinker/review/arm-servicelinker.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 ActionType = string; @@ -127,6 +127,7 @@ export enum KnownClientType { Dotnet = "dotnet", Go = "go", Java = "java", + KafkaSpringBoot = "kafka-springBoot", Nodejs = "nodejs", None = "none", Php = "php", @@ -179,14 +180,12 @@ export enum KnownVNetSolutionType { // @public export interface Linker { - beginCreateOrUpdate(resourceUri: string, linkerName: string, parameters: LinkerResource, options?: LinkerCreateOrUpdateOptionalParams): Promise, LinkerCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceUri: string, linkerName: string, parameters: LinkerResource, options?: LinkerCreateOrUpdateOptionalParams): Promise, LinkerCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceUri: string, linkerName: string, parameters: LinkerResource, options?: LinkerCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceUri: string, linkerName: string, options?: LinkerDeleteOptionalParams): Promise, void>>; + beginDelete(resourceUri: string, linkerName: string, options?: LinkerDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceUri: string, linkerName: string, options?: LinkerDeleteOptionalParams): Promise; - beginUpdate(resourceUri: string, linkerName: string, parameters: LinkerPatch, options?: LinkerUpdateOptionalParams): Promise, LinkerUpdateResponse>>; + beginUpdate(resourceUri: string, linkerName: string, parameters: LinkerPatch, options?: LinkerUpdateOptionalParams): Promise, LinkerUpdateResponse>>; beginUpdateAndWait(resourceUri: string, linkerName: string, parameters: LinkerPatch, options?: LinkerUpdateOptionalParams): Promise; - beginValidate(resourceUri: string, linkerName: string, options?: LinkerValidateOptionalParams): Promise, LinkerValidateResponse>>; - beginValidateAndWait(resourceUri: string, linkerName: string, options?: LinkerValidateOptionalParams): Promise; get(resourceUri: string, linkerName: string, options?: LinkerGetOptionalParams): Promise; list(resourceUri: string, options?: LinkerListOptionalParams): PagedAsyncIterableIterator; listConfigurations(resourceUri: string, linkerName: string, options?: LinkerListConfigurationsOptionalParams): Promise; @@ -273,15 +272,6 @@ export interface LinkerUpdateOptionalParams extends coreClient.OperationOptions // @public export type LinkerUpdateResponse = LinkerResource; -// @public -export interface LinkerValidateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type LinkerValidateResponse = ValidateOperationResult; - // @public export interface Operation { readonly actionType?: ActionType; diff --git a/sdk/servicelinker/arm-servicelinker/src/lroImpl.ts b/sdk/servicelinker/arm-servicelinker/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/servicelinker/arm-servicelinker/src/lroImpl.ts +++ b/sdk/servicelinker/arm-servicelinker/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/servicelinker/arm-servicelinker/src/models/index.ts b/sdk/servicelinker/arm-servicelinker/src/models/index.ts index 709e0b5102bc..c07d5101fc5e 100644 --- a/sdk/servicelinker/arm-servicelinker/src/models/index.ts +++ b/sdk/servicelinker/arm-servicelinker/src/models/index.ts @@ -174,44 +174,6 @@ export interface LinkerPatch { scope?: string; } -/** The validation operation result for a linker. */ -export interface ValidateOperationResult { - /** Validated linker id. */ - resourceId?: string; - /** Validation operation status. */ - status?: string; - /** The linker name. */ - linkerName?: string; - /** A boolean value indicating whether the connection is available or not */ - isConnectionAvailable?: boolean; - /** The start time of the validation report. */ - reportStartTimeUtc?: Date; - /** The end time of the validation report. */ - reportEndTimeUtc?: Date; - /** The resource id of the linker source application. */ - sourceId?: string; - /** The resource Id of target service. */ - targetId?: string; - /** The authentication type. */ - authType?: AuthType; - /** The detail of validation result */ - validationDetail?: ValidationResultItem[]; -} - -/** The validation item for a linker. */ -export interface ValidationResultItem { - /** The validation item name. */ - name?: string; - /** The display name of validation item */ - description?: string; - /** The result of validation */ - result?: ValidationResultStatus; - /** The error message of validation result */ - errorMessage?: string; - /** The error code of validation result */ - errorCode?: string; -} - /** Configurations for source resource, include appSettings, connectionString and serviceBindings */ export interface SourceConfigurationResult { /** The configuration properties for source resource. */ @@ -302,6 +264,44 @@ export interface SecretInfoBase { secretType: "rawValue" | "keyVaultSecretReference" | "keyVaultSecretUri"; } +/** The validation operation result for a linker. */ +export interface ValidateOperationResult { + /** Validated linker id. */ + resourceId?: string; + /** Validation operation status. */ + status?: string; + /** The linker name. */ + linkerName?: string; + /** A boolean value indicating whether the connection is available or not */ + isConnectionAvailable?: boolean; + /** The start time of the validation report. */ + reportStartTimeUtc?: Date; + /** The end time of the validation report. */ + reportEndTimeUtc?: Date; + /** The resource id of the linker source application. */ + sourceId?: string; + /** The resource Id of target service. */ + targetId?: string; + /** The authentication type. */ + authType?: AuthType; + /** The detail of validation result */ + validationDetail?: ValidationResultItem[]; +} + +/** The validation item for a linker. */ +export interface ValidationResultItem { + /** The validation item name. */ + name?: string; + /** The display name of validation item */ + description?: string; + /** The result of validation */ + result?: ValidationResultStatus; + /** The error message of validation result */ + errorMessage?: string; + /** The error code of validation result */ + errorCode?: string; +} + /** The azure resource info when target service type is AzureResource */ export interface AzureResource extends TargetServiceBase { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -510,7 +510,9 @@ export enum KnownClientType { /** Nodejs */ Nodejs = "nodejs", /** SpringBoot */ - SpringBoot = "springBoot" + SpringBoot = "springBoot", + /** KafkaSpringBoot */ + KafkaSpringBoot = "kafka-springBoot" } /** @@ -527,7 +529,8 @@ export enum KnownClientType { * **ruby** \ * **django** \ * **nodejs** \ - * **springBoot** + * **springBoot** \ + * **kafka-springBoot** */ export type ClientType = string; @@ -573,27 +576,6 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; -/** Known values of {@link ValidationResultStatus} that the service accepts. */ -export enum KnownValidationResultStatus { - /** Success */ - Success = "success", - /** Failure */ - Failure = "failure", - /** Warning */ - Warning = "warning" -} - -/** - * Defines values for ValidationResultStatus. \ - * {@link KnownValidationResultStatus} can be used interchangeably with ValidationResultStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **success** \ - * **failure** \ - * **warning** - */ -export type ValidationResultStatus = string; - /** Known values of {@link Origin} that the service accepts. */ export enum KnownOrigin { /** User */ @@ -666,6 +648,27 @@ export enum KnownSecretType { */ export type SecretType = string; +/** Known values of {@link ValidationResultStatus} that the service accepts. */ +export enum KnownValidationResultStatus { + /** Success */ + Success = "success", + /** Failure */ + Failure = "failure", + /** Warning */ + Warning = "warning" +} + +/** + * Defines values for ValidationResultStatus. \ + * {@link KnownValidationResultStatus} can be used interchangeably with ValidationResultStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **success** \ + * **failure** \ + * **warning** + */ +export type ValidationResultStatus = string; + /** Optional parameters. */ export interface LinkerListOptionalParams extends coreClient.OperationOptions {} @@ -711,18 +714,6 @@ export interface LinkerUpdateOptionalParams /** Contains response data for the update operation. */ export type LinkerUpdateResponse = LinkerResource; -/** Optional parameters. */ -export interface LinkerValidateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the validate operation. */ -export type LinkerValidateResponse = ValidateOperationResult; - /** Optional parameters. */ export interface LinkerListConfigurationsOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/servicelinker/arm-servicelinker/src/models/mappers.ts b/sdk/servicelinker/arm-servicelinker/src/models/mappers.ts index 606d95ae720c..7795d441c94d 100644 --- a/sdk/servicelinker/arm-servicelinker/src/models/mappers.ts +++ b/sdk/servicelinker/arm-servicelinker/src/models/mappers.ts @@ -338,134 +338,6 @@ export const LinkerPatch: coreClient.CompositeMapper = { } }; -export const ValidateOperationResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ValidateOperationResult", - modelProperties: { - resourceId: { - serializedName: "resourceId", - nullable: true, - type: { - name: "String" - } - }, - status: { - serializedName: "status", - nullable: true, - type: { - name: "String" - } - }, - linkerName: { - serializedName: "properties.linkerName", - nullable: true, - type: { - name: "String" - } - }, - isConnectionAvailable: { - serializedName: "properties.isConnectionAvailable", - nullable: true, - type: { - name: "Boolean" - } - }, - reportStartTimeUtc: { - serializedName: "properties.reportStartTimeUtc", - nullable: true, - type: { - name: "DateTime" - } - }, - reportEndTimeUtc: { - serializedName: "properties.reportEndTimeUtc", - nullable: true, - type: { - name: "DateTime" - } - }, - sourceId: { - serializedName: "properties.sourceId", - nullable: true, - type: { - name: "String" - } - }, - targetId: { - serializedName: "properties.targetId", - nullable: true, - type: { - name: "String" - } - }, - authType: { - serializedName: "properties.authType", - nullable: true, - type: { - name: "String" - } - }, - validationDetail: { - serializedName: "properties.validationDetail", - nullable: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ValidationResultItem" - } - } - } - } - } - } -}; - -export const ValidationResultItem: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ValidationResultItem", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - nullable: true, - type: { - name: "String" - } - }, - result: { - serializedName: "result", - nullable: true, - type: { - name: "String" - } - }, - errorMessage: { - serializedName: "errorMessage", - nullable: true, - type: { - name: "String" - } - }, - errorCode: { - serializedName: "errorCode", - nullable: true, - type: { - name: "String" - } - } - } - } -}; - export const SourceConfigurationResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -661,6 +533,134 @@ export const SecretInfoBase: coreClient.CompositeMapper = { } }; +export const ValidateOperationResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidateOperationResult", + modelProperties: { + resourceId: { + serializedName: "resourceId", + nullable: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + nullable: true, + type: { + name: "String" + } + }, + linkerName: { + serializedName: "properties.linkerName", + nullable: true, + type: { + name: "String" + } + }, + isConnectionAvailable: { + serializedName: "properties.isConnectionAvailable", + nullable: true, + type: { + name: "Boolean" + } + }, + reportStartTimeUtc: { + serializedName: "properties.reportStartTimeUtc", + nullable: true, + type: { + name: "DateTime" + } + }, + reportEndTimeUtc: { + serializedName: "properties.reportEndTimeUtc", + nullable: true, + type: { + name: "DateTime" + } + }, + sourceId: { + serializedName: "properties.sourceId", + nullable: true, + type: { + name: "String" + } + }, + targetId: { + serializedName: "properties.targetId", + nullable: true, + type: { + name: "String" + } + }, + authType: { + serializedName: "properties.authType", + nullable: true, + type: { + name: "String" + } + }, + validationDetail: { + serializedName: "properties.validationDetail", + nullable: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ValidationResultItem" + } + } + } + } + } + } +}; + +export const ValidationResultItem: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ValidationResultItem", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + nullable: true, + type: { + name: "String" + } + }, + result: { + serializedName: "result", + nullable: true, + type: { + name: "String" + } + }, + errorMessage: { + serializedName: "errorMessage", + nullable: true, + type: { + name: "String" + } + }, + errorCode: { + serializedName: "errorCode", + nullable: true, + type: { + name: "String" + } + } + } + } +}; + export const AzureResource: coreClient.CompositeMapper = { serializedName: "AzureResource", type: { diff --git a/sdk/servicelinker/arm-servicelinker/src/operations/linker.ts b/sdk/servicelinker/arm-servicelinker/src/operations/linker.ts index 9c6a50a0e00a..7522b3a668bf 100644 --- a/sdk/servicelinker/arm-servicelinker/src/operations/linker.ts +++ b/sdk/servicelinker/arm-servicelinker/src/operations/linker.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 { ServiceLinkerManagementClient } from "../serviceLinkerManagementClient"; -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 { LinkerResource, LinkerListNextOptionalParams, @@ -28,8 +32,6 @@ import { LinkerPatch, LinkerUpdateOptionalParams, LinkerUpdateResponse, - LinkerValidateOptionalParams, - LinkerValidateResponse, LinkerListConfigurationsOptionalParams, LinkerListConfigurationsResponse, LinkerListNextResponse @@ -155,8 +157,8 @@ export class LinkerImpl implements Linker { parameters: LinkerResource, options?: LinkerCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LinkerCreateOrUpdateResponse > > { @@ -166,7 +168,7 @@ export class LinkerImpl implements Linker { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -199,15 +201,18 @@ export class LinkerImpl implements Linker { }; }; - const lro = new LroImpl( - sendOperation, - { resourceUri, linkerName, parameters, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceUri, linkerName, parameters, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + LinkerCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -247,14 +252,14 @@ export class LinkerImpl implements Linker { resourceUri: string, linkerName: string, options?: LinkerDeleteOptionalParams - ): 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 ) => { @@ -287,15 +292,15 @@ export class LinkerImpl implements Linker { }; }; - const lro = new LroImpl( - sendOperation, - { resourceUri, linkerName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceUri, linkerName, 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; @@ -331,7 +336,7 @@ export class LinkerImpl implements Linker { parameters: LinkerPatch, options?: LinkerUpdateOptionalParams ): Promise< - PollerLike, LinkerUpdateResponse> + SimplePollerLike, LinkerUpdateResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -339,7 +344,7 @@ export class LinkerImpl implements Linker { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -372,15 +377,18 @@ export class LinkerImpl implements Linker { }; }; - const lro = new LroImpl( - sendOperation, - { resourceUri, linkerName, parameters, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceUri, linkerName, parameters, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + LinkerUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -409,92 +417,6 @@ export class LinkerImpl implements Linker { return poller.pollUntilDone(); } - /** - * Validate a link. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be - * connected. - * @param linkerName The name Linker resource. - * @param options The options parameters. - */ - async beginValidate( - resourceUri: string, - linkerName: string, - options?: LinkerValidateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - LinkerValidateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, - { resourceUri, linkerName, options }, - validateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" - }); - await poller.poll(); - return poller; - } - - /** - * Validate a link. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be - * connected. - * @param linkerName The name Linker resource. - * @param options The options parameters. - */ - async beginValidateAndWait( - resourceUri: string, - linkerName: string, - options?: LinkerValidateOptionalParams - ): Promise { - const poller = await this.beginValidate(resourceUri, linkerName, options); - return poller.pollUntilDone(); - } - /** * list source configurations for a linker. * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be @@ -653,36 +575,6 @@ const updateOperationSpec: coreClient.OperationSpec = { mediaType: "json", serializer }; -const validateOperationSpec: coreClient.OperationSpec = { - path: - "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/validateLinker", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ValidateOperationResult - }, - 201: { - bodyMapper: Mappers.ValidateOperationResult - }, - 202: { - bodyMapper: Mappers.ValidateOperationResult - }, - 204: { - bodyMapper: Mappers.ValidateOperationResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceUri, - Parameters.linkerName - ], - headerParameters: [Parameters.accept], - serializer -}; const listConfigurationsOperationSpec: coreClient.OperationSpec = { path: "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/listConfigurations", diff --git a/sdk/servicelinker/arm-servicelinker/src/operationsInterfaces/linker.ts b/sdk/servicelinker/arm-servicelinker/src/operationsInterfaces/linker.ts index 2cb2e83ee1aa..6bfd14b25983 100644 --- a/sdk/servicelinker/arm-servicelinker/src/operationsInterfaces/linker.ts +++ b/sdk/servicelinker/arm-servicelinker/src/operationsInterfaces/linker.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 { LinkerResource, LinkerListOptionalParams, @@ -19,8 +19,6 @@ import { LinkerPatch, LinkerUpdateOptionalParams, LinkerUpdateResponse, - LinkerValidateOptionalParams, - LinkerValidateResponse, LinkerListConfigurationsOptionalParams, LinkerListConfigurationsResponse } from "../models"; @@ -64,8 +62,8 @@ export interface Linker { parameters: LinkerResource, options?: LinkerCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, LinkerCreateOrUpdateResponse > >; @@ -94,7 +92,7 @@ export interface Linker { resourceUri: string, linkerName: string, options?: LinkerDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Delete a link. * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be @@ -121,7 +119,7 @@ export interface Linker { parameters: LinkerPatch, options?: LinkerUpdateOptionalParams ): Promise< - PollerLike, LinkerUpdateResponse> + SimplePollerLike, LinkerUpdateResponse> >; /** * Operation to update an existing link. @@ -137,35 +135,6 @@ export interface Linker { parameters: LinkerPatch, options?: LinkerUpdateOptionalParams ): Promise; - /** - * Validate a link. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be - * connected. - * @param linkerName The name Linker resource. - * @param options The options parameters. - */ - beginValidate( - resourceUri: string, - linkerName: string, - options?: LinkerValidateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - LinkerValidateResponse - > - >; - /** - * Validate a link. - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be - * connected. - * @param linkerName The name Linker resource. - * @param options The options parameters. - */ - beginValidateAndWait( - resourceUri: string, - linkerName: string, - options?: LinkerValidateOptionalParams - ): Promise; /** * list source configurations for a linker. * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be diff --git a/sdk/servicelinker/arm-servicelinker/src/serviceLinkerManagementClient.ts b/sdk/servicelinker/arm-servicelinker/src/serviceLinkerManagementClient.ts index abd984510750..259901ba1da4 100644 --- a/sdk/servicelinker/arm-servicelinker/src/serviceLinkerManagementClient.ts +++ b/sdk/servicelinker/arm-servicelinker/src/serviceLinkerManagementClient.ts @@ -44,7 +44,7 @@ export class ServiceLinkerManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-servicelinker/2.1.1`; + const packageDetails = `azsdk-js-arm-servicelinker/3.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/servicelinker/arm-servicelinker/tsconfig.json b/sdk/servicelinker/arm-servicelinker/tsconfig.json index 5c861ab691f6..3e6ae96443f3 100644 --- a/sdk/servicelinker/arm-servicelinker/tsconfig.json +++ b/sdk/servicelinker/arm-servicelinker/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-servicelinker": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"