From 7f122d60359aeffc78b34456296cc02535960a41 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 10:47:49 +0000 Subject: [PATCH] CodeGen from PR 16902 in Azure/azure-rest-api-specs Track2 modify readme.go.md 4 (#16902) * Track2 modify readme.go.md 4 * devops --- common/config/rush/pnpm-lock.yaml | 131 +++-- rush.json | 5 + sdk/devops/arm-devops/CHANGELOG.md | 5 + sdk/devops/arm-devops/LICENSE | 21 + sdk/devops/arm-devops/README.md | 98 ++++ sdk/devops/arm-devops/_meta.json | 7 + sdk/devops/arm-devops/api-extractor.json | 18 + sdk/devops/arm-devops/package.json | 92 +++ .../arm-devops/review/arm-devops.api.md | 313 ++++++++++ sdk/devops/arm-devops/rollup.config.js | 188 ++++++ sdk/devops/arm-devops/src/azureDevOps.ts | 90 +++ sdk/devops/arm-devops/src/index.ts | 12 + sdk/devops/arm-devops/src/lroImpl.ts | 34 ++ sdk/devops/arm-devops/src/models/index.ts | 368 ++++++++++++ sdk/devops/arm-devops/src/models/mappers.ts | 548 ++++++++++++++++++ .../arm-devops/src/models/parameters.ts | 120 ++++ sdk/devops/arm-devops/src/operations/index.ts | 11 + .../arm-devops/src/operations/operations.ts | 137 +++++ .../operations/pipelineTemplateDefinitions.ts | 138 +++++ .../arm-devops/src/operations/pipelines.ts | 529 +++++++++++++++++ .../src/operationsInterfaces/index.ts | 11 + .../src/operationsInterfaces/operations.ts | 22 + .../pipelineTemplateDefinitions.ts | 25 + .../src/operationsInterfaces/pipelines.ts | 111 ++++ sdk/devops/arm-devops/test/sampleTest.ts | 48 ++ sdk/devops/arm-devops/tsconfig.json | 19 + sdk/devops/ci.yml | 29 + 27 files changed, 3076 insertions(+), 54 deletions(-) create mode 100644 sdk/devops/arm-devops/CHANGELOG.md create mode 100644 sdk/devops/arm-devops/LICENSE create mode 100644 sdk/devops/arm-devops/README.md create mode 100644 sdk/devops/arm-devops/_meta.json create mode 100644 sdk/devops/arm-devops/api-extractor.json create mode 100644 sdk/devops/arm-devops/package.json create mode 100644 sdk/devops/arm-devops/review/arm-devops.api.md create mode 100644 sdk/devops/arm-devops/rollup.config.js create mode 100644 sdk/devops/arm-devops/src/azureDevOps.ts create mode 100644 sdk/devops/arm-devops/src/index.ts create mode 100644 sdk/devops/arm-devops/src/lroImpl.ts create mode 100644 sdk/devops/arm-devops/src/models/index.ts create mode 100644 sdk/devops/arm-devops/src/models/mappers.ts create mode 100644 sdk/devops/arm-devops/src/models/parameters.ts create mode 100644 sdk/devops/arm-devops/src/operations/index.ts create mode 100644 sdk/devops/arm-devops/src/operations/operations.ts create mode 100644 sdk/devops/arm-devops/src/operations/pipelineTemplateDefinitions.ts create mode 100644 sdk/devops/arm-devops/src/operations/pipelines.ts create mode 100644 sdk/devops/arm-devops/src/operationsInterfaces/index.ts create mode 100644 sdk/devops/arm-devops/src/operationsInterfaces/operations.ts create mode 100644 sdk/devops/arm-devops/src/operationsInterfaces/pipelineTemplateDefinitions.ts create mode 100644 sdk/devops/arm-devops/src/operationsInterfaces/pipelines.ts create mode 100644 sdk/devops/arm-devops/test/sampleTest.ts create mode 100644 sdk/devops/arm-devops/tsconfig.json create mode 100644 sdk/devops/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..bc1046724ede 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -33,6 +33,7 @@ specifiers: '@rush-temp/arm-datafactory': file:./projects/arm-datafactory.tgz '@rush-temp/arm-datalake-analytics': file:./projects/arm-datalake-analytics.tgz '@rush-temp/arm-desktopvirtualization': file:./projects/arm-desktopvirtualization.tgz + '@rush-temp/arm-devops': file:./projects/arm-devops.tgz '@rush-temp/arm-devtestlabs': file:./projects/arm-devtestlabs.tgz '@rush-temp/arm-eventgrid': file:./projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:./projects/arm-eventhub.tgz @@ -214,6 +215,7 @@ dependencies: '@rush-temp/arm-datafactory': file:projects/arm-datafactory.tgz '@rush-temp/arm-datalake-analytics': file:projects/arm-datalake-analytics.tgz '@rush-temp/arm-desktopvirtualization': file:projects/arm-desktopvirtualization.tgz + '@rush-temp/arm-devops': file:projects/arm-devops.tgz '@rush-temp/arm-devtestlabs': file:projects/arm-devtestlabs.tgz '@rush-temp/arm-eventgrid': file:projects/arm-eventgrid.tgz '@rush-temp/arm-eventhub': file:projects/arm-eventhub.tgz @@ -6977,7 +6979,7 @@ packages: hasBin: true dev: false - /ts-node/10.4.0_276ff2ad8f60608417677a4691c0f835: + /ts-node/10.4.0_28670484a221c7e896c5d6b821a5cbb7: resolution: {integrity: sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==} hasBin: true peerDependencies: @@ -7003,11 +7005,11 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.2.4 + typescript: 4.4.4 yn: 3.1.1 dev: false - /ts-node/10.4.0_54d7f9b57c83a5c5120be11b085b9de6: + /ts-node/10.4.0_f9f9f28f986ed7ad377c75abc9f416f4: resolution: {integrity: sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==} hasBin: true peerDependencies: @@ -7033,7 +7035,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.4.4 + typescript: 4.2.4 yn: 3.1.1 dev: false @@ -7629,7 +7631,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7857,7 +7859,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7908,7 +7910,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -7965,7 +7967,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -8479,6 +8481,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-devops.tgz: + resolution: {integrity: sha512-z1Svik1NP+lEO8WCqgY04Q9IDEeCbkMhGRnULZp4Tr9WKbNrRU3C57lzmJfnV/hHX18FSwZkUSdDNxB4d2alaQ==, tarball: file:projects/arm-devops.tgz} + name: '@rush-temp/arm-devops' + version: 0.0.0 + dependencies: + '@microsoft/api-extractor': 7.19.2 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 + cross-env: 7.0.3 + mkdirp: 1.0.4 + mocha: 7.2.0 + rimraf: 3.0.2 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 + tslib: 2.3.1 + typescript: 4.2.4 + uglify-js: 3.14.5 + dev: false + file:projects/arm-devtestlabs.tgz: resolution: {integrity: sha512-Da7OLti0yE0tUlnxlxMEF2r/WEXJbp1hpjEWjPZuyxtAo1ueSJrJgyDJo82zdyzdrc6C0NbuU/xA0vliNtAp0g==, tarball: file:projects/arm-devtestlabs.tgz} name: '@rush-temp/arm-devtestlabs' @@ -9487,7 +9510,7 @@ packages: rollup: 1.32.1 safe-buffer: 5.2.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -9982,7 +10005,7 @@ packages: dev: false file:projects/core-amqp.tgz: - resolution: {integrity: sha512-jmyXvDp5FyZIlqp1zATESQp6qO2NqjKSfY5o9ojPsKN/g9WJ45RL4jfy+cD5u8C2t9jSDTsCoL+jbiLptpkDLA==, tarball: file:projects/core-amqp.tgz} + resolution: {integrity: sha512-nAZlMW/WFVSloK1iVzoSJNx9CHjvMl4/kJrnq1s5Okn96/AQX19SYkqfdvmew1Oy3bxfDC2g3n3e1CFLrlSyEg==, tarball: file:projects/core-amqp.tgz} name: '@rush-temp/core-amqp' version: 0.0.0 dependencies: @@ -10025,7 +10048,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 url: 0.11.0 @@ -10111,7 +10134,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -10342,7 +10365,7 @@ packages: shx: 0.3.3 sinon: 9.2.4 tough-cookie: 4.0.0 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 tunnel: 0.0.6 typescript: 4.2.4 @@ -10390,7 +10413,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -10657,7 +10680,7 @@ packages: sinon: 9.2.4 snap-shot-it: 7.9.6 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 universal-user-agent: 6.0.0 @@ -10714,7 +10737,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -10760,7 +10783,7 @@ packages: rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 - ts-node: 10.4.0_54d7f9b57c83a5c5120be11b085b9de6 + ts-node: 10.4.0_28670484a221c7e896c5d6b821a5cbb7 tslib: 2.3.1 typescript: 4.4.4 yaml: 1.10.2 @@ -10917,7 +10940,7 @@ packages: rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 rollup-plugin-terser: 5.3.1_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -10979,7 +11002,7 @@ packages: rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11034,7 +11057,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11087,7 +11110,7 @@ packages: prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11289,7 +11312,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -11553,7 +11576,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11702,7 +11725,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11774,7 +11797,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11794,7 +11817,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11814,7 +11837,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11834,7 +11857,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11873,7 +11896,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11894,7 +11917,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11917,7 +11940,7 @@ packages: moment: 2.29.1 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -11937,7 +11960,7 @@ packages: eslint: 7.32.0 prettier: 1.19.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11957,7 +11980,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -11978,7 +12001,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12000,7 +12023,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12021,7 +12044,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12041,7 +12064,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -12060,7 +12083,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 transitivePeerDependencies: @@ -12081,7 +12104,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12104,7 +12127,7 @@ packages: node-fetch: 2.6.6 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12125,7 +12148,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12146,7 +12169,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12167,7 +12190,7 @@ packages: eslint: 7.32.0 prettier: 2.5.1 rimraf: 3.0.2 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uuid: 8.3.2 @@ -12539,7 +12562,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12608,7 +12631,7 @@ packages: rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 ws: 8.3.0 @@ -12671,7 +12694,7 @@ packages: rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12734,7 +12757,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12797,7 +12820,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12858,7 +12881,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12916,7 +12939,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -12976,7 +12999,7 @@ packages: rollup-plugin-terser: 5.3.1_rollup@1.32.1 rollup-plugin-visualizer: 4.2.2_rollup@1.32.1 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 util: 0.12.4 @@ -13028,7 +13051,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -13082,7 +13105,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 @@ -13135,7 +13158,7 @@ packages: rollup: 1.32.1 sinon: 9.2.4 source-map-support: 0.5.21 - ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 + ts-node: 10.4.0_f9f9f28f986ed7ad377c75abc9f416f4 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.14.5 diff --git a/rush.json b/rush.json index 66a9aa13703f..0a2a4fb683f4 100644 --- a/rush.json +++ b/rush.json @@ -1215,6 +1215,11 @@ "packageName": "@azure/arm-containerinstance", "projectFolder": "sdk/containerinstance/arm-containerinstance", "versionPolicyName": "management" + }, + { + "packageName": "@azure/arm-devops", + "projectFolder": "sdk/devops/arm-devops", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/devops/arm-devops/CHANGELOG.md b/sdk/devops/arm-devops/CHANGELOG.md new file mode 100644 index 000000000000..d1be74e6e4c0 --- /dev/null +++ b/sdk/devops/arm-devops/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-01-05) + +The package of @azure/arm-devops 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/devops/arm-devops/LICENSE b/sdk/devops/arm-devops/LICENSE new file mode 100644 index 000000000000..5d1d36e0af80 --- /dev/null +++ b/sdk/devops/arm-devops/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/devops/arm-devops/README.md b/sdk/devops/arm-devops/README.md new file mode 100644 index 000000000000..0d7dc4bcb21b --- /dev/null +++ b/sdk/devops/arm-devops/README.md @@ -0,0 +1,98 @@ +# Azure Service client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +Azure DevOps Resource Provider + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devops/arm-devops) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-devops) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-devops?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-devops` package + +Install the Azure Service client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-devops +``` + +### Create and authenticate a `AzureDevOps` + +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { AzureDevOps } = require("@azure/arm-devops"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new AzureDevOps(new DefaultAzureCredential(), subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### AzureDevOps + +`AzureDevOps` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdevops%2Farm-devops%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/devops/arm-devops/_meta.json b/sdk/devops/arm-devops/_meta.json new file mode 100644 index 000000000000..d6a88016da5f --- /dev/null +++ b/sdk/devops/arm-devops/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "cea6492a1e41b3f3b4f8b4f69bdcc10431e79c0e", + "readme": "specification/devops/resource-manager/readme.md", + "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/devops/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "use": "@autorest/typescript@6.0.0-alpha.16.20211130.1" +} \ No newline at end of file diff --git a/sdk/devops/arm-devops/api-extractor.json b/sdk/devops/arm-devops/api-extractor.json new file mode 100644 index 000000000000..f5ecb36a595f --- /dev/null +++ b/sdk/devops/arm-devops/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { "enabled": true }, + "apiReport": { "enabled": true, "reportFolder": "./review" }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-devops.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/devops/arm-devops/package.json b/sdk/devops/arm-devops/package.json new file mode 100644 index 000000000000..e4024b47f07f --- /dev/null +++ b/sdk/devops/arm-devops/package.json @@ -0,0 +1,92 @@ +{ + "name": "@azure/arm-devops", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for AzureDevOps.", + "version": "1.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, + "dependencies": { + "@azure/core-lro": "^2.2.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "tslib": "^2.2.0" + }, + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-devops.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", + "mkdirp": "^1.0.4", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", + "typescript": "~4.2.0", + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "cross-env": "^7.0.2" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devops/arm-devops", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "rollup.config.js", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "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", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:browser": "echo skipped", + "docs": "echo skipped" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/devops/arm-devops/review/arm-devops.api.md b/sdk/devops/arm-devops/review/arm-devops.api.md new file mode 100644 index 000000000000..23c1a0f3447c --- /dev/null +++ b/sdk/devops/arm-devops/review/arm-devops.api.md @@ -0,0 +1,313 @@ +## API Report File for "@azure/arm-devops" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export interface Authorization { + authorizationType: AuthorizationType; + parameters?: { + [propertyName: string]: string; + }; +} + +// @public +export type AuthorizationType = string; + +// @public (undocumented) +export class AzureDevOps extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureDevOpsOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + operations: Operations; + // (undocumented) + pipelines: Pipelines; + // (undocumented) + pipelineTemplateDefinitions: PipelineTemplateDefinitions; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface AzureDevOpsOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface BootstrapConfiguration { + repository?: CodeRepository; + template: PipelineTemplate; +} + +// @public +export interface CloudError { + error?: CloudErrorBody; +} + +// @public +export interface CloudErrorBody { + code?: string; + details?: CloudErrorBody[]; + message?: string; + target?: string; +} + +// @public +export interface CodeRepository { + authorization?: Authorization; + defaultBranch: string; + id: string; + properties?: { + [propertyName: string]: string; + }; + repositoryType: CodeRepositoryType; +} + +// @public +export type CodeRepositoryType = string; + +// @public +export type InputDataType = string; + +// @public +export interface InputDescriptor { + description?: string; + id: string; + possibleValues?: InputValue[]; + type: InputDataType; +} + +// @public +export interface InputValue { + displayValue?: string; + value?: string; +} + +// @public +export enum KnownAuthorizationType { + // (undocumented) + PersonalAccessToken = "personalAccessToken" +} + +// @public +export enum KnownCodeRepositoryType { + // (undocumented) + GitHub = "gitHub", + // (undocumented) + VstsGit = "vstsGit" +} + +// @public +export enum KnownInputDataType { + // (undocumented) + Authorization = "Authorization", + // (undocumented) + Bool = "Bool", + // (undocumented) + Int = "Int", + // (undocumented) + SecureString = "SecureString", + // (undocumented) + String = "String" +} + +// @public +export interface Operation { + readonly description?: string; + isDataAction?: string; + readonly name?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export interface OrganizationReference { + readonly id?: string; + name: string; +} + +// @public +export type Pipeline = Resource & { + readonly pipelineId?: number; + organization: OrganizationReference; + project: ProjectReference; + bootstrapConfiguration: BootstrapConfiguration; +}; + +// @public +export interface PipelineListResult { + nextLink?: string; + value?: Pipeline[]; +} + +// @public +export interface Pipelines { + beginCreateOrUpdate(resourceGroupName: string, pipelineName: string, createOperationParameters: Pipeline, options?: PipelinesCreateOrUpdateOptionalParams): Promise, PipelinesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, pipelineName: string, createOperationParameters: Pipeline, options?: PipelinesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, pipelineName: string, options?: PipelinesDeleteOptionalParams): Promise; + get(resourceGroupName: string, pipelineName: string, options?: PipelinesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: PipelinesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: PipelinesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + update(resourceGroupName: string, pipelineName: string, updateOperationParameters: PipelineUpdateParameters, options?: PipelinesUpdateOptionalParams): Promise; +} + +// @public +export interface PipelinesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PipelinesCreateOrUpdateResponse = Pipeline; + +// @public +export interface PipelinesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface PipelinesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelinesGetResponse = Pipeline; + +// @public +export interface PipelinesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelinesListByResourceGroupNextResponse = PipelineListResult; + +// @public +export interface PipelinesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelinesListByResourceGroupResponse = PipelineListResult; + +// @public +export interface PipelinesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelinesListBySubscriptionNextResponse = PipelineListResult; + +// @public +export interface PipelinesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelinesListBySubscriptionResponse = PipelineListResult; + +// @public +export interface PipelinesUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelinesUpdateResponse = Pipeline; + +// @public +export interface PipelineTemplate { + id: string; + parameters?: { + [propertyName: string]: string; + }; +} + +// @public +export interface PipelineTemplateDefinition { + description?: string; + id: string; + inputs?: InputDescriptor[]; +} + +// @public +export interface PipelineTemplateDefinitionListResult { + nextLink?: string; + value?: PipelineTemplateDefinition[]; +} + +// @public +export interface PipelineTemplateDefinitions { + list(options?: PipelineTemplateDefinitionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PipelineTemplateDefinitionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelineTemplateDefinitionsListNextResponse = PipelineTemplateDefinitionListResult; + +// @public +export interface PipelineTemplateDefinitionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PipelineTemplateDefinitionsListResponse = PipelineTemplateDefinitionListResult; + +// @public +export interface PipelineUpdateParameters { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ProjectReference { + readonly id?: string; + name: string; +} + +// @public +export interface Resource { + readonly id?: string; + location?: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/devops/arm-devops/rollup.config.js b/sdk/devops/arm-devops/rollup.config.js new file mode 100644 index 000000000000..9be1955eb7f1 --- /dev/null +++ b/sdk/devops/arm-devops/rollup.config.js @@ -0,0 +1,188 @@ +/* + * 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 nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + +// #region Warning Handler + +/** + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEvalWarnings(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependencyWarnings(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve(), cjs()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/devops/arm-devops/src/azureDevOps.ts b/sdk/devops/arm-devops/src/azureDevOps.ts new file mode 100644 index 000000000000..40f300308883 --- /dev/null +++ b/sdk/devops/arm-devops/src/azureDevOps.ts @@ -0,0 +1,90 @@ +/* + * 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 * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + PipelineTemplateDefinitionsImpl, + PipelinesImpl +} from "./operations"; +import { + Operations, + PipelineTemplateDefinitions, + Pipelines +} from "./operationsInterfaces"; +import { AzureDevOpsOptionalParams } from "./models"; + +export class AzureDevOps extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the AzureDevOps class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId Unique identifier of the Azure subscription. This is a GUID-formatted string + * (e.g. 00000000-0000-0000-0000-000000000000). + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: AzureDevOpsOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AzureDevOpsOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-devops/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2019-07-01-preview"; + this.operations = new OperationsImpl(this); + this.pipelineTemplateDefinitions = new PipelineTemplateDefinitionsImpl( + this + ); + this.pipelines = new PipelinesImpl(this); + } + + operations: Operations; + pipelineTemplateDefinitions: PipelineTemplateDefinitions; + pipelines: Pipelines; +} diff --git a/sdk/devops/arm-devops/src/index.ts b/sdk/devops/arm-devops/src/index.ts new file mode 100644 index 000000000000..ad6490548cb7 --- /dev/null +++ b/sdk/devops/arm-devops/src/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +/// +export * from "./models"; +export { AzureDevOps } from "./azureDevOps"; +export * from "./operationsInterfaces"; diff --git a/sdk/devops/arm-devops/src/lroImpl.ts b/sdk/devops/arm-devops/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/devops/arm-devops/src/lroImpl.ts @@ -0,0 +1,34 @@ +/* + * 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 { 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" + }); + } +} diff --git a/sdk/devops/arm-devops/src/models/index.ts b/sdk/devops/arm-devops/src/models/index.ts new file mode 100644 index 000000000000..efddfd5daa45 --- /dev/null +++ b/sdk/devops/arm-devops/src/models/index.ts @@ -0,0 +1,368 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +/** Result of a request to list all operations supported by Microsoft.DevOps resource provider. */ +export interface OperationListResult { + /** + * List of operations supported by Microsoft.DevOps resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** The URL to get the next set of operations, if there are any. */ + nextLink?: string; +} + +/** Properties of an Operation. */ +export interface Operation { + /** + * Name of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** Indicates whether the operation applies to data-plane. */ + isDataAction?: string; + /** + * Friendly name of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * Friendly name of the resource type the operation applies to. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * Friendly description of the operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * Friendly name of the resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; +} + +/** An error response from the Pipelines Resource Provider. */ +export interface CloudError { + /** Details of the error from the Pipelines Resource Provider. */ + error?: CloudErrorBody; +} + +/** An error response from the Pipelines Resource Provider. */ +export interface CloudErrorBody { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ + code?: string; + /** A message describing the error, intended to be suitable for display in a user interface. */ + message?: string; + /** The target of the particular error. For example, the name of the property in error or the method where the error occurred. */ + target?: string; + /** A list of additional details about the error. */ + details?: CloudErrorBody[]; +} + +/** Result of a request to list all pipeline template definitions. */ +export interface PipelineTemplateDefinitionListResult { + /** List of pipeline template definitions. */ + value?: PipelineTemplateDefinition[]; + /** The URL to get the next set of pipeline template definitions, if there are any. */ + nextLink?: string; +} + +/** Definition of a pipeline template. */ +export interface PipelineTemplateDefinition { + /** Unique identifier of the pipeline template. */ + id: string; + /** Description of the pipeline enabled by the template. */ + description?: string; + /** List of input parameters required by the template to create a pipeline. */ + inputs?: InputDescriptor[]; +} + +/** Representation of a pipeline template input parameter. */ +export interface InputDescriptor { + /** Identifier of the input parameter. */ + id: string; + /** Description of the input parameter. */ + description?: string; + /** Data type of the value of the input parameter. */ + type: InputDataType; + /** List of possible values for the input parameter. */ + possibleValues?: InputValue[]; +} + +/** Representation of a pipeline template input parameter value. */ +export interface InputValue { + /** Value of an input parameter. */ + value?: string; + /** Description of the input parameter value. */ + displayValue?: string; +} + +/** Reference to an Azure DevOps Organization. */ +export interface OrganizationReference { + /** + * Unique immutable identifier for the Azure DevOps Organization. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** Name of the Azure DevOps Organization. */ + name: string; +} + +/** Reference to an Azure DevOps Project. */ +export interface ProjectReference { + /** + * Unique immutable identifier of the Azure DevOps Project. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** Name of the Azure DevOps Project. */ + name: string; +} + +/** Configuration used to bootstrap a Pipeline. */ +export interface BootstrapConfiguration { + /** Repository containing the source code for the pipeline. */ + repository?: CodeRepository; + /** Template used to bootstrap the pipeline. */ + template: PipelineTemplate; +} + +/** Repository containing the source code for a pipeline. */ +export interface CodeRepository { + /** Type of code repository. */ + repositoryType: CodeRepositoryType; + /** Unique immutable identifier of the code repository. */ + id: string; + /** Default branch used to configure Continuous Integration (CI) in the pipeline. */ + defaultBranch: string; + /** Authorization info to access the code repository. */ + authorization?: Authorization; + /** Repository-specific properties. */ + properties?: { [propertyName: string]: string }; +} + +/** Authorization info used to access a resource (like code repository). */ +export interface Authorization { + /** Type of authorization. */ + authorizationType: AuthorizationType; + /** Authorization parameters corresponding to the authorization type. */ + parameters?: { [propertyName: string]: string }; +} + +/** Template used to bootstrap the pipeline. */ +export interface PipelineTemplate { + /** Unique identifier of the pipeline template. */ + id: string; + /** Dictionary of input parameters used in the pipeline template. */ + parameters?: { [propertyName: string]: string }; +} + +/** An Azure Resource Manager (ARM) resource. */ +export interface Resource { + /** + * Resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Resource Type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** Resource Tags */ + tags?: { [propertyName: string]: string }; + /** Resource Location */ + location?: string; + /** + * Resource Name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; +} + +/** Request payload used to update an existing Azure Pipeline. */ +export interface PipelineUpdateParameters { + /** Dictionary of key-value pairs to be set as tags on the Azure Pipeline. This will overwrite any existing tags. */ + tags?: { [propertyName: string]: string }; +} + +/** Result of a request to list all Azure Pipelines under a given scope. */ +export interface PipelineListResult { + /** List of pipelines. */ + value?: Pipeline[]; + /** URL to get the next set of Pipelines, if there are any. */ + nextLink?: string; +} + +/** Azure DevOps Pipeline used to configure Continuous Integration (CI) & Continuous Delivery (CD) for Azure resources. */ +export type Pipeline = Resource & { + /** + * Unique identifier of the Azure Pipeline within the Azure DevOps Project. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly pipelineId?: number; + /** Reference to the Azure DevOps Organization containing the Pipeline. */ + organization: OrganizationReference; + /** Reference to the Azure DevOps Project containing the Pipeline. */ + project: ProjectReference; + /** Configuration used to bootstrap the Pipeline. */ + bootstrapConfiguration: BootstrapConfiguration; +}; + +/** Known values of {@link InputDataType} that the service accepts. */ +export enum KnownInputDataType { + String = "String", + SecureString = "SecureString", + Int = "Int", + Bool = "Bool", + Authorization = "Authorization" +} + +/** + * Defines values for InputDataType. \ + * {@link KnownInputDataType} can be used interchangeably with InputDataType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **String** \ + * **SecureString** \ + * **Int** \ + * **Bool** \ + * **Authorization** + */ +export type InputDataType = string; + +/** Known values of {@link CodeRepositoryType} that the service accepts. */ +export enum KnownCodeRepositoryType { + GitHub = "gitHub", + VstsGit = "vstsGit" +} + +/** + * Defines values for CodeRepositoryType. \ + * {@link KnownCodeRepositoryType} can be used interchangeably with CodeRepositoryType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **gitHub** \ + * **vstsGit** + */ +export type CodeRepositoryType = string; + +/** Known values of {@link AuthorizationType} that the service accepts. */ +export enum KnownAuthorizationType { + PersonalAccessToken = "personalAccessToken" +} + +/** + * Defines values for AuthorizationType. \ + * {@link KnownAuthorizationType} can be used interchangeably with AuthorizationType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **personalAccessToken** + */ +export type AuthorizationType = string; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface PipelineTemplateDefinitionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type PipelineTemplateDefinitionsListResponse = PipelineTemplateDefinitionListResult; + +/** Optional parameters. */ +export interface PipelineTemplateDefinitionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PipelineTemplateDefinitionsListNextResponse = PipelineTemplateDefinitionListResult; + +/** Optional parameters. */ +export interface PipelinesCreateOrUpdateOptionalParams + 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 createOrUpdate operation. */ +export type PipelinesCreateOrUpdateResponse = Pipeline; + +/** Optional parameters. */ +export interface PipelinesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PipelinesGetResponse = Pipeline; + +/** Optional parameters. */ +export interface PipelinesUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the update operation. */ +export type PipelinesUpdateResponse = Pipeline; + +/** Optional parameters. */ +export interface PipelinesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface PipelinesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type PipelinesListByResourceGroupResponse = PipelineListResult; + +/** Optional parameters. */ +export interface PipelinesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type PipelinesListBySubscriptionResponse = PipelineListResult; + +/** Optional parameters. */ +export interface PipelinesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type PipelinesListByResourceGroupNextResponse = PipelineListResult; + +/** Optional parameters. */ +export interface PipelinesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type PipelinesListBySubscriptionNextResponse = PipelineListResult; + +/** Optional parameters. */ +export interface AzureDevOpsOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/devops/arm-devops/src/models/mappers.ts b/sdk/devops/arm-devops/src/models/mappers.ts new file mode 100644 index 000000000000..1e714df2966f --- /dev/null +++ b/sdk/devops/arm-devops/src/models/mappers.ts @@ -0,0 +1,548 @@ +/* + * 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 * as coreClient from "@azure/core-client"; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "String" + } + }, + operation: { + serializedName: "display.operation", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "display.resource", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "display.description", + readOnly: true, + type: { + name: "String" + } + }, + provider: { + serializedName: "display.provider", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const CloudError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudError", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "CloudErrorBody" + } + } + } + } +}; + +export const CloudErrorBody: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudErrorBody", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CloudErrorBody" + } + } + } + } + } + } +}; + +export const PipelineTemplateDefinitionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelineTemplateDefinitionListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PipelineTemplateDefinition" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PipelineTemplateDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelineTemplateDefinition", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + inputs: { + serializedName: "inputs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InputDescriptor" + } + } + } + } + } + } +}; + +export const InputDescriptor: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InputDescriptor", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + possibleValues: { + serializedName: "possibleValues", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InputValue" + } + } + } + } + } + } +}; + +export const InputValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InputValue", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" + } + }, + displayValue: { + serializedName: "displayValue", + type: { + name: "String" + } + } + } + } +}; + +export const OrganizationReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OrganizationReference", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ProjectReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProjectReference", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const BootstrapConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BootstrapConfiguration", + modelProperties: { + repository: { + serializedName: "repository", + type: { + name: "Composite", + className: "CodeRepository" + } + }, + template: { + serializedName: "template", + type: { + name: "Composite", + className: "PipelineTemplate" + } + } + } + } +}; + +export const CodeRepository: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CodeRepository", + modelProperties: { + repositoryType: { + serializedName: "repositoryType", + required: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + defaultBranch: { + serializedName: "defaultBranch", + required: true, + type: { + name: "String" + } + }, + authorization: { + serializedName: "authorization", + type: { + name: "Composite", + className: "Authorization" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const Authorization: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Authorization", + modelProperties: { + authorizationType: { + serializedName: "authorizationType", + required: true, + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const PipelineTemplate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelineTemplate", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PipelineUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelineUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; + +export const PipelineListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PipelineListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Pipeline" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const Pipeline: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Pipeline", + modelProperties: { + ...Resource.type.modelProperties, + pipelineId: { + serializedName: "properties.pipelineId", + readOnly: true, + type: { + name: "Number" + } + }, + organization: { + serializedName: "properties.organization", + type: { + name: "Composite", + className: "OrganizationReference" + } + }, + project: { + serializedName: "properties.project", + type: { + name: "Composite", + className: "ProjectReference" + } + }, + bootstrapConfiguration: { + serializedName: "properties.bootstrapConfiguration", + type: { + name: "Composite", + className: "BootstrapConfiguration" + } + } + } + } +}; diff --git a/sdk/devops/arm-devops/src/models/parameters.ts b/sdk/devops/arm-devops/src/models/parameters.ts new file mode 100644 index 000000000000..936ab9907dd9 --- /dev/null +++ b/sdk/devops/arm-devops/src/models/parameters.ts @@ -0,0 +1,120 @@ +/* + * 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 { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + Pipeline as PipelineMapper, + PipelineUpdateParameters as PipelineUpdateParametersMapper +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2019-07-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const createOperationParameters: OperationParameter = { + parameterPath: "createOperationParameters", + mapper: PipelineMapper +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "String" + } + } +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + serializedName: "resourceGroupName", + required: true, + type: { + name: "String" + } + } +}; + +export const pipelineName: OperationURLParameter = { + parameterPath: "pipelineName", + mapper: { + serializedName: "pipelineName", + required: true, + type: { + name: "String" + } + } +}; + +export const updateOperationParameters: OperationParameter = { + parameterPath: "updateOperationParameters", + mapper: PipelineUpdateParametersMapper +}; diff --git a/sdk/devops/arm-devops/src/operations/index.ts b/sdk/devops/arm-devops/src/operations/index.ts new file mode 100644 index 000000000000..2c123e604262 --- /dev/null +++ b/sdk/devops/arm-devops/src/operations/index.ts @@ -0,0 +1,11 @@ +/* + * 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. + */ + +export * from "./operations"; +export * from "./pipelineTemplateDefinitions"; +export * from "./pipelines"; diff --git a/sdk/devops/arm-devops/src/operations/operations.ts b/sdk/devops/arm-devops/src/operations/operations.ts new file mode 100644 index 000000000000..ac40f357d5e5 --- /dev/null +++ b/sdk/devops/arm-devops/src/operations/operations.ts @@ -0,0 +1,137 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureDevOps } from "../azureDevOps"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: AzureDevOps; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: AzureDevOps) { + this.client = client; + } + + /** + * Lists all the operations supported by Microsoft.DevOps resource provider. + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all the operations supported by Microsoft.DevOps resource provider. + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.DevOps/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devops/arm-devops/src/operations/pipelineTemplateDefinitions.ts b/sdk/devops/arm-devops/src/operations/pipelineTemplateDefinitions.ts new file mode 100644 index 000000000000..eb296298393a --- /dev/null +++ b/sdk/devops/arm-devops/src/operations/pipelineTemplateDefinitions.ts @@ -0,0 +1,138 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PipelineTemplateDefinitions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureDevOps } from "../azureDevOps"; +import { + PipelineTemplateDefinition, + PipelineTemplateDefinitionsListNextOptionalParams, + PipelineTemplateDefinitionsListOptionalParams, + PipelineTemplateDefinitionsListResponse, + PipelineTemplateDefinitionsListNextResponse +} from "../models"; + +/// +/** Class containing PipelineTemplateDefinitions operations. */ +export class PipelineTemplateDefinitionsImpl + implements PipelineTemplateDefinitions { + private readonly client: AzureDevOps; + + /** + * Initialize a new instance of the class PipelineTemplateDefinitions class. + * @param client Reference to the service client + */ + constructor(client: AzureDevOps) { + this.client = client; + } + + /** + * Lists all pipeline templates which can be used to configure an Azure Pipeline. + * @param options The options parameters. + */ + public list( + options?: PipelineTemplateDefinitionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: PipelineTemplateDefinitionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: PipelineTemplateDefinitionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all pipeline templates which can be used to configure an Azure Pipeline. + * @param options The options parameters. + */ + private _list( + options?: PipelineTemplateDefinitionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: PipelineTemplateDefinitionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.DevOps/pipelineTemplateDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PipelineTemplateDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PipelineTemplateDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devops/arm-devops/src/operations/pipelines.ts b/sdk/devops/arm-devops/src/operations/pipelines.ts new file mode 100644 index 000000000000..ec3411bb7152 --- /dev/null +++ b/sdk/devops/arm-devops/src/operations/pipelines.ts @@ -0,0 +1,529 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Pipelines } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureDevOps } from "../azureDevOps"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Pipeline, + PipelinesListByResourceGroupNextOptionalParams, + PipelinesListByResourceGroupOptionalParams, + PipelinesListBySubscriptionNextOptionalParams, + PipelinesListBySubscriptionOptionalParams, + PipelinesCreateOrUpdateOptionalParams, + PipelinesCreateOrUpdateResponse, + PipelinesGetOptionalParams, + PipelinesGetResponse, + PipelineUpdateParameters, + PipelinesUpdateOptionalParams, + PipelinesUpdateResponse, + PipelinesDeleteOptionalParams, + PipelinesListByResourceGroupResponse, + PipelinesListBySubscriptionResponse, + PipelinesListByResourceGroupNextResponse, + PipelinesListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing Pipelines operations. */ +export class PipelinesImpl implements Pipelines { + private readonly client: AzureDevOps; + + /** + * Initialize a new instance of the class Pipelines class. + * @param client Reference to the service client + */ + constructor(client: AzureDevOps) { + this.client = client; + } + + /** + * Lists all Azure Pipelines under the specified resource group. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: PipelinesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: PipelinesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: PipelinesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Lists all Azure Pipelines under the specified subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: PipelinesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: PipelinesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: PipelinesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Creates or updates an Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource in ARM. + * @param createOperationParameters The request payload to create the Azure Pipeline. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + pipelineName: string, + createOperationParameters: Pipeline, + options?: PipelinesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PipelinesCreateOrUpdateResponse + > + > { + 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, + { resourceGroupName, pipelineName, createOperationParameters, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Creates or updates an Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource in ARM. + * @param createOperationParameters The request payload to create the Azure Pipeline. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + pipelineName: string, + createOperationParameters: Pipeline, + options?: PipelinesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + pipelineName, + createOperationParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets an existing Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource in ARM. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + pipelineName: string, + options?: PipelinesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, pipelineName, options }, + getOperationSpec + ); + } + + /** + * Updates the properties of an Azure Pipeline. Currently, only tags can be updated. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource. + * @param updateOperationParameters The request payload containing the properties to update in the + * Azure Pipeline. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + pipelineName: string, + updateOperationParameters: PipelineUpdateParameters, + options?: PipelinesUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, pipelineName, updateOperationParameters, options }, + updateOperationSpec + ); + } + + /** + * Deletes an Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + pipelineName: string, + options?: PipelinesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, pipelineName, options }, + deleteOperationSpec + ); + } + + /** + * Lists all Azure Pipelines under the specified resource group. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: PipelinesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Lists all Azure Pipelines under the specified subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: PipelinesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: PipelinesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: PipelinesListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOps/pipelines/{pipelineName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Pipeline + }, + 201: { + bodyMapper: Mappers.Pipeline + }, + 202: { + bodyMapper: Mappers.Pipeline + }, + 204: { + bodyMapper: Mappers.Pipeline + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.createOperationParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOps/pipelines/{pipelineName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Pipeline + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOps/pipelines/{pipelineName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Pipeline + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.updateOperationParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOps/pipelines/{pipelineName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOps/pipelines", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PipelineListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DevOps/pipelines", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PipelineListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PipelineListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PipelineListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/devops/arm-devops/src/operationsInterfaces/index.ts b/sdk/devops/arm-devops/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..2c123e604262 --- /dev/null +++ b/sdk/devops/arm-devops/src/operationsInterfaces/index.ts @@ -0,0 +1,11 @@ +/* + * 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. + */ + +export * from "./operations"; +export * from "./pipelineTemplateDefinitions"; +export * from "./pipelines"; diff --git a/sdk/devops/arm-devops/src/operationsInterfaces/operations.ts b/sdk/devops/arm-devops/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..9462ec2e2818 --- /dev/null +++ b/sdk/devops/arm-devops/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all the operations supported by Microsoft.DevOps resource provider. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/devops/arm-devops/src/operationsInterfaces/pipelineTemplateDefinitions.ts b/sdk/devops/arm-devops/src/operationsInterfaces/pipelineTemplateDefinitions.ts new file mode 100644 index 000000000000..436831cf4850 --- /dev/null +++ b/sdk/devops/arm-devops/src/operationsInterfaces/pipelineTemplateDefinitions.ts @@ -0,0 +1,25 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + PipelineTemplateDefinition, + PipelineTemplateDefinitionsListOptionalParams +} from "../models"; + +/// +/** Interface representing a PipelineTemplateDefinitions. */ +export interface PipelineTemplateDefinitions { + /** + * Lists all pipeline templates which can be used to configure an Azure Pipeline. + * @param options The options parameters. + */ + list( + options?: PipelineTemplateDefinitionsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/devops/arm-devops/src/operationsInterfaces/pipelines.ts b/sdk/devops/arm-devops/src/operationsInterfaces/pipelines.ts new file mode 100644 index 000000000000..d6a99a37a727 --- /dev/null +++ b/sdk/devops/arm-devops/src/operationsInterfaces/pipelines.ts @@ -0,0 +1,111 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + Pipeline, + PipelinesListByResourceGroupOptionalParams, + PipelinesListBySubscriptionOptionalParams, + PipelinesCreateOrUpdateOptionalParams, + PipelinesCreateOrUpdateResponse, + PipelinesGetOptionalParams, + PipelinesGetResponse, + PipelineUpdateParameters, + PipelinesUpdateOptionalParams, + PipelinesUpdateResponse, + PipelinesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Pipelines. */ +export interface Pipelines { + /** + * Lists all Azure Pipelines under the specified resource group. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: PipelinesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all Azure Pipelines under the specified subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: PipelinesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates or updates an Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource in ARM. + * @param createOperationParameters The request payload to create the Azure Pipeline. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + pipelineName: string, + createOperationParameters: Pipeline, + options?: PipelinesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PipelinesCreateOrUpdateResponse + > + >; + /** + * Creates or updates an Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource in ARM. + * @param createOperationParameters The request payload to create the Azure Pipeline. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + pipelineName: string, + createOperationParameters: Pipeline, + options?: PipelinesCreateOrUpdateOptionalParams + ): Promise; + /** + * Gets an existing Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource in ARM. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + pipelineName: string, + options?: PipelinesGetOptionalParams + ): Promise; + /** + * Updates the properties of an Azure Pipeline. Currently, only tags can be updated. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource. + * @param updateOperationParameters The request payload containing the properties to update in the + * Azure Pipeline. + * @param options The options parameters. + */ + update( + resourceGroupName: string, + pipelineName: string, + updateOperationParameters: PipelineUpdateParameters, + options?: PipelinesUpdateOptionalParams + ): Promise; + /** + * Deletes an Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + pipelineName: string, + options?: PipelinesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/devops/arm-devops/test/sampleTest.ts b/sdk/devops/arm-devops/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/devops/arm-devops/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * 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 { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + 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" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/devops/arm-devops/tsconfig.json b/sdk/devops/arm-devops/tsconfig.json new file mode 100644 index 000000000000..6e3251194117 --- /dev/null +++ b/sdk/devops/arm-devops/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts", "./test/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/sdk/devops/ci.yml b/sdk/devops/ci.yml new file mode 100644 index 000000000000..e6b158dcda9f --- /dev/null +++ b/sdk/devops/ci.yml @@ -0,0 +1,29 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/devops/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/devops/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: devops + Artifacts: + - name: azure-arm-devops + safeName: azurearmdevops + \ No newline at end of file