From e8ca8f08869e16c969c142e0ef0cf03a32ccf836 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 08:18:35 +0000 Subject: [PATCH] CodeGen from PR 16925 in Azure/azure-rest-api-specs Track2 modify readme.go.md 5 (#16925) --- common/config/rush/pnpm-lock.yaml | 131 +- rush.json | 5 + .../arm-healthcareapis/CHANGELOG.md | 11 + .../{LICENSE.txt => LICENSE} | 4 +- .../arm-healthcareapis/README.md | 152 +- .../arm-healthcareapis/_meta.json | 7 + .../arm-healthcareapis/api-extractor.json | 18 + .../arm-healthcareapis/package.json | 95 +- .../review/arm-healthcareapis.api.md | 1070 ++++++++++ .../arm-healthcareapis/rollup.config.js | 211 +- .../src/healthcareApisManagementClient.ts | 151 +- .../healthcareApisManagementClientContext.ts | 68 - .../arm-healthcareapis/src/index.ts | 12 + .../arm-healthcareapis/src/lroImpl.ts | 34 + .../arm-healthcareapis/src/models/index.ts | 1824 ++++++++++------- .../arm-healthcareapis/src/models/mappers.ts | 1541 ++++++++++---- .../src/models/operationResultsMappers.ts | 13 - .../src/models/operationsMappers.ts | 15 - .../src/models/parameters.ts | 268 ++- .../privateEndpointConnectionsMappers.ts | 31 - .../src/models/privateLinkResourcesMappers.ts | 31 - .../src/models/servicesMappers.ts | 34 - .../src/operations/dicomServices.ts | 620 ++++++ .../src/operations/fhirDestinations.ts | 204 ++ .../src/operations/fhirServices.ts | 620 ++++++ .../src/operations/index.ts | 18 +- .../operations/iotConnectorFhirDestination.ts | 356 ++++ .../src/operations/iotConnectors.ts | 620 ++++++ .../src/operations/operationResults.ts | 96 +- .../src/operations/operations.ts | 168 +- .../operations/privateEndpointConnections.ts | 482 +++-- .../src/operations/privateLinkResources.ts | 161 +- .../src/operations/services.ts | 900 ++++---- .../src/operations/workspaces.ts | 674 ++++++ .../src/operationsInterfaces/dicomServices.ts | 147 ++ .../operationsInterfaces/fhirDestinations.ts | 31 + .../src/operationsInterfaces/fhirServices.ts | 147 ++ .../src/operationsInterfaces/index.ts | 19 + .../iotConnectorFhirDestination.ts | 107 + .../src/operationsInterfaces/iotConnectors.ts | 147 ++ .../operationsInterfaces/operationResults.ts | 27 + .../src/operationsInterfaces/operations.ts | 22 + .../privateEndpointConnections.ts | 115 ++ .../privateLinkResources.ts | 42 + .../src/operationsInterfaces/services.ts | 152 ++ .../src/operationsInterfaces/workspaces.ts | 139 ++ .../arm-healthcareapis/test/sampleTest.ts | 48 + .../arm-healthcareapis/tsconfig.json | 6 +- sdk/healthcareapis/ci.yml | 29 + 49 files changed, 9487 insertions(+), 2336 deletions(-) create mode 100644 sdk/healthcareapis/arm-healthcareapis/CHANGELOG.md rename sdk/healthcareapis/arm-healthcareapis/{LICENSE.txt => LICENSE} (96%) create mode 100644 sdk/healthcareapis/arm-healthcareapis/_meta.json create mode 100644 sdk/healthcareapis/arm-healthcareapis/api-extractor.json create mode 100644 sdk/healthcareapis/arm-healthcareapis/review/arm-healthcareapis.api.md delete mode 100644 sdk/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClientContext.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/index.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/lroImpl.ts delete mode 100644 sdk/healthcareapis/arm-healthcareapis/src/models/operationResultsMappers.ts delete mode 100644 sdk/healthcareapis/arm-healthcareapis/src/models/operationsMappers.ts delete mode 100644 sdk/healthcareapis/arm-healthcareapis/src/models/privateEndpointConnectionsMappers.ts delete mode 100644 sdk/healthcareapis/arm-healthcareapis/src/models/privateLinkResourcesMappers.ts delete mode 100644 sdk/healthcareapis/arm-healthcareapis/src/models/servicesMappers.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operations/dicomServices.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operations/fhirDestinations.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operations/fhirServices.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operations/iotConnectorFhirDestination.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operations/iotConnectors.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operations/workspaces.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/dicomServices.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/fhirDestinations.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/fhirServices.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/index.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/iotConnectorFhirDestination.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/iotConnectors.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/operationResults.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/operations.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/privateEndpointConnections.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/privateLinkResources.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/services.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/workspaces.ts create mode 100644 sdk/healthcareapis/arm-healthcareapis/test/sampleTest.ts create mode 100644 sdk/healthcareapis/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..b352bb1ba305 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -39,6 +39,7 @@ specifiers: '@rush-temp/arm-extendedlocation': file:./projects/arm-extendedlocation.tgz '@rush-temp/arm-features': file:./projects/arm-features.tgz '@rush-temp/arm-hdinsight': file:./projects/arm-hdinsight.tgz + '@rush-temp/arm-healthcareapis': file:./projects/arm-healthcareapis.tgz '@rush-temp/arm-iothub': file:./projects/arm-iothub.tgz '@rush-temp/arm-keyvault': file:./projects/arm-keyvault.tgz '@rush-temp/arm-links': file:./projects/arm-links.tgz @@ -220,6 +221,7 @@ dependencies: '@rush-temp/arm-extendedlocation': file:projects/arm-extendedlocation.tgz '@rush-temp/arm-features': file:projects/arm-features.tgz '@rush-temp/arm-hdinsight': file:projects/arm-hdinsight.tgz + '@rush-temp/arm-healthcareapis': file:projects/arm-healthcareapis.tgz '@rush-temp/arm-iothub': file:projects/arm-iothub.tgz '@rush-temp/arm-keyvault': file:projects/arm-keyvault.tgz '@rush-temp/arm-links': file:projects/arm-links.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 @@ -8604,6 +8606,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-healthcareapis.tgz: + resolution: {integrity: sha512-6oxCAacVPMlwjt0Uj7w7kSVmECqOSNhyKaF1qRWUzLzQkhERiUpuOBFliskkVBheyx5EfA91ADKVbd8wxz3APg==, tarball: file:projects/arm-healthcareapis.tgz} + name: '@rush-temp/arm-healthcareapis' + 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-iothub.tgz: resolution: {integrity: sha512-PzFOxAYNZCA5fFinZSNlhYM6Z5GYX/yJkJAKycsLISLkEDrj70v3ihSJqSoyI3o9y0oxM1GqeijIgfPgvj4zWg==, tarball: file:projects/arm-iothub.tgz} name: '@rush-temp/arm-iothub' @@ -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..65b74933ccef 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-healthcareapis", + "projectFolder": "sdk/healthcareapis/arm-healthcareapis", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/healthcareapis/arm-healthcareapis/CHANGELOG.md b/sdk/healthcareapis/arm-healthcareapis/CHANGELOG.md new file mode 100644 index 000000000000..2952056722a2 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 2.0.0-beta.1 (2022-01-05) + +The package of @azure/arm-healthcareapis is using our next generation design principles since version 2.0.0-beta.1, which contains breaking changes. + +To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/healthcareapis/arm-healthcareapis/LICENSE.txt b/sdk/healthcareapis/arm-healthcareapis/LICENSE similarity index 96% rename from sdk/healthcareapis/arm-healthcareapis/LICENSE.txt rename to sdk/healthcareapis/arm-healthcareapis/LICENSE index ea8fb1516028..5d1d36e0af80 100644 --- a/sdk/healthcareapis/arm-healthcareapis/LICENSE.txt +++ b/sdk/healthcareapis/arm-healthcareapis/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +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 @@ -18,4 +18,4 @@ 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. +SOFTWARE. \ No newline at end of file diff --git a/sdk/healthcareapis/arm-healthcareapis/README.md b/sdk/healthcareapis/arm-healthcareapis/README.md index 1bad96847efa..250f4278898b 100644 --- a/sdk/healthcareapis/arm-healthcareapis/README.md +++ b/sdk/healthcareapis/arm-healthcareapis/README.md @@ -1,112 +1,98 @@ -## Azure HealthcareApisManagementClient SDK for JavaScript +# Azure HealthcareApisManagement client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for HealthcareApisManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure HealthcareApisManagement client. + +Azure Healthcare APIs Client + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/healthcareapis/arm-healthcareapis) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-healthcareapis) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-healthcareapis?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. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites -You must have an [Azure subscription](https://azure.microsoft.com/free/). +- An [Azure subscription][azure_sub]. -### How to install +### Install the `@azure/arm-healthcareapis` package -To use this SDK in your project, you will need to install two packages. -- `@azure/arm-healthcareapis` that contains the client. -- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. +Install the Azure HealthcareApisManagement client library for JavaScript with `npm`: -Install both packages using the below command: ```bash -npm install --save @azure/arm-healthcareapis @azure/identity +npm install @azure/arm-healthcareapis ``` -> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +### Create and authenticate a `HealthcareApisManagementClient` -### How to use +To create a client object to access the Azure HealthcareApisManagement API, you will need the `endpoint` of your Azure HealthcareApisManagement resource and a `credential`. The Azure HealthcareApisManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure HealthcareApisManagement resource in the [Azure Portal][azure_portal]. -- If you are writing a client side browser application, - - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. - - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. -- If you are writing a server side application, - - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) - - Complete the set up steps required by the credential if any. - - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. +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). -In the below samples, we pass the credential and the Azure subscription id to instantiate the client. -Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +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 +``` -#### nodejs - Authentication, client creation, and get services as an example written in JavaScript. +You will also need to **register a new AAD application and grant access to Azure HealthcareApisManagement** 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`. -##### Sample code +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 { DefaultAzureCredential } = require("@azure/identity"); const { HealthcareApisManagementClient } = require("@azure/arm-healthcareapis"); -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples -// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. -const creds = new DefaultAzureCredential(); -const client = new HealthcareApisManagementClient(creds, subscriptionId); -const resourceGroupName = "testresourceGroupName"; -const resourceName = "testresourceName"; -client.services.get(resourceGroupName, resourceName).then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log("An error occurred:"); - console.error(err); -}); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new HealthcareApisManagementClient(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation, and get services as an example written in JavaScript. - -In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. - - Note down the client Id from the previous step and use it in the browser sample below. - -##### Sample code - -- index.html - -```html - - - - @azure/arm-healthcareapis sample - - - - - - - + +### 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 + +### HealthcareApisManagementClient + +`HealthcareApisManagementClient` is the primary interface for developers using the Azure HealthcareApisManagement client library. Explore the methods on this client object to understand the different features of the Azure HealthcareApisManagement 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) +- [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%2Fhealthcareapis%2Farm-healthcareapis%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/healthcareapis/arm-healthcareapis/README.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/healthcareapis/arm-healthcareapis/_meta.json b/sdk/healthcareapis/arm-healthcareapis/_meta.json new file mode 100644 index 000000000000..558287a125e1 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "9f28b00aaee6d4360ac3dee7f9a10279f5d15568", + "readme": "specification/healthcareapis/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/healthcareapis/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/healthcareapis/arm-healthcareapis/api-extractor.json b/sdk/healthcareapis/arm-healthcareapis/api-extractor.json new file mode 100644 index 000000000000..bac3eef0b350 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/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-healthcareapis.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/healthcareapis/arm-healthcareapis/package.json b/sdk/healthcareapis/arm-healthcareapis/package.json index 55b5607b3682..0a9991a679c3 100644 --- a/sdk/healthcareapis/arm-healthcareapis/package.json +++ b/sdk/healthcareapis/arm-healthcareapis/package.json @@ -1,58 +1,91 @@ { "name": "@azure/arm-healthcareapis", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "HealthcareApisManagementClient Library with typescript type definitions for node.js and browser.", - "version": "1.1.0", + "description": "A generated SDK for HealthcareApisManagementClient.", + "version": "2.0.0-beta.1", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-js": "^2.2.0", - "@azure/core-auth": "^1.1.4", - "tslib": "^1.10.0" + "@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" - ], + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], "license": "MIT", - "main": "./dist/arm-healthcareapis.js", - "module": "./esm/healthcareApisManagementClient.js", - "types": "./esm/healthcareApisManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-healthcareapis.d.ts", "devDependencies": { - "typescript": "^3.6.0", - "rollup": "^1.18.0", - "rollup-plugin-node-resolve": "^5.2.0", + "@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", - "uglify-js": "^3.6.0" + "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/healthcareapis/arm-healthcareapis", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" }, - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", "dist/**/*.js.map", "dist/**/*.d.ts", "dist/**/*.d.ts.map", - "esm/**/*.js", - "esm/**/*.js.map", - "esm/**/*.d.ts", - "esm/**/*.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" + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" ], "scripts": { - "build": "tsc && rollup -c rollup.config.js && npm run minify", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-healthcareapis.js.map'\" -o ./dist/arm-healthcareapis.min.js ./dist/arm-healthcareapis.js", - "prepack": "npm install && npm run build" + "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/healthcareapis/arm-healthcareapis/review/arm-healthcareapis.api.md b/sdk/healthcareapis/arm-healthcareapis/review/arm-healthcareapis.api.md new file mode 100644 index 000000000000..6a44f4574dbd --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/review/arm-healthcareapis.api.md @@ -0,0 +1,1070 @@ +## API Report File for "@azure/arm-healthcareapis" + +> 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 type ActionType = string; + +// @public +export interface CheckNameAvailabilityParameters { + name: string; + type: string; +} + +// @public +export type CreatedByType = string; + +// @public +export type DicomService = TaggedResource & { + readonly systemData?: SystemData; + provisioningState?: ProvisioningState; + authenticationConfiguration?: DicomServiceAuthenticationConfiguration; + readonly serviceUrl?: string; +}; + +// @public +export interface DicomServiceAuthenticationConfiguration { + readonly audiences?: string[]; + readonly authority?: string; +} + +// @public +export interface DicomServiceCollection { + nextLink?: string; + value?: DicomService[]; +} + +// @public +export type DicomServicePatchResource = ResourceTags & {}; + +// @public +export interface DicomServices { + beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, dicomServiceName: string, dicomservice: DicomService, options?: DicomServicesCreateOrUpdateOptionalParams): Promise, DicomServicesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, workspaceName: string, dicomServiceName: string, dicomservice: DicomService, options?: DicomServicesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, dicomServiceName: string, workspaceName: string, options?: DicomServicesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, dicomServiceName: string, workspaceName: string, options?: DicomServicesDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, dicomServiceName: string, workspaceName: string, dicomservicePatchResource: DicomServicePatchResource, options?: DicomServicesUpdateOptionalParams): Promise, DicomServicesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, dicomServiceName: string, workspaceName: string, dicomservicePatchResource: DicomServicePatchResource, options?: DicomServicesUpdateOptionalParams): Promise; + get(resourceGroupName: string, workspaceName: string, dicomServiceName: string, options?: DicomServicesGetOptionalParams): Promise; + listByWorkspace(resourceGroupName: string, workspaceName: string, options?: DicomServicesListByWorkspaceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DicomServicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DicomServicesCreateOrUpdateResponse = DicomService; + +// @public +export interface DicomServicesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DicomServicesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DicomServicesGetResponse = DicomService; + +// @public +export interface DicomServicesListByWorkspaceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DicomServicesListByWorkspaceNextResponse = DicomServiceCollection; + +// @public +export interface DicomServicesListByWorkspaceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DicomServicesListByWorkspaceResponse = DicomServiceCollection; + +// @public +export interface DicomServicesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DicomServicesUpdateResponse = DicomService; + +// @public +export interface ErrorDetails { + error?: ErrorDetailsInternal; +} + +// @public +export interface ErrorDetailsInternal { + readonly code?: string; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorModel { + error?: ErrorDetailsInternal; +} + +// @public +export interface FhirDestinations { + listByIotConnector(resourceGroupName: string, workspaceName: string, iotConnectorName: string, options?: FhirDestinationsListByIotConnectorOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FhirDestinationsListByIotConnectorNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FhirDestinationsListByIotConnectorNextResponse = IotFhirDestinationCollection; + +// @public +export interface FhirDestinationsListByIotConnectorOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FhirDestinationsListByIotConnectorResponse = IotFhirDestinationCollection; + +// @public +export type FhirService = TaggedResource & ServiceManagedIdentity & { + kind?: FhirServiceKind; + readonly systemData?: SystemData; + provisioningState?: ProvisioningState; + accessPolicies?: FhirServiceAccessPolicyEntry[]; + acrConfiguration?: FhirServiceAcrConfiguration; + authenticationConfiguration?: FhirServiceAuthenticationConfiguration; + corsConfiguration?: FhirServiceCorsConfiguration; + exportConfiguration?: FhirServiceExportConfiguration; +}; + +// @public +export interface FhirServiceAccessPolicyEntry { + objectId: string; +} + +// @public +export interface FhirServiceAcrConfiguration { + loginServers?: string[]; +} + +// @public +export interface FhirServiceAuthenticationConfiguration { + audience?: string; + authority?: string; + smartProxyEnabled?: boolean; +} + +// @public +export interface FhirServiceCollection { + nextLink?: string; + value?: FhirService[]; +} + +// @public +export interface FhirServiceCorsConfiguration { + allowCredentials?: boolean; + headers?: string[]; + maxAge?: number; + methods?: string[]; + origins?: string[]; +} + +// @public +export interface FhirServiceExportConfiguration { + storageAccountName?: string; +} + +// @public +export type FhirServiceKind = string; + +// @public +export type FhirServicePatchResource = ResourceTags & ServiceManagedIdentity & {}; + +// @public +export interface FhirServices { + beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, fhirServiceName: string, fhirservice: FhirService, options?: FhirServicesCreateOrUpdateOptionalParams): Promise, FhirServicesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, workspaceName: string, fhirServiceName: string, fhirservice: FhirService, options?: FhirServicesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, fhirServiceName: string, workspaceName: string, options?: FhirServicesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, fhirServiceName: string, workspaceName: string, options?: FhirServicesDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, fhirServiceName: string, workspaceName: string, fhirservicePatchResource: FhirServicePatchResource, options?: FhirServicesUpdateOptionalParams): Promise, FhirServicesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, fhirServiceName: string, workspaceName: string, fhirservicePatchResource: FhirServicePatchResource, options?: FhirServicesUpdateOptionalParams): Promise; + get(resourceGroupName: string, workspaceName: string, fhirServiceName: string, options?: FhirServicesGetOptionalParams): Promise; + listByWorkspace(resourceGroupName: string, workspaceName: string, options?: FhirServicesListByWorkspaceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FhirServicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FhirServicesCreateOrUpdateResponse = FhirService; + +// @public +export interface FhirServicesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface FhirServicesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FhirServicesGetResponse = FhirService; + +// @public +export interface FhirServicesListByWorkspaceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FhirServicesListByWorkspaceNextResponse = FhirServiceCollection; + +// @public +export interface FhirServicesListByWorkspaceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FhirServicesListByWorkspaceResponse = FhirServiceCollection; + +// @public +export interface FhirServicesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FhirServicesUpdateResponse = FhirService; + +// @public (undocumented) +export class HealthcareApisManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: HealthcareApisManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + dicomServices: DicomServices; + // (undocumented) + fhirDestinations: FhirDestinations; + // (undocumented) + fhirServices: FhirServices; + // (undocumented) + iotConnectorFhirDestination: IotConnectorFhirDestination; + // (undocumented) + iotConnectors: IotConnectors; + // (undocumented) + operationResults: OperationResults; + // (undocumented) + operations: Operations; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) + services: Services; + // (undocumented) + subscriptionId: string; + // (undocumented) + workspaces: Workspaces; +} + +// @public +export interface HealthcareApisManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type IotConnector = TaggedResource & ServiceManagedIdentity & { + readonly systemData?: SystemData; + provisioningState?: ProvisioningState; + ingestionEndpointConfiguration?: IotEventHubIngestionEndpointConfiguration; + deviceMapping?: IotMappingProperties; +}; + +// @public +export interface IotConnectorCollection { + nextLink?: string; + value?: IotConnector[]; +} + +// @public +export interface IotConnectorFhirDestination { + beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, iotConnectorName: string, fhirDestinationName: string, iotFhirDestination: IotFhirDestination, options?: IotConnectorFhirDestinationCreateOrUpdateOptionalParams): Promise, IotConnectorFhirDestinationCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, workspaceName: string, iotConnectorName: string, fhirDestinationName: string, iotFhirDestination: IotFhirDestination, options?: IotConnectorFhirDestinationCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, workspaceName: string, iotConnectorName: string, fhirDestinationName: string, options?: IotConnectorFhirDestinationDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, workspaceName: string, iotConnectorName: string, fhirDestinationName: string, options?: IotConnectorFhirDestinationDeleteOptionalParams): Promise; + get(resourceGroupName: string, workspaceName: string, iotConnectorName: string, fhirDestinationName: string, options?: IotConnectorFhirDestinationGetOptionalParams): Promise; +} + +// @public +export interface IotConnectorFhirDestinationCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type IotConnectorFhirDestinationCreateOrUpdateResponse = IotFhirDestination; + +// @public +export interface IotConnectorFhirDestinationDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface IotConnectorFhirDestinationGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotConnectorFhirDestinationGetResponse = IotFhirDestination; + +// @public +export type IotConnectorPatchResource = ResourceTags & ServiceManagedIdentity & {}; + +// @public +export interface IotConnectors { + beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, iotConnectorName: string, iotConnector: IotConnector, options?: IotConnectorsCreateOrUpdateOptionalParams): Promise, IotConnectorsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, workspaceName: string, iotConnectorName: string, iotConnector: IotConnector, options?: IotConnectorsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, iotConnectorName: string, workspaceName: string, options?: IotConnectorsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, iotConnectorName: string, workspaceName: string, options?: IotConnectorsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, iotConnectorName: string, workspaceName: string, iotConnectorPatchResource: IotConnectorPatchResource, options?: IotConnectorsUpdateOptionalParams): Promise, IotConnectorsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, iotConnectorName: string, workspaceName: string, iotConnectorPatchResource: IotConnectorPatchResource, options?: IotConnectorsUpdateOptionalParams): Promise; + get(resourceGroupName: string, workspaceName: string, iotConnectorName: string, options?: IotConnectorsGetOptionalParams): Promise; + listByWorkspace(resourceGroupName: string, workspaceName: string, options?: IotConnectorsListByWorkspaceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface IotConnectorsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type IotConnectorsCreateOrUpdateResponse = IotConnector; + +// @public +export interface IotConnectorsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface IotConnectorsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotConnectorsGetResponse = IotConnector; + +// @public +export interface IotConnectorsListByWorkspaceNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotConnectorsListByWorkspaceNextResponse = IotConnectorCollection; + +// @public +export interface IotConnectorsListByWorkspaceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type IotConnectorsListByWorkspaceResponse = IotConnectorCollection; + +// @public +export interface IotConnectorsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type IotConnectorsUpdateResponse = IotConnector; + +// @public +export interface IotDestinationProperties { + provisioningState?: ProvisioningState; +} + +// @public +export interface IotEventHubIngestionEndpointConfiguration { + consumerGroup?: string; + eventHubName?: string; + fullyQualifiedEventHubNamespace?: string; +} + +// @public +export type IotFhirDestination = LocationBasedResource & { + readonly systemData?: SystemData; + provisioningState?: ProvisioningState; + resourceIdentityResolutionType: IotIdentityResolutionType; + fhirServiceResourceId: string; + fhirMapping: IotMappingProperties; +}; + +// @public +export interface IotFhirDestinationCollection { + nextLink?: string; + value?: IotFhirDestination[]; +} + +// @public +export type IotFhirDestinationProperties = IotDestinationProperties & { + resourceIdentityResolutionType: IotIdentityResolutionType; + fhirServiceResourceId: string; + fhirMapping: IotMappingProperties; +}; + +// @public +export type IotIdentityResolutionType = string; + +// @public +export interface IotMappingProperties { + content?: Record; +} + +// @public +export type Kind = "fhir" | "fhir-Stu3" | "fhir-R4"; + +// @public +export enum KnownActionType { + // (undocumented) + Internal = "Internal" +} + +// @public +export enum KnownCreatedByType { + // (undocumented) + Application = "Application", + // (undocumented) + Key = "Key", + // (undocumented) + ManagedIdentity = "ManagedIdentity", + // (undocumented) + User = "User" +} + +// @public +export enum KnownFhirServiceKind { + // (undocumented) + FhirR4 = "fhir-R4", + // (undocumented) + FhirStu3 = "fhir-Stu3" +} + +// @public +export enum KnownIotIdentityResolutionType { + // (undocumented) + Create = "Create", + // (undocumented) + Lookup = "Lookup" +} + +// @public +export enum KnownManagedServiceIdentityType { + // (undocumented) + None = "None", + // (undocumented) + SystemAssigned = "SystemAssigned" +} + +// @public +export enum KnownOperationResultStatus { + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Failed = "Failed", + // (undocumented) + Requested = "Requested", + // (undocumented) + Running = "Running", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownPrivateEndpointConnectionProvisioningState { + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Failed = "Failed", + // (undocumented) + Succeeded = "Succeeded" +} + +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + // (undocumented) + Approved = "Approved", + // (undocumented) + Pending = "Pending", + // (undocumented) + Rejected = "Rejected" +} + +// @public +export enum KnownProvisioningState { + // (undocumented) + Accepted = "Accepted", + // (undocumented) + Canceled = "Canceled", + // (undocumented) + Creating = "Creating", + // (undocumented) + Deleting = "Deleting", + // (undocumented) + Deprovisioned = "Deprovisioned", + // (undocumented) + Failed = "Failed", + // (undocumented) + Moving = "Moving", + // (undocumented) + Succeeded = "Succeeded", + // (undocumented) + Suspended = "Suspended", + // (undocumented) + SystemMaintenance = "SystemMaintenance", + // (undocumented) + Updating = "Updating", + // (undocumented) + Verifying = "Verifying", + // (undocumented) + Warned = "Warned" +} + +// @public +export enum KnownPublicNetworkAccess { + // (undocumented) + Disabled = "Disabled", + // (undocumented) + Enabled = "Enabled" +} + +// @public +export interface ListOperations { + nextLink?: string; + readonly value?: OperationDetail[]; +} + +// @public +export type LocationBasedResource = ResourceCore & { + location?: string; +}; + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export interface OperationDetail { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: string; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationResults { + get(locationName: string, operationResultId: string, options?: OperationResultsGetOptionalParams): Promise; +} + +// @public +export interface OperationResultsDescription { + readonly id?: string; + readonly name?: string; + properties?: Record; + readonly startTime?: string; + readonly status?: OperationResultStatus; +} + +// @public +export interface OperationResultsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationResultsGetResponse = OperationResultsDescription; + +// @public +export type OperationResultStatus = string; + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = ListOperations; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = ListOperations; + +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export type PrivateEndpointConnection = Resource & { + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +}; + +// @public +export type PrivateEndpointConnectionDescription = PrivateEndpointConnection & { + readonly systemData?: SystemData; +}; + +// @public +export interface PrivateEndpointConnectionListResultDescription { + value?: PrivateEndpointConnectionDescription[]; +} + +// @public +export type PrivateEndpointConnectionProvisioningState = string; + +// @public +export interface PrivateEndpointConnections { + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise, PrivateEndpointConnectionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + listByService(resourceGroupName: string, resourceName: string, options?: PrivateEndpointConnectionsListByServiceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnectionDescription; + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnectionDescription; + +// @public +export interface PrivateEndpointConnectionsListByServiceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListByServiceResponse = PrivateEndpointConnectionListResultDescription; + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export type PrivateLinkResource = Resource & { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +}; + +// @public +export type PrivateLinkResourceDescription = PrivateLinkResource & { + readonly systemData?: SystemData; +}; + +// @public +export interface PrivateLinkResourceListResultDescription { + value?: PrivateLinkResourceDescription[]; +} + +// @public +export interface PrivateLinkResources { + get(resourceGroupName: string, resourceName: string, groupName: string, options?: PrivateLinkResourcesGetOptionalParams): Promise; + listByService(resourceGroupName: string, resourceName: string, options?: PrivateLinkResourcesListByServiceOptionalParams): Promise; +} + +// @public +export interface PrivateLinkResourcesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesGetResponse = PrivateLinkResourceDescription; + +// @public +export interface PrivateLinkResourcesListByServiceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByServiceResponse = PrivateLinkResourceListResultDescription; + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + +// @public +export type ProvisioningState = string; + +// @public +export type PublicNetworkAccess = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ResourceCore { + etag?: string; + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ResourceTags { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ServiceAccessPolicyEntry { + objectId: string; +} + +// @public +export interface ServiceAcrConfigurationInfo { + loginServers?: string[]; +} + +// @public +export interface ServiceAuthenticationConfigurationInfo { + audience?: string; + authority?: string; + smartProxyEnabled?: boolean; +} + +// @public +export interface ServiceCorsConfigurationInfo { + allowCredentials?: boolean; + headers?: string[]; + maxAge?: number; + methods?: string[]; + origins?: string[]; +} + +// @public +export interface ServiceCosmosDbConfigurationInfo { + keyVaultKeyUri?: string; + offerThroughput?: number; +} + +// @public +export interface ServiceExportConfigurationInfo { + storageAccountName?: string; +} + +// @public +export interface ServiceManagedIdentity { + identity?: ServiceManagedIdentityIdentity; +} + +// @public +export interface ServiceManagedIdentityIdentity { + type?: ManagedServiceIdentityType; +} + +// @public +export type ServiceNameUnavailabilityReason = "Invalid" | "AlreadyExists"; + +// @public +export interface Services { + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, serviceDescription: ServicesDescription, options?: ServicesCreateOrUpdateOptionalParams): Promise, ServicesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, serviceDescription: ServicesDescription, options?: ServicesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, resourceName: string, options?: ServicesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: ServicesDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, resourceName: string, servicePatchDescription: ServicesPatchDescription, options?: ServicesUpdateOptionalParams): Promise, ServicesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, resourceName: string, servicePatchDescription: ServicesPatchDescription, options?: ServicesUpdateOptionalParams): Promise; + checkNameAvailability(checkNameAvailabilityInputs: CheckNameAvailabilityParameters, options?: ServicesCheckNameAvailabilityOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, options?: ServicesGetOptionalParams): Promise; + list(options?: ServicesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: ServicesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ServicesCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesCheckNameAvailabilityResponse = ServicesNameAvailabilityInfo; + +// @public +export interface ServicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ServicesCreateOrUpdateResponse = ServicesDescription; + +// @public +export interface ServicesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ServicesDescription = ServicesResource & { + properties?: ServicesProperties; + readonly systemData?: SystemData; +}; + +// @public +export interface ServicesDescriptionListResult { + nextLink?: string; + value?: ServicesDescription[]; +} + +// @public +export interface ServicesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesGetResponse = ServicesDescription; + +// @public +export interface ServicesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesListByResourceGroupNextResponse = ServicesDescriptionListResult; + +// @public +export interface ServicesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesListByResourceGroupResponse = ServicesDescriptionListResult; + +// @public +export interface ServicesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesListNextResponse = ServicesDescriptionListResult; + +// @public +export interface ServicesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesListResponse = ServicesDescriptionListResult; + +// @public +export interface ServicesNameAvailabilityInfo { + message?: string; + readonly nameAvailable?: boolean; + readonly reason?: ServiceNameUnavailabilityReason; +} + +// @public +export interface ServicesPatchDescription { + publicNetworkAccess?: PublicNetworkAccess; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface ServicesProperties { + accessPolicies?: ServiceAccessPolicyEntry[]; + acrConfiguration?: ServiceAcrConfigurationInfo; + authenticationConfiguration?: ServiceAuthenticationConfigurationInfo; + corsConfiguration?: ServiceCorsConfigurationInfo; + cosmosDbConfiguration?: ServiceCosmosDbConfigurationInfo; + exportConfiguration?: ServiceExportConfigurationInfo; + privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningState; + publicNetworkAccess?: PublicNetworkAccess; +} + +// @public +export interface ServicesResource { + etag?: string; + readonly id?: string; + identity?: ServicesResourceIdentity; + kind: Kind; + location: string; + readonly name?: string; + tags?: { + [propertyName: string]: string; + }; + readonly type?: string; +} + +// @public +export interface ServicesResourceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: ManagedServiceIdentityType; +} + +// @public +export interface ServicesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ServicesUpdateResponse = ServicesDescription; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TaggedResource = ResourceTags & LocationBasedResource & {}; + +// @public +export type Workspace = TaggedResource & { + properties?: WorkspaceProperties; + readonly systemData?: SystemData; +}; + +// @public +export interface WorkspaceList { + nextLink?: string; + value?: Workspace[]; +} + +// @public +export type WorkspacePatchResource = ResourceTags & {}; + +// @public +export interface WorkspaceProperties { + provisioningState?: ProvisioningState; +} + +// @public +export interface Workspaces { + beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, workspace: Workspace, options?: WorkspacesCreateOrUpdateOptionalParams): Promise, WorkspacesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, workspaceName: string, workspace: Workspace, options?: WorkspacesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, workspaceName: string, options?: WorkspacesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, workspaceName: string, options?: WorkspacesDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, workspaceName: string, workspacePatchResource: WorkspacePatchResource, options?: WorkspacesUpdateOptionalParams): Promise, WorkspacesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, workspaceName: string, workspacePatchResource: WorkspacePatchResource, options?: WorkspacesUpdateOptionalParams): Promise; + get(resourceGroupName: string, workspaceName: string, options?: WorkspacesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: WorkspacesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: WorkspacesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface WorkspacesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type WorkspacesCreateOrUpdateResponse = Workspace; + +// @public +export interface WorkspacesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface WorkspacesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspacesGetResponse = Workspace; + +// @public +export interface WorkspacesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspacesListByResourceGroupNextResponse = WorkspaceList; + +// @public +export interface WorkspacesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspacesListByResourceGroupResponse = WorkspaceList; + +// @public +export interface WorkspacesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspacesListBySubscriptionNextResponse = WorkspaceList; + +// @public +export interface WorkspacesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspacesListBySubscriptionResponse = WorkspaceList; + +// @public +export interface WorkspacesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type WorkspacesUpdateResponse = Workspace; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/healthcareapis/arm-healthcareapis/rollup.config.js b/sdk/healthcareapis/arm-healthcareapis/rollup.config.js index 555d5fa9f225..9be1955eb7f1 100644 --- a/sdk/healthcareapis/arm-healthcareapis/rollup.config.js +++ b/sdk/healthcareapis/arm-healthcareapis/rollup.config.js @@ -1,37 +1,188 @@ -import rollup from "rollup"; -import nodeResolve from "rollup-plugin-node-resolve"; +/* + * 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 /** - * @type {rollup.RollupFileOptions} + * A function that can determine whether a rollupwarning should be ignored. If + * the function returns `true`, then the warning will not be displayed. */ -const config = { - input: "./esm/healthcareApisManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-healthcareapis.js", - format: "umd", - name: "Azure.ArmHealthcareapis", - sourcemap: true, - globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + +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/**"] }, - banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */` - }, - plugins: [ - nodeResolve({ mainFields: ['module', 'main'] }), - sourcemaps() - ] + 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 default config; +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/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClient.ts b/sdk/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClient.ts index 7d86396d1f02..17f13d20d36c 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClient.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClient.ts @@ -1,56 +1,121 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { HealthcareApisManagementClientContext } from "./healthcareApisManagementClientContext"; +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + ServicesImpl, + PrivateEndpointConnectionsImpl, + PrivateLinkResourcesImpl, + WorkspacesImpl, + DicomServicesImpl, + IotConnectorsImpl, + FhirDestinationsImpl, + IotConnectorFhirDestinationImpl, + FhirServicesImpl, + OperationsImpl, + OperationResultsImpl +} from "./operations"; +import { + Services, + PrivateEndpointConnections, + PrivateLinkResources, + Workspaces, + DicomServices, + IotConnectors, + FhirDestinations, + IotConnectorFhirDestination, + FhirServices, + Operations, + OperationResults +} from "./operationsInterfaces"; +import { HealthcareApisManagementClientOptionalParams } from "./models"; - -class HealthcareApisManagementClient extends HealthcareApisManagementClientContext { - // Operation groups - services: operations.Services; - operations: operations.Operations; - operationResults: operations.OperationResults; - privateEndpointConnections: operations.PrivateEndpointConnections; - privateLinkResources: operations.PrivateLinkResources; +export class HealthcareApisManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; /** * Initializes a new instance of the HealthcareApisManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. + * @param credentials Subscription credentials which uniquely identify client subscription. * @param subscriptionId The subscription identifier. - * @param [options] The parameter options + * @param options The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.HealthcareApisManagementClientOptions) { - super(credentials, subscriptionId, options); - this.services = new operations.Services(this); - this.operations = new operations.Operations(this); - this.operationResults = new operations.OperationResults(this); - this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); - this.privateLinkResources = new operations.PrivateLinkResources(this); - } -} + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: HealthcareApisManagementClientOptionalParams + ) { + 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: HealthcareApisManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; -// Operation Specifications + const packageDetails = `azsdk-js-arm-healthcareapis/2.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; -export { - HealthcareApisManagementClient, - HealthcareApisManagementClientContext, - Models as HealthcareApisManagementModels, - Mappers as HealthcareApisManagementMappers -}; -export * from "./operations"; + 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 || "2021-06-01-preview"; + this.services = new ServicesImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.workspaces = new WorkspacesImpl(this); + this.dicomServices = new DicomServicesImpl(this); + this.iotConnectors = new IotConnectorsImpl(this); + this.fhirDestinations = new FhirDestinationsImpl(this); + this.iotConnectorFhirDestination = new IotConnectorFhirDestinationImpl( + this + ); + this.fhirServices = new FhirServicesImpl(this); + this.operations = new OperationsImpl(this); + this.operationResults = new OperationResultsImpl(this); + } + + services: Services; + privateEndpointConnections: PrivateEndpointConnections; + privateLinkResources: PrivateLinkResources; + workspaces: Workspaces; + dicomServices: DicomServices; + iotConnectors: IotConnectors; + fhirDestinations: FhirDestinations; + iotConnectorFhirDestination: IotConnectorFhirDestination; + fhirServices: FhirServices; + operations: Operations; + operationResults: OperationResults; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClientContext.ts b/sdk/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClientContext.ts deleted file mode 100644 index 4fbe87e723ce..000000000000 --- a/sdk/healthcareapis/arm-healthcareapis/src/healthcareApisManagementClientContext.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-healthcareapis"; -const packageVersion = "1.1.0"; - -export class HealthcareApisManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials | TokenCredential; - subscriptionId: string; - apiVersion?: string; - - /** - * Initializes a new instance of the HealthcareApisManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. Credentials - * implementing the TokenCredential interface from the @azure/identity package are recommended. For - * more information about these credentials, see - * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the - * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and - * @azure/ms-rest-browserauth are also supported. - * @param subscriptionId The subscription identifier. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.HealthcareApisManagementClientOptions) { - if (credentials == undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId == undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) { - options = {}; - } - if(!options.userAgent) { - const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); - options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; - } - - super(credentials, options); - - this.apiVersion = '2020-03-30'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; - this.requestContentType = "application/json; charset=utf-8"; - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - } -} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/index.ts b/sdk/healthcareapis/arm-healthcareapis/src/index.ts new file mode 100644 index 000000000000..e13cb006361f --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/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 { HealthcareApisManagementClient } from "./healthcareApisManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/lroImpl.ts b/sdk/healthcareapis/arm-healthcareapis/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/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/healthcareapis/arm-healthcareapis/src/models/index.ts b/sdk/healthcareapis/arm-healthcareapis/src/models/index.ts index 6ac837aab5a7..ba366b996ec0 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/models/index.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/models/index.ts @@ -1,986 +1,1324 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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 { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export { BaseResource, CloudError }; - -/** - * An access policy entry. - */ -export interface ServiceAccessPolicyEntry { +/** The properties of a service instance. */ +export interface ServicesProperties { /** - * An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + * The provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly provisioningState?: ProvisioningState; + /** The access policies of the service instance. */ + accessPolicies?: ServiceAccessPolicyEntry[]; + /** The settings for the Cosmos DB database backing the service. */ + cosmosDbConfiguration?: ServiceCosmosDbConfigurationInfo; + /** The authentication configuration for the service instance. */ + authenticationConfiguration?: ServiceAuthenticationConfigurationInfo; + /** The settings for the CORS configuration of the service instance. */ + corsConfiguration?: ServiceCorsConfigurationInfo; + /** The settings for the export operation of the service instance. */ + exportConfiguration?: ServiceExportConfigurationInfo; + /** The list of private endpoint connections that are set up for this resource. */ + privateEndpointConnections?: PrivateEndpointConnection[]; + /** Control permission for data plane traffic coming from public networks while private endpoint is enabled. */ + publicNetworkAccess?: PublicNetworkAccess; + /** The azure container registry settings used for convert data operation of the service instance. */ + acrConfiguration?: ServiceAcrConfigurationInfo; +} + +/** An access policy entry. */ +export interface ServiceAccessPolicyEntry { + /** An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. */ objectId: string; } -/** - * The settings for the Cosmos DB database backing the service. - */ +/** The settings for the Cosmos DB database backing the service. */ export interface ServiceCosmosDbConfigurationInfo { - /** - * The provisioned throughput for the backing database. - */ + /** The provisioned throughput for the backing database. */ offerThroughput?: number; - /** - * The URI of the customer-managed key for the backing database. - */ + /** The URI of the customer-managed key for the backing database. */ keyVaultKeyUri?: string; } -/** - * Authentication configuration information - */ +/** Authentication configuration information */ export interface ServiceAuthenticationConfigurationInfo { - /** - * The authority url for the service - */ + /** The authority url for the service */ authority?: string; - /** - * The audience url for the service - */ + /** The audience url for the service */ audience?: string; - /** - * If the SMART on FHIR proxy is enabled - */ + /** If the SMART on FHIR proxy is enabled */ smartProxyEnabled?: boolean; } -/** - * The settings for the CORS configuration of the service instance. - */ +/** The settings for the CORS configuration of the service instance. */ export interface ServiceCorsConfigurationInfo { - /** - * The origins to be allowed via CORS. - */ + /** The origins to be allowed via CORS. */ origins?: string[]; - /** - * The headers to be allowed via CORS. - */ + /** The headers to be allowed via CORS. */ headers?: string[]; - /** - * The methods to be allowed via CORS. - */ + /** The methods to be allowed via CORS. */ methods?: string[]; - /** - * The max age to be allowed via CORS. - */ + /** The max age to be allowed via CORS. */ maxAge?: number; - /** - * If credentials are allowed via CORS. - */ + /** If credentials are allowed via CORS. */ allowCredentials?: boolean; } -/** - * Export operation configuration information - */ +/** Export operation configuration information */ export interface ServiceExportConfigurationInfo { - /** - * The name of the default export storage account. - */ + /** The name of the default export storage account. */ storageAccountName?: string; } -/** - * The Private Endpoint resource. - */ +/** The Private Endpoint resource. */ export interface PrivateEndpoint { /** * The ARM identifier for Private Endpoint - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; } -/** - * A collection of information about the state of the connection between service consumer and - * provider. - */ +/** A collection of information about the state of the connection between service consumer and provider. */ export interface PrivateLinkServiceConnectionState { - /** - * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. Possible values include: 'Pending', 'Approved', 'Rejected' - */ + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ status?: PrivateEndpointServiceConnectionStatus; - /** - * The reason for approval/rejection of the connection. - */ + /** The reason for approval/rejection of the connection. */ description?: string; - /** - * A message indicating if changes on the service provider require any updates on the consumer. - */ + /** A message indicating if changes on the service provider require any updates on the consumer. */ actionsRequired?: string; } -/** - * An interface representing Resource. - */ -export interface Resource extends BaseResource { +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * Fully qualified resource Id for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * The name of the resource - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The type of the resource. Ex- Microsoft.Compute/virtualMachines or - * Microsoft.Storage/storageAccounts. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; } -/** - * The Private Endpoint Connection resource. - */ -export interface PrivateEndpointConnection extends Resource { - /** - * The resource of private end point. - */ - privateEndpoint?: PrivateEndpoint; - /** - * A collection of information about the state of the connection between service consumer and - * provider. - */ - privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; - /** - * The provisioning state of the private endpoint connection resource. Possible values include: - * 'Succeeded', 'Creating', 'Deleting', 'Failed' - */ - provisioningState?: PrivateEndpointConnectionProvisioningState; +/** Azure container registry configuration information */ +export interface ServiceAcrConfigurationInfo { + /** The list of the ACR login servers. */ + loginServers?: string[]; } -/** - * The properties of a service instance. - */ -export interface ServicesProperties { - /** - * The provisioning state. Possible values include: 'Deleting', 'Succeeded', 'Creating', - * 'Accepted', 'Verifying', 'Updating', 'Failed', 'Canceled', 'Deprovisioned' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provisioningState?: ProvisioningState; - /** - * The access policies of the service instance. - */ - accessPolicies?: ServiceAccessPolicyEntry[]; - /** - * The settings for the Cosmos DB database backing the service. - */ - cosmosDbConfiguration?: ServiceCosmosDbConfigurationInfo; - /** - * The authentication configuration for the service instance. - */ - authenticationConfiguration?: ServiceAuthenticationConfigurationInfo; - /** - * The settings for the CORS configuration of the service instance. - */ - corsConfiguration?: ServiceCorsConfigurationInfo; - /** - * The settings for the export operation of the service instance. - */ - exportConfiguration?: ServiceExportConfigurationInfo; - /** - * The list of private endpoint connections that are set up for this resource. - */ - privateEndpointConnections?: PrivateEndpointConnection[]; - /** - * Control permission for data plane traffic coming from public networks while private endpoint - * is enabled. Possible values include: 'Enabled', 'Disabled' - */ - publicNetworkAccess?: PublicNetworkAccess; +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; } -/** - * The common properties of a service. - */ -export interface ServicesResource extends BaseResource { +/** The common properties of a service. */ +export interface ServicesResource { /** * The resource identifier. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** * The resource name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** * The resource type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; - /** - * The kind of the service. Possible values include: 'fhir', 'fhir-Stu3', 'fhir-R4' - */ + /** The kind of the service. */ kind: Kind; - /** - * The resource location. - */ + /** The resource location. */ location: string; - /** - * The resource tags. - */ + /** The resource tags. */ tags?: { [propertyName: string]: string }; - /** - * An etag associated with the resource, used for optimistic concurrency when editing it. - */ + /** An etag associated with the resource, used for optimistic concurrency when editing it. */ etag?: string; - /** - * Setting indicating whether the service has a managed identity associated with it. - */ + /** Setting indicating whether the service has a managed identity associated with it. */ identity?: ServicesResourceIdentity; } -/** - * The description of the service. - */ -export interface ServicesDescription extends ServicesResource { - /** - * The common properties of a service. - */ - properties?: ServicesProperties; -} - -/** - * The description of the service. - */ -export interface ServicesPatchDescription { - /** - * Instance tags - */ - tags?: { [propertyName: string]: string }; - /** - * Control permission for data plane traffic coming from public networks while private endpoint - * is enabled. Possible values include: 'Enabled', 'Disabled' - */ - publicNetworkAccess?: PublicNetworkAccess; -} - -/** - * Setting indicating whether the service has a managed identity associated with it. - */ +/** Setting indicating whether the service has a managed identity associated with it. */ export interface ServicesResourceIdentity { /** * The principal ID of the resource identity. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly principalId?: string; /** * The tenant ID of the resource. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tenantId?: string; - /** - * Type of identity being specified, currently SystemAssigned and None are allowed. Possible - * values include: 'SystemAssigned', 'None' - */ + /** Type of identity being specified, currently SystemAssigned and None are allowed. */ type?: ManagedServiceIdentityType; } -/** - * Error details. - */ +/** Error details. */ +export interface ErrorDetails { + /** Error details */ + error?: ErrorDetailsInternal; +} + +/** Error details. */ export interface ErrorDetailsInternal { /** * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly code?: string; /** * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly message?: string; /** * The target of the particular error. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly target?: string; } -/** - * Error details. - */ -export interface ErrorDetails { - /** - * Object containing error details. - */ - error?: ErrorDetailsInternal; -} - -/** - * The object that represents the operation. - */ -export interface OperationDisplay { - /** - * Service provider: Microsoft.HealthcareApis - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provider?: string; - /** - * Resource Type: Services - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resource?: string; - /** - * Name of the operation - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operation?: string; - /** - * Friendly description for the operation, - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly description?: string; +/** The description of the service. */ +export interface ServicesPatchDescription { + /** Instance tags */ + tags?: { [propertyName: string]: string }; + /** Control permission for data plane traffic coming from public networks while private endpoint is enabled. */ + publicNetworkAccess?: PublicNetworkAccess; } -/** - * Service REST API operation. - */ -export interface Operation { - /** - * Operation name: {provider}/{resource}/{read | write | action | delete} - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Default value is 'user,system'. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly origin?: string; - /** - * The information displayed about the operation. - */ - display?: OperationDisplay; +/** A list of service description objects with a next link. */ +export interface ServicesDescriptionListResult { + /** The link used to get the next page of service description objects. */ + nextLink?: string; + /** A list of service description objects. */ + value?: ServicesDescription[]; } -/** - * Input values. - */ +/** Input values. */ export interface CheckNameAvailabilityParameters { - /** - * The name of the service instance to check. - */ + /** The name of the service instance to check. */ name: string; - /** - * The fully qualified resource type which includes provider namespace. - */ + /** The fully qualified resource type which includes provider namespace. */ type: string; } -/** - * The properties indicating whether a given service name is available. - */ +/** The properties indicating whether a given service name is available. */ export interface ServicesNameAvailabilityInfo { /** * The value which indicates whether the provided name is available. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly nameAvailable?: boolean; /** - * The reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The reason for unavailability. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly reason?: ServiceNameUnavailabilityReason; - /** - * The detailed reason message. - */ + /** The detailed reason message. */ message?: string; } -/** - * The properties indicating the operation result of an operation on a service. - */ -export interface OperationResultsDescription { +/** List of private endpoint connection associated with the specified storage account */ +export interface PrivateEndpointConnectionListResultDescription { + /** Array of private endpoint connections */ + value?: PrivateEndpointConnectionDescription[]; +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResultDescription { + /** Array of private link resources */ + value?: PrivateLinkResourceDescription[]; +} + +/** Collection of workspace object with a next link */ +export interface WorkspaceList { + /** The link used to get the next page. */ + nextLink?: string; + /** Collection of resources. */ + value?: Workspace[]; +} + +/** Workspaces resource specific properties. */ +export interface WorkspaceProperties { + /** The provisioning state. */ + provisioningState?: ProvisioningState; +} + +/** List of key value pairs that describe the resource. This will overwrite the existing tags. */ +export interface ResourceTags { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; +} + +/** The common properties for any resource, tracked or proxy. */ +export interface ResourceCore { /** - * The ID of the operation returned. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The resource identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; /** - * The name of the operation result. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * The resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly name?: string; /** - * The status of the operation being performed. Possible values include: 'Canceled', 'Succeeded', - * 'Failed', 'Requested', 'Running' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: OperationResultStatus; - /** - * The time that the operation was started. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly startTime?: string; - /** - * Additional properties of the operation result. + * The resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties?: any; + readonly type?: string; + /** An etag associated with the resource, used for optimistic concurrency when editing it. */ + etag?: string; } -/** - * The resource model definition for a ARM proxy resource. It will have everything other than - * required location and tags - */ -export interface ProxyResource extends Resource { +/** Error details. */ +export interface ErrorModel { + /** Error details */ + error?: ErrorDetailsInternal; } -/** - * The resource model definition for a ARM tracked top level resource - */ -export interface TrackedResource extends Resource { +/** The collection of Dicom Services. */ +export interface DicomServiceCollection { + /** The link used to get the next page of Dicom Services. */ + nextLink?: string; + /** The list of Dicom Services. */ + value?: DicomService[]; +} + +/** Authentication configuration information */ +export interface DicomServiceAuthenticationConfiguration { /** - * Resource tags. + * The authority url for the service + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly authority?: string; /** - * The geo-location where the resource lives + * The audiences for the service + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location: string; + readonly audiences?: string[]; } -/** - * The resource model definition for a Azure Resource Manager resource with an etag. - */ -export interface AzureEntityResource extends Resource { - /** - * Resource Etag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly etag?: string; +/** A collection of IoT Connectors. */ +export interface IotConnectorCollection { + /** The link used to get the next page of IoT Connectors. */ + nextLink?: string; + /** The list of IoT Connectors. */ + value?: IotConnector[]; } -/** - * A private link resource - */ -export interface PrivateLinkResource extends Resource { - /** - * The private link resource group id. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly groupId?: string; - /** - * The private link resource required member names. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly requiredMembers?: string[]; - /** - * The private link resource Private link DNS zone name. - */ - requiredZoneNames?: string[]; +/** Event Hub ingestion endpoint configuration */ +export interface IotEventHubIngestionEndpointConfiguration { + /** Event Hub name to connect to. */ + eventHubName?: string; + /** Consumer group of the event hub to connected to. */ + consumerGroup?: string; + /** Fully qualified namespace of the Event Hub to connect to. */ + fullyQualifiedEventHubNamespace?: string; } -/** - * A list of private link resources - */ -export interface PrivateLinkResourceListResult { - /** - * Array of private link resources - */ - value?: PrivateLinkResource[]; +/** The mapping content. */ +export interface IotMappingProperties { + /** The mapping. */ + content?: Record; } -/** - * An interface representing HealthcareApisManagementClientOptions. - */ -export interface HealthcareApisManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; +/** The managed identity of a service. */ +export interface ServiceManagedIdentity { + /** Setting indicating whether the service has a managed identity associated with it. */ + identity?: ServiceManagedIdentityIdentity; } -/** - * @interface - * A list of service description objects with a next link. - * @extends Array - */ -export interface ServicesDescriptionListResult extends Array { - /** - * The link used to get the next page of service description objects. - */ - nextLink?: string; +/** Setting indicating whether the service has a managed identity associated with it. */ +export interface ServiceManagedIdentityIdentity { + /** Type of identity being specified, currently SystemAssigned and None are allowed. */ + type?: ManagedServiceIdentityType; } -/** - * @interface - * A list of service operations. It contains a list of operations and a URL link to get the next - * set of results. - * @extends Array - */ -export interface OperationListResult extends Array { - /** - * The link used to get the next page of service description objects. - */ +/** A collection of IoT Connector FHIR destinations. */ +export interface IotFhirDestinationCollection { + /** The link used to get the next page of IoT FHIR destinations. */ nextLink?: string; + /** The list of IoT Connector FHIR destinations. */ + value?: IotFhirDestination[]; } -/** - * @interface - * List of private endpoint connection associated with the specified storage account - * @extends Array - */ -export interface PrivateEndpointConnectionListResult extends Array { +/** Common IoT Connector destination properties. */ +export interface IotDestinationProperties { + /** The provisioning state. */ + provisioningState?: ProvisioningState; } -/** - * Defines values for ProvisioningState. - * Possible values include: 'Deleting', 'Succeeded', 'Creating', 'Accepted', 'Verifying', - * 'Updating', 'Failed', 'Canceled', 'Deprovisioned' - * @readonly - * @enum {string} - */ -export type ProvisioningState = 'Deleting' | 'Succeeded' | 'Creating' | 'Accepted' | 'Verifying' | 'Updating' | 'Failed' | 'Canceled' | 'Deprovisioned'; - -/** - * Defines values for PrivateEndpointServiceConnectionStatus. - * Possible values include: 'Pending', 'Approved', 'Rejected' - * @readonly - * @enum {string} - */ -export type PrivateEndpointServiceConnectionStatus = 'Pending' | 'Approved' | 'Rejected'; - -/** - * Defines values for PrivateEndpointConnectionProvisioningState. - * Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' - * @readonly - * @enum {string} - */ -export type PrivateEndpointConnectionProvisioningState = 'Succeeded' | 'Creating' | 'Deleting' | 'Failed'; +/** A collection of Fhir services. */ +export interface FhirServiceCollection { + /** The link used to get the next page of Fhir Services. */ + nextLink?: string; + /** The list of Fhir Services. */ + value?: FhirService[]; +} -/** - * Defines values for PublicNetworkAccess. - * Possible values include: 'Enabled', 'Disabled' - * @readonly - * @enum {string} - */ -export type PublicNetworkAccess = 'Enabled' | 'Disabled'; +/** An access policy entry. */ +export interface FhirServiceAccessPolicyEntry { + /** An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. */ + objectId: string; +} -/** - * Defines values for Kind. - * Possible values include: 'fhir', 'fhir-Stu3', 'fhir-R4' - * @readonly - * @enum {string} - */ -export type Kind = 'fhir' | 'fhir-Stu3' | 'fhir-R4'; +/** Azure container registry configuration information */ +export interface FhirServiceAcrConfiguration { + /** The list of the Azure container registry login servers. */ + loginServers?: string[]; +} -/** - * Defines values for ManagedServiceIdentityType. - * Possible values include: 'SystemAssigned', 'None' - * @readonly - * @enum {string} - */ -export type ManagedServiceIdentityType = 'SystemAssigned' | 'None'; +/** Authentication configuration information */ +export interface FhirServiceAuthenticationConfiguration { + /** The authority url for the service */ + authority?: string; + /** The audience url for the service */ + audience?: string; + /** If the SMART on FHIR proxy is enabled */ + smartProxyEnabled?: boolean; +} -/** - * Defines values for ServiceNameUnavailabilityReason. - * Possible values include: 'Invalid', 'AlreadyExists' - * @readonly - * @enum {string} - */ -export type ServiceNameUnavailabilityReason = 'Invalid' | 'AlreadyExists'; +/** The settings for the CORS configuration of the service instance. */ +export interface FhirServiceCorsConfiguration { + /** The origins to be allowed via CORS. */ + origins?: string[]; + /** The headers to be allowed via CORS. */ + headers?: string[]; + /** The methods to be allowed via CORS. */ + methods?: string[]; + /** The max age to be allowed via CORS. */ + maxAge?: number; + /** If credentials are allowed via CORS. */ + allowCredentials?: boolean; +} -/** - * Defines values for OperationResultStatus. - * Possible values include: 'Canceled', 'Succeeded', 'Failed', 'Requested', 'Running' - * @readonly - * @enum {string} - */ -export type OperationResultStatus = 'Canceled' | 'Succeeded' | 'Failed' | 'Requested' | 'Running'; +/** Export operation configuration information */ +export interface FhirServiceExportConfiguration { + /** The name of the default export storage account. */ + storageAccountName?: string; +} -/** - * Contains response data for the get operation. - */ -export type ServicesGetResponse = ServicesDescription & { +/** Available operations of the service */ +export interface ListOperations { /** - * The underlying HTTP response. + * Collection of available operation details + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServicesDescription; - }; -}; - -/** - * Contains response data for the createOrUpdate operation. - */ -export type ServicesCreateOrUpdateResponse = ServicesDescription & { + readonly value?: OperationDetail[]; /** - * The underlying HTTP response. + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServicesDescription; - }; -}; + nextLink?: string; +} -/** - * Contains response data for the update operation. - */ -export type ServicesUpdateResponse = ServicesDescription & { +/** Service REST API operation. */ +export interface OperationDetail { /** - * The underlying HTTP response. + * Name of the operation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Display of the operation */ + display?: OperationDisplay; + /** + * Default value is 'user,system'. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: string; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; + readonly actionType?: ActionType; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServicesDescription; - }; -}; +/** The object that represents the operation. */ +export interface OperationDisplay { + /** + * Service provider: Microsoft.HealthcareApis + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * Resource Type: Services + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * Name of the operation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * Friendly description for the operation, + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} -/** - * Contains response data for the list operation. - */ -export type ServicesListResponse = ServicesDescriptionListResult & { +/** The properties indicating the operation result of an operation on a service. */ +export interface OperationResultsDescription { /** - * The underlying HTTP response. + * The ID of the operation returned. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; + readonly id?: string; + /** + * The name of the operation result. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The status of the operation being performed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: OperationResultStatus; + /** + * The time that the operation was started. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startTime?: string; + /** Additional properties of the operation result. */ + properties?: Record; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServicesDescriptionListResult; - }; +/** The Private Endpoint Connection resource. */ +export type PrivateEndpointConnection = Resource & { + /** The resource of private end point. */ + privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** + * The provisioning state of the private endpoint connection resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; }; -/** - * Contains response data for the listByResourceGroup operation. - */ -export type ServicesListByResourceGroupResponse = ServicesDescriptionListResult & { +/** A private link resource */ +export type PrivateLinkResource = Resource & { /** - * The underlying HTTP response. + * The private link resource group id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServicesDescriptionListResult; - }; + readonly groupId?: string; + /** + * The private link resource required member names. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; }; -/** - * Contains response data for the checkNameAvailability operation. - */ -export type ServicesCheckNameAvailabilityResponse = ServicesNameAvailabilityInfo & { +/** The description of the service. */ +export type ServicesDescription = ServicesResource & { + /** The common properties of a service. */ + properties?: ServicesProperties; /** - * The underlying HTTP response. + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; + readonly systemData?: SystemData; +}; + +/** The common properties of tracked resources in the service. */ +export type TaggedResource = ResourceTags & LocationBasedResource & {}; + +/** Workspace patch properties */ +export type WorkspacePatchResource = ResourceTags & {}; + +/** Dicom Service patch properties */ +export type DicomServicePatchResource = ResourceTags & {}; + +/** Iot Connector patch properties */ +export type IotConnectorPatchResource = ResourceTags & + ServiceManagedIdentity & {}; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServicesNameAvailabilityInfo; - }; +/** FhirService patch properties */ +export type FhirServicePatchResource = ResourceTags & + ServiceManagedIdentity & {}; + +/** The common properties for any location based resource, tracked or proxy. */ +export type LocationBasedResource = ResourceCore & { + /** The resource location. */ + location?: string; }; -/** - * Contains response data for the beginCreateOrUpdate operation. - */ -export type ServicesBeginCreateOrUpdateResponse = ServicesDescription & { +/** IoT Connector definition. */ +export type IotConnector = TaggedResource & + ServiceManagedIdentity & { + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The provisioning state. */ + provisioningState?: ProvisioningState; + /** Source configuration. */ + ingestionEndpointConfiguration?: IotEventHubIngestionEndpointConfiguration; + /** Device Mappings. */ + deviceMapping?: IotMappingProperties; + }; + +/** The description of Fhir Service */ +export type FhirService = TaggedResource & + ServiceManagedIdentity & { + /** The kind of the service. */ + kind?: FhirServiceKind; + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The provisioning state. */ + provisioningState?: ProvisioningState; + /** Fhir Service access policies. */ + accessPolicies?: FhirServiceAccessPolicyEntry[]; + /** Fhir Service Azure container registry configuration. */ + acrConfiguration?: FhirServiceAcrConfiguration; + /** Fhir Service authentication configuration. */ + authenticationConfiguration?: FhirServiceAuthenticationConfiguration; + /** Fhir Service Cors configuration. */ + corsConfiguration?: FhirServiceCorsConfiguration; + /** Fhir Service export configuration. */ + exportConfiguration?: FhirServiceExportConfiguration; + }; + +/** IoT Connector destination properties for an Azure FHIR service. */ +export type IotFhirDestinationProperties = IotDestinationProperties & { + /** Determines how resource identity is resolved on the destination. */ + resourceIdentityResolutionType: IotIdentityResolutionType; + /** Fully qualified resource id of the FHIR service to connect to. */ + fhirServiceResourceId: string; + /** FHIR Mappings */ + fhirMapping: IotMappingProperties; +}; + +/** The Private Endpoint Connection resource. */ +export type PrivateEndpointConnectionDescription = PrivateEndpointConnection & { /** - * The underlying HTTP response. + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServicesDescription; - }; + readonly systemData?: SystemData; }; -/** - * Contains response data for the beginUpdate operation. - */ -export type ServicesBeginUpdateResponse = ServicesDescription & { +/** The Private Endpoint Connection resource. */ +export type PrivateLinkResourceDescription = PrivateLinkResource & { /** - * The underlying HTTP response. + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServicesDescription; - }; + readonly systemData?: SystemData; }; -/** - * Contains response data for the listNext operation. - */ -export type ServicesListNextResponse = ServicesDescriptionListResult & { +/** Workspace resource. */ +export type Workspace = TaggedResource & { + /** Workspaces resource specific properties. */ + properties?: WorkspaceProperties; /** - * The underlying HTTP response. + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServicesDescriptionListResult; - }; + readonly systemData?: SystemData; }; -/** - * Contains response data for the listByResourceGroupNext operation. - */ -export type ServicesListByResourceGroupNextResponse = ServicesDescriptionListResult & { +/** The description of Dicom Service */ +export type DicomService = TaggedResource & { + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The provisioning state. */ + provisioningState?: ProvisioningState; + /** Dicom Service authentication configuration. */ + authenticationConfiguration?: DicomServiceAuthenticationConfiguration; /** - * The underlying HTTP response. + * The url of the Dicom Services. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; + readonly serviceUrl?: string; +}; - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServicesDescriptionListResult; - }; +/** IoT Connector FHIR destination definition. */ +export type IotFhirDestination = LocationBasedResource & { + /** + * Metadata pertaining to creation and last modification of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** The provisioning state. */ + provisioningState?: ProvisioningState; + /** Determines how resource identity is resolved on the destination. */ + resourceIdentityResolutionType: IotIdentityResolutionType; + /** Fully qualified resource id of the FHIR service to connect to. */ + fhirServiceResourceId: string; + /** FHIR Mappings */ + fhirMapping: IotMappingProperties; }; +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + Deleting = "Deleting", + Succeeded = "Succeeded", + Creating = "Creating", + Accepted = "Accepted", + Verifying = "Verifying", + Updating = "Updating", + Failed = "Failed", + Canceled = "Canceled", + Deprovisioned = "Deprovisioned", + Moving = "Moving", + Suspended = "Suspended", + Warned = "Warned", + SystemMaintenance = "SystemMaintenance" +} + /** - * Contains response data for the list operation. + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Deleting** \ + * **Succeeded** \ + * **Creating** \ + * **Accepted** \ + * **Verifying** \ + * **Updating** \ + * **Failed** \ + * **Canceled** \ + * **Deprovisioned** \ + * **Moving** \ + * **Suspended** \ + * **Warned** \ + * **SystemMaintenance** */ -export type OperationsListResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type ProvisioningState = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected" +} /** - * Contains response data for the listNext operation. + * Defines values for PrivateEndpointServiceConnectionStatus. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** */ -export type OperationsListNextResponse = OperationListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; -}; +export type PrivateEndpointServiceConnectionStatus = string; + +/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + Succeeded = "Succeeded", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed" +} /** - * Contains response data for the get operation. + * Defines values for PrivateEndpointConnectionProvisioningState. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Deleting** \ + * **Failed** */ -export type OperationResultsGetResponse = { - /** - * The parsed response body. - */ - body: any; +export type PrivateEndpointConnectionProvisioningState = string; - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + Enabled = "Enabled", + Disabled = "Disabled" +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: any; - }; -}; +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type PublicNetworkAccess = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + User = "User", + Application = "Application", + ManagedIdentity = "ManagedIdentity", + Key = "Key" +} /** - * Contains response data for the listByService operation. + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** */ -export type PrivateEndpointConnectionsListByServiceResponse = PrivateEndpointConnectionListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type CreatedByType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnectionListResult; - }; -}; +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + SystemAssigned = "SystemAssigned", + None = "None" +} /** - * Contains response data for the get operation. + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SystemAssigned** \ + * **None** */ -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type ManagedServiceIdentityType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Known values of {@link IotIdentityResolutionType} that the service accepts. */ +export enum KnownIotIdentityResolutionType { + Create = "Create", + Lookup = "Lookup" +} /** - * Contains response data for the createOrUpdate operation. + * Defines values for IotIdentityResolutionType. \ + * {@link KnownIotIdentityResolutionType} can be used interchangeably with IotIdentityResolutionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Create** \ + * **Lookup** */ -export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type IotIdentityResolutionType = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Known values of {@link FhirServiceKind} that the service accepts. */ +export enum KnownFhirServiceKind { + FhirStu3 = "fhir-Stu3", + FhirR4 = "fhir-R4" +} /** - * Contains response data for the beginCreateOrUpdate operation. + * Defines values for FhirServiceKind. \ + * {@link KnownFhirServiceKind} can be used interchangeably with FhirServiceKind, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **fhir-Stu3** \ + * **fhir-R4** */ -export type PrivateEndpointConnectionsBeginCreateOrUpdateResponse = PrivateEndpointConnection & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type FhirServiceKind = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; -}; +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + Internal = "Internal" +} /** - * Contains response data for the listByService operation. + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** */ -export type PrivateLinkResourcesListByServiceResponse = PrivateLinkResourceListResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateLinkResourceListResult; - }; -}; +export type ActionType = string; + +/** Known values of {@link OperationResultStatus} that the service accepts. */ +export enum KnownOperationResultStatus { + Canceled = "Canceled", + Succeeded = "Succeeded", + Failed = "Failed", + Requested = "Requested", + Running = "Running" +} /** - * Contains response data for the get operation. + * Defines values for OperationResultStatus. \ + * {@link KnownOperationResultStatus} can be used interchangeably with OperationResultStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Canceled** \ + * **Succeeded** \ + * **Failed** \ + * **Requested** \ + * **Running** */ -export type PrivateLinkResourcesGetResponse = PrivateLinkResource & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type OperationResultStatus = string; +/** Defines values for Kind. */ +export type Kind = "fhir" | "fhir-Stu3" | "fhir-R4"; +/** Defines values for ServiceNameUnavailabilityReason. */ +export type ServiceNameUnavailabilityReason = "Invalid" | "AlreadyExists"; + +/** Optional parameters. */ +export interface ServicesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ServicesGetResponse = ServicesDescription; + +/** Optional parameters. */ +export interface ServicesCreateOrUpdateOptionalParams + 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; +} - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateLinkResource; - }; -}; +/** Contains response data for the createOrUpdate operation. */ +export type ServicesCreateOrUpdateResponse = ServicesDescription; + +/** Optional parameters. */ +export interface ServicesUpdateOptionalParams + 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 update operation. */ +export type ServicesUpdateResponse = ServicesDescription; + +/** Optional parameters. */ +export interface ServicesDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface ServicesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ServicesListResponse = ServicesDescriptionListResult; + +/** Optional parameters. */ +export interface ServicesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ServicesListByResourceGroupResponse = ServicesDescriptionListResult; + +/** Optional parameters. */ +export interface ServicesCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type ServicesCheckNameAvailabilityResponse = ServicesNameAvailabilityInfo; + +/** Optional parameters. */ +export interface ServicesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ServicesListNextResponse = ServicesDescriptionListResult; + +/** Optional parameters. */ +export interface ServicesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ServicesListByResourceGroupNextResponse = ServicesDescriptionListResult; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByServiceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByService operation. */ +export type PrivateEndpointConnectionsListByServiceResponse = PrivateEndpointConnectionListResultDescription; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnectionDescription; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOrUpdateOptionalParams + 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 PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnectionDescription; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByServiceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByService operation. */ +export type PrivateLinkResourcesListByServiceResponse = PrivateLinkResourceListResultDescription; + +/** Optional parameters. */ +export interface PrivateLinkResourcesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateLinkResourcesGetResponse = PrivateLinkResourceDescription; + +/** Optional parameters. */ +export interface WorkspacesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type WorkspacesListBySubscriptionResponse = WorkspaceList; + +/** Optional parameters. */ +export interface WorkspacesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type WorkspacesListByResourceGroupResponse = WorkspaceList; + +/** Optional parameters. */ +export interface WorkspacesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type WorkspacesGetResponse = Workspace; + +/** Optional parameters. */ +export interface WorkspacesCreateOrUpdateOptionalParams + 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 WorkspacesCreateOrUpdateResponse = Workspace; + +/** Optional parameters. */ +export interface WorkspacesUpdateOptionalParams + 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 update operation. */ +export type WorkspacesUpdateResponse = Workspace; + +/** Optional parameters. */ +export interface WorkspacesDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface WorkspacesListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type WorkspacesListBySubscriptionNextResponse = WorkspaceList; + +/** Optional parameters. */ +export interface WorkspacesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type WorkspacesListByResourceGroupNextResponse = WorkspaceList; + +/** Optional parameters. */ +export interface DicomServicesListByWorkspaceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByWorkspace operation. */ +export type DicomServicesListByWorkspaceResponse = DicomServiceCollection; + +/** Optional parameters. */ +export interface DicomServicesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DicomServicesGetResponse = DicomService; + +/** Optional parameters. */ +export interface DicomServicesCreateOrUpdateOptionalParams + 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 DicomServicesCreateOrUpdateResponse = DicomService; + +/** Optional parameters. */ +export interface DicomServicesUpdateOptionalParams + 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 update operation. */ +export type DicomServicesUpdateResponse = DicomService; + +/** Optional parameters. */ +export interface DicomServicesDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface DicomServicesListByWorkspaceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByWorkspaceNext operation. */ +export type DicomServicesListByWorkspaceNextResponse = DicomServiceCollection; + +/** Optional parameters. */ +export interface IotConnectorsListByWorkspaceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByWorkspace operation. */ +export type IotConnectorsListByWorkspaceResponse = IotConnectorCollection; + +/** Optional parameters. */ +export interface IotConnectorsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type IotConnectorsGetResponse = IotConnector; + +/** Optional parameters. */ +export interface IotConnectorsCreateOrUpdateOptionalParams + 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 IotConnectorsCreateOrUpdateResponse = IotConnector; + +/** Optional parameters. */ +export interface IotConnectorsUpdateOptionalParams + 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 update operation. */ +export type IotConnectorsUpdateResponse = IotConnector; + +/** Optional parameters. */ +export interface IotConnectorsDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface IotConnectorsListByWorkspaceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByWorkspaceNext operation. */ +export type IotConnectorsListByWorkspaceNextResponse = IotConnectorCollection; + +/** Optional parameters. */ +export interface FhirDestinationsListByIotConnectorOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByIotConnector operation. */ +export type FhirDestinationsListByIotConnectorResponse = IotFhirDestinationCollection; + +/** Optional parameters. */ +export interface FhirDestinationsListByIotConnectorNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByIotConnectorNext operation. */ +export type FhirDestinationsListByIotConnectorNextResponse = IotFhirDestinationCollection; + +/** Optional parameters. */ +export interface IotConnectorFhirDestinationGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type IotConnectorFhirDestinationGetResponse = IotFhirDestination; + +/** Optional parameters. */ +export interface IotConnectorFhirDestinationCreateOrUpdateOptionalParams + 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 IotConnectorFhirDestinationCreateOrUpdateResponse = IotFhirDestination; + +/** Optional parameters. */ +export interface IotConnectorFhirDestinationDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface FhirServicesListByWorkspaceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByWorkspace operation. */ +export type FhirServicesListByWorkspaceResponse = FhirServiceCollection; + +/** Optional parameters. */ +export interface FhirServicesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FhirServicesGetResponse = FhirService; + +/** Optional parameters. */ +export interface FhirServicesCreateOrUpdateOptionalParams + 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 FhirServicesCreateOrUpdateResponse = FhirService; + +/** Optional parameters. */ +export interface FhirServicesUpdateOptionalParams + 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 update operation. */ +export type FhirServicesUpdateResponse = FhirService; + +/** Optional parameters. */ +export interface FhirServicesDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface FhirServicesListByWorkspaceNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByWorkspaceNext operation. */ +export type FhirServicesListByWorkspaceNextResponse = FhirServiceCollection; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = ListOperations; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = ListOperations; + +/** Optional parameters. */ +export interface OperationResultsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type OperationResultsGetResponse = OperationResultsDescription; + +/** Optional parameters. */ +export interface HealthcareApisManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/models/mappers.ts b/sdk/healthcareapis/arm-healthcareapis/src/models/mappers.ts index d94e8ac1a5e4..9a21e935fcd0 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/models/mappers.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/models/mappers.ts @@ -1,29 +1,107 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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 { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import * as coreClient from "@azure/core-client"; -export const CloudError = CloudErrorMapper; -export const BaseResource = BaseResourceMapper; +export const ServicesProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServicesProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + accessPolicies: { + serializedName: "accessPolicies", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServiceAccessPolicyEntry" + } + } + } + }, + cosmosDbConfiguration: { + serializedName: "cosmosDbConfiguration", + type: { + name: "Composite", + className: "ServiceCosmosDbConfigurationInfo" + } + }, + authenticationConfiguration: { + serializedName: "authenticationConfiguration", + type: { + name: "Composite", + className: "ServiceAuthenticationConfigurationInfo" + } + }, + corsConfiguration: { + serializedName: "corsConfiguration", + type: { + name: "Composite", + className: "ServiceCorsConfigurationInfo" + } + }, + exportConfiguration: { + serializedName: "exportConfiguration", + type: { + name: "Composite", + className: "ServiceExportConfigurationInfo" + } + }, + privateEndpointConnections: { + serializedName: "privateEndpointConnections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + publicNetworkAccess: { + serializedName: "publicNetworkAccess", + type: { + name: "String" + } + }, + acrConfiguration: { + serializedName: "acrConfiguration", + type: { + name: "Composite", + className: "ServiceAcrConfigurationInfo" + } + } + } + } +}; -export const ServiceAccessPolicyEntry: msRest.CompositeMapper = { - serializedName: "ServiceAccessPolicyEntry", +export const ServiceAccessPolicyEntry: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServiceAccessPolicyEntry", modelProperties: { objectId: { - required: true, - serializedName: "objectId", constraints: { - Pattern: /^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$/ + Pattern: new RegExp( + "^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$" + ) }, + serializedName: "objectId", + required: true, type: { name: "String" } @@ -32,18 +110,17 @@ export const ServiceAccessPolicyEntry: msRest.CompositeMapper = { } }; -export const ServiceCosmosDbConfigurationInfo: msRest.CompositeMapper = { - serializedName: "ServiceCosmosDbConfigurationInfo", +export const ServiceCosmosDbConfigurationInfo: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServiceCosmosDbConfigurationInfo", modelProperties: { offerThroughput: { - serializedName: "offerThroughput", constraints: { InclusiveMaximum: 10000, InclusiveMinimum: 400 }, + serializedName: "offerThroughput", type: { name: "Number" } @@ -58,8 +135,7 @@ export const ServiceCosmosDbConfigurationInfo: msRest.CompositeMapper = { } }; -export const ServiceAuthenticationConfigurationInfo: msRest.CompositeMapper = { - serializedName: "ServiceAuthenticationConfigurationInfo", +export const ServiceAuthenticationConfigurationInfo: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServiceAuthenticationConfigurationInfo", @@ -86,8 +162,7 @@ export const ServiceAuthenticationConfigurationInfo: msRest.CompositeMapper = { } }; -export const ServiceCorsConfigurationInfo: msRest.CompositeMapper = { - serializedName: "ServiceCorsConfigurationInfo", +export const ServiceCorsConfigurationInfo: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServiceCorsConfigurationInfo", @@ -97,6 +172,11 @@ export const ServiceCorsConfigurationInfo: msRest.CompositeMapper = { type: { name: "Sequence", element: { + constraints: { + Pattern: new RegExp( + "^(?:(?:(?:[hH][tT][tT][pP](?:[sS]|))\\:\\/\\/(?:[a-zA-Z0-9-]+[.]?)+(?:\\:[0-9]{1,5})?|[*]))$" + ) + }, type: { name: "String" } @@ -126,11 +206,11 @@ export const ServiceCorsConfigurationInfo: msRest.CompositeMapper = { } }, maxAge: { - serializedName: "maxAge", constraints: { InclusiveMaximum: 99999, InclusiveMinimum: 0 }, + serializedName: "maxAge", type: { name: "Number" } @@ -145,8 +225,7 @@ export const ServiceCorsConfigurationInfo: msRest.CompositeMapper = { } }; -export const ServiceExportConfigurationInfo: msRest.CompositeMapper = { - serializedName: "ServiceExportConfigurationInfo", +export const ServiceExportConfigurationInfo: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServiceExportConfigurationInfo", @@ -161,15 +240,14 @@ export const ServiceExportConfigurationInfo: msRest.CompositeMapper = { } }; -export const PrivateEndpoint: msRest.CompositeMapper = { - serializedName: "PrivateEndpoint", +export const PrivateEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", className: "PrivateEndpoint", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } @@ -178,8 +256,7 @@ export const PrivateEndpoint: msRest.CompositeMapper = { } }; -export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { - serializedName: "PrivateLinkServiceConnectionState", +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { type: { name: "Composite", className: "PrivateLinkServiceConnectionState", @@ -206,29 +283,28 @@ export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", className: "Resource", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } @@ -237,158 +313,111 @@ export const Resource: msRest.CompositeMapper = { } }; -export const PrivateEndpointConnection: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnection", +export const ServiceAcrConfigurationInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointConnection", + className: "ServiceAcrConfigurationInfo", modelProperties: { - ...Resource.type.modelProperties, - privateEndpoint: { - serializedName: "properties.privateEndpoint", + loginServers: { + serializedName: "loginServers", type: { - name: "Composite", - className: "PrivateEndpoint" - } - }, - privateLinkServiceConnectionState: { - required: true, - serializedName: "properties.privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const ServicesProperties: msRest.CompositeMapper = { - serializedName: "ServicesProperties", +export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServicesProperties", + className: "SystemData", modelProperties: { - provisioningState: { - readOnly: true, - serializedName: "provisioningState", + createdBy: { + serializedName: "createdBy", type: { name: "String" } }, - accessPolicies: { - serializedName: "accessPolicies", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ServiceAccessPolicyEntry" - } - } - } - }, - cosmosDbConfiguration: { - serializedName: "cosmosDbConfiguration", - type: { - name: "Composite", - className: "ServiceCosmosDbConfigurationInfo" - } - }, - authenticationConfiguration: { - serializedName: "authenticationConfiguration", + createdByType: { + serializedName: "createdByType", type: { - name: "Composite", - className: "ServiceAuthenticationConfigurationInfo" + name: "String" } }, - corsConfiguration: { - serializedName: "corsConfiguration", + createdAt: { + serializedName: "createdAt", type: { - name: "Composite", - className: "ServiceCorsConfigurationInfo" + name: "DateTime" } }, - exportConfiguration: { - serializedName: "exportConfiguration", + lastModifiedBy: { + serializedName: "lastModifiedBy", type: { - name: "Composite", - className: "ServiceExportConfigurationInfo" + name: "String" } }, - privateEndpointConnections: { - serializedName: "privateEndpointConnections", + lastModifiedByType: { + serializedName: "lastModifiedByType", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } + name: "String" } }, - publicNetworkAccess: { - serializedName: "publicNetworkAccess", + lastModifiedAt: { + serializedName: "lastModifiedAt", type: { - name: "String" + name: "DateTime" } } } } }; -export const ServicesResource: msRest.CompositeMapper = { - serializedName: "ServicesResource", +export const ServicesResource: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServicesResource", modelProperties: { id: { - readOnly: true, serializedName: "id", + readOnly: true, type: { name: "String" } }, name: { - readOnly: true, - serializedName: "name", constraints: { - Pattern: /^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$/ + Pattern: new RegExp("^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$") }, + serializedName: "name", + readOnly: true, type: { name: "String" } }, type: { - readOnly: true, serializedName: "type", + readOnly: true, type: { name: "String" } }, kind: { - required: true, serializedName: "kind", + required: true, type: { name: "Enum", - allowedValues: [ - "fhir", - "fhir-Stu3", - "fhir-R4" - ] + allowedValues: ["fhir", "fhir-Stu3", "fhir-R4"] } }, location: { - required: true, serializedName: "location", + required: true, type: { name: "String" } @@ -397,11 +426,7 @@ export const ServicesResource: msRest.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } }, etag: { @@ -421,67 +446,21 @@ export const ServicesResource: msRest.CompositeMapper = { } }; -export const ServicesDescription: msRest.CompositeMapper = { - serializedName: "ServicesDescription", - type: { - name: "Composite", - className: "ServicesDescription", - modelProperties: { - ...ServicesResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ServicesProperties" - } - } - } - } -}; - -export const ServicesPatchDescription: msRest.CompositeMapper = { - serializedName: "ServicesPatchDescription", - type: { - name: "Composite", - className: "ServicesPatchDescription", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", - type: { - name: "String" - } - } - } - } -}; - -export const ServicesResourceIdentity: msRest.CompositeMapper = { - serializedName: "ServicesResource_identity", +export const ServicesResourceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServicesResourceIdentity", modelProperties: { principalId: { - readOnly: true, serializedName: "principalId", + readOnly: true, type: { name: "String" } }, tenantId: { - readOnly: true, serializedName: "tenantId", + readOnly: true, type: { name: "String" } @@ -496,29 +475,44 @@ export const ServicesResourceIdentity: msRest.CompositeMapper = { } }; -export const ErrorDetailsInternal: msRest.CompositeMapper = { - serializedName: "ErrorDetailsInternal", +export const ErrorDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetails", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetailsInternal" + } + } + } + } +}; + +export const ErrorDetailsInternal: coreClient.CompositeMapper = { type: { name: "Composite", className: "ErrorDetailsInternal", modelProperties: { code: { - readOnly: true, serializedName: "code", + readOnly: true, type: { name: "String" } }, message: { - readOnly: true, serializedName: "message", + readOnly: true, type: { name: "String" } }, target: { - readOnly: true, serializedName: "target", + readOnly: true, type: { name: "String" } @@ -527,53 +521,20 @@ export const ErrorDetailsInternal: msRest.CompositeMapper = { } }; -export const ErrorDetails: msRest.CompositeMapper = { - serializedName: "ErrorDetails", +export const ServicesPatchDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetails", + className: "ServicesPatchDescription", modelProperties: { - error: { - serializedName: "error", + tags: { + serializedName: "tags", type: { - name: "Composite", - className: "ErrorDetailsInternal" - } - } - } - } -}; - -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "OperationDisplay", - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - readOnly: true, - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - readOnly: true, - serializedName: "operation", - type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - description: { - readOnly: true, - serializedName: "description", + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", type: { name: "String" } @@ -582,53 +543,48 @@ export const OperationDisplay: msRest.CompositeMapper = { } }; -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const ServicesDescriptionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "ServicesDescriptionListResult", modelProperties: { - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - origin: { - readOnly: true, - serializedName: "origin", + nextLink: { + serializedName: "nextLink", type: { name: "String" } }, - display: { - serializedName: "display", + value: { + serializedName: "value", type: { - name: "Composite", - className: "OperationDisplay" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServicesDescription" + } + } } } } } }; -export const CheckNameAvailabilityParameters: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityParameters", +export const CheckNameAvailabilityParameters: coreClient.CompositeMapper = { type: { name: "Composite", className: "CheckNameAvailabilityParameters", modelProperties: { name: { - required: true, serializedName: "name", + required: true, type: { name: "String" } }, type: { - required: true, serializedName: "type", + required: true, type: { name: "String" } @@ -637,28 +593,24 @@ export const CheckNameAvailabilityParameters: msRest.CompositeMapper = { } }; -export const ServicesNameAvailabilityInfo: msRest.CompositeMapper = { - serializedName: "ServicesNameAvailabilityInfo", +export const ServicesNameAvailabilityInfo: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServicesNameAvailabilityInfo", modelProperties: { nameAvailable: { - readOnly: true, serializedName: "nameAvailable", + readOnly: true, type: { name: "Boolean" } }, reason: { - readOnly: true, serializedName: "reason", + readOnly: true, type: { name: "Enum", - allowedValues: [ - "Invalid", - "AlreadyExists" - ] + allowedValues: ["Invalid", "AlreadyExists"] } }, message: { @@ -671,99 +623,136 @@ export const ServicesNameAvailabilityInfo: msRest.CompositeMapper = { } }; -export const OperationResultsDescription: msRest.CompositeMapper = { - serializedName: "OperationResultsDescription", +export const PrivateEndpointConnectionListResultDescription: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationResultsDescription", + className: "PrivateEndpointConnectionListResultDescription", modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnectionDescription" + } + } } - }, - status: { - readOnly: true, - serializedName: "status", + } + } + } +}; + +export const PrivateLinkResourceListResultDescription: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceListResultDescription", + modelProperties: { + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResourceDescription" + } + } } - }, - startTime: { - readOnly: true, - serializedName: "startTime", + } + } + } +}; + +export const WorkspaceList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkspaceList", + modelProperties: { + nextLink: { + serializedName: "nextLink", type: { name: "String" } }, - properties: { - serializedName: "properties", + value: { + serializedName: "value", type: { - name: "Object" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Workspace" + } + } } } } } }; -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", +export const WorkspaceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProxyResource", + className: "WorkspaceProperties", modelProperties: { - ...Resource.type.modelProperties + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String" + } + } } } }; -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", +export const ResourceTags: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "ResourceTags", modelProperties: { - ...Resource.type.modelProperties, tags: { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - location: { - required: true, - serializedName: "location", - type: { - name: "String" + value: { type: { name: "String" } } } } } } }; -export const AzureEntityResource: msRest.CompositeMapper = { - serializedName: "AzureEntityResource", +export const ResourceCore: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureEntityResource", + className: "ResourceCore", modelProperties: { - ...Resource.type.modelProperties, - etag: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + constraints: { + Pattern: new RegExp("^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$") + }, + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", readOnly: true, + type: { + name: "String" + } + }, + etag: { serializedName: "etag", type: { name: "String" @@ -773,39 +762,41 @@ export const AzureEntityResource: msRest.CompositeMapper = { } }; -export const PrivateLinkResource: msRest.CompositeMapper = { - serializedName: "PrivateLinkResource", +export const ErrorModel: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkResource", + className: "ErrorModel", modelProperties: { - ...Resource.type.modelProperties, - groupId: { - readOnly: true, - serializedName: "properties.groupId", + error: { + serializedName: "error", type: { - name: "String" + name: "Composite", + className: "ErrorDetailsInternal" } - }, - requiredMembers: { - readOnly: true, - serializedName: "properties.requiredMembers", + } + } + } +}; + +export const DicomServiceCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DicomServiceCollection", + modelProperties: { + nextLink: { + serializedName: "nextLink", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - requiredZoneNames: { - serializedName: "properties.requiredZoneNames", + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "DicomService" } } } @@ -814,20 +805,26 @@ export const PrivateLinkResource: msRest.CompositeMapper = { } }; -export const PrivateLinkResourceListResult: msRest.CompositeMapper = { - serializedName: "PrivateLinkResourceListResult", +export const DicomServiceAuthenticationConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkResourceListResult", + className: "DicomServiceAuthenticationConfiguration", modelProperties: { - value: { - serializedName: "value", + authority: { + serializedName: "authority", + readOnly: true, + type: { + name: "String" + } + }, + audiences: { + serializedName: "audiences", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "Composite", - className: "PrivateLinkResource" + name: "String" } } } @@ -836,11 +833,10 @@ export const PrivateLinkResourceListResult: msRest.CompositeMapper = { } }; -export const ServicesDescriptionListResult: msRest.CompositeMapper = { - serializedName: "ServicesDescriptionListResult", +export const IotConnectorCollection: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServicesDescriptionListResult", + className: "IotConnectorCollection", modelProperties: { nextLink: { serializedName: "nextLink", @@ -849,13 +845,13 @@ export const ServicesDescriptionListResult: msRest.CompositeMapper = { } }, value: { - serializedName: "", + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ServicesDescription" + className: "IotConnector" } } } @@ -864,51 +860,884 @@ export const ServicesDescriptionListResult: msRest.CompositeMapper = { } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const IotEventHubIngestionEndpointConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "IotEventHubIngestionEndpointConfiguration", modelProperties: { - nextLink: { - serializedName: "nextLink", + eventHubName: { + serializedName: "eventHubName", type: { name: "String" } }, - value: { - readOnly: true, - serializedName: "", + consumerGroup: { + serializedName: "consumerGroup", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } + name: "String" + } + }, + fullyQualifiedEventHubNamespace: { + serializedName: "fullyQualifiedEventHubNamespace", + type: { + name: "String" } } } } }; -export const PrivateEndpointConnectionListResult: msRest.CompositeMapper = { - serializedName: "PrivateEndpointConnectionListResult", +export const IotMappingProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointConnectionListResult", + className: "IotMappingProperties", modelProperties: { - value: { - serializedName: "", + content: { + serializedName: "content", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection" - } - } + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const ServiceManagedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceManagedIdentity", + modelProperties: { + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ServiceManagedIdentityIdentity" + } + } + } + } +}; + +export const ServiceManagedIdentityIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceManagedIdentityIdentity", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const IotFhirDestinationCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotFhirDestinationCollection", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IotFhirDestination" + } + } + } + } + } + } +}; + +export const IotDestinationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotDestinationProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const FhirServiceCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FhirServiceCollection", + modelProperties: { + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FhirService" + } + } + } + } + } + } +}; + +export const FhirServiceAccessPolicyEntry: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FhirServiceAccessPolicyEntry", + modelProperties: { + objectId: { + constraints: { + Pattern: new RegExp( + "^(([0-9A-Fa-f]{8}[-]?(?:[0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}){1})+$" + ) + }, + serializedName: "objectId", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const FhirServiceAcrConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FhirServiceAcrConfiguration", + modelProperties: { + loginServers: { + serializedName: "loginServers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const FhirServiceAuthenticationConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FhirServiceAuthenticationConfiguration", + modelProperties: { + authority: { + serializedName: "authority", + type: { + name: "String" + } + }, + audience: { + serializedName: "audience", + type: { + name: "String" + } + }, + smartProxyEnabled: { + serializedName: "smartProxyEnabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const FhirServiceCorsConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FhirServiceCorsConfiguration", + modelProperties: { + origins: { + serializedName: "origins", + type: { + name: "Sequence", + element: { + constraints: { + Pattern: new RegExp( + "^(?:(?:(?:[hH][tT][tT][pP](?:[sS]|))\\:\\/\\/(?:[a-zA-Z0-9-]+[.]?)+(?:\\:[0-9]{1,5})?|[*]))$" + ) + }, + type: { + name: "String" + } + } + } + }, + headers: { + serializedName: "headers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + methods: { + serializedName: "methods", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + maxAge: { + constraints: { + InclusiveMaximum: 99999, + InclusiveMinimum: 0 + }, + serializedName: "maxAge", + type: { + name: "Number" + } + }, + allowCredentials: { + serializedName: "allowCredentials", + type: { + name: "Boolean" + } + } + } + } +}; + +export const FhirServiceExportConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FhirServiceExportConfiguration", + modelProperties: { + storageAccountName: { + serializedName: "storageAccountName", + type: { + name: "String" + } + } + } + } +}; + +export const ListOperations: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ListOperations", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationDetail" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDetail", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String" + } + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationResultsDescription: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationResultsDescription", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + readOnly: true, + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...Resource.type.modelProperties, + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + ...Resource.type.modelProperties, + groupId: { + serializedName: "properties.groupId", + readOnly: true, + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "properties.requiredMembers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "properties.requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ServicesDescription: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServicesDescription", + modelProperties: { + ...ServicesResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ServicesProperties" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const LocationBasedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocationBasedResource", + modelProperties: { + ...ResourceCore.type.modelProperties, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const TaggedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TaggedResource", + modelProperties: { + ...ResourceTags.type.modelProperties, + ...LocationBasedResource.type.modelProperties + } + } +}; + +export const WorkspacePatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkspacePatchResource", + modelProperties: { + ...ResourceTags.type.modelProperties + } + } +}; + +export const DicomServicePatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DicomServicePatchResource", + modelProperties: { + ...ResourceTags.type.modelProperties + } + } +}; + +export const IotConnectorPatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotConnectorPatchResource", + modelProperties: { + ...ResourceTags.type.modelProperties, + ...ServiceManagedIdentity.type.modelProperties + } + } +}; + +export const FhirServicePatchResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FhirServicePatchResource", + modelProperties: { + ...ResourceTags.type.modelProperties, + ...ServiceManagedIdentity.type.modelProperties + } + } +}; + +export const IotConnector: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotConnector", + modelProperties: { + ...TaggedResource.type.modelProperties, + ...ServiceManagedIdentity.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + ingestionEndpointConfiguration: { + serializedName: "properties.ingestionEndpointConfiguration", + type: { + name: "Composite", + className: "IotEventHubIngestionEndpointConfiguration" + } + }, + deviceMapping: { + serializedName: "properties.deviceMapping", + type: { + name: "Composite", + className: "IotMappingProperties" + } + } + } + } +}; + +export const FhirService: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FhirService", + modelProperties: { + ...TaggedResource.type.modelProperties, + ...ServiceManagedIdentity.type.modelProperties, + kind: { + serializedName: "kind", + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + accessPolicies: { + serializedName: "properties.accessPolicies", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FhirServiceAccessPolicyEntry" + } + } + } + }, + acrConfiguration: { + serializedName: "properties.acrConfiguration", + type: { + name: "Composite", + className: "FhirServiceAcrConfiguration" + } + }, + authenticationConfiguration: { + serializedName: "properties.authenticationConfiguration", + type: { + name: "Composite", + className: "FhirServiceAuthenticationConfiguration" + } + }, + corsConfiguration: { + serializedName: "properties.corsConfiguration", + type: { + name: "Composite", + className: "FhirServiceCorsConfiguration" + } + }, + exportConfiguration: { + serializedName: "properties.exportConfiguration", + type: { + name: "Composite", + className: "FhirServiceExportConfiguration" + } + } + } + } +}; + +export const IotFhirDestinationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotFhirDestinationProperties", + modelProperties: { + ...IotDestinationProperties.type.modelProperties, + resourceIdentityResolutionType: { + serializedName: "resourceIdentityResolutionType", + required: true, + type: { + name: "String" + } + }, + fhirServiceResourceId: { + serializedName: "fhirServiceResourceId", + required: true, + type: { + name: "String" + } + }, + fhirMapping: { + serializedName: "fhirMapping", + type: { + name: "Composite", + className: "IotMappingProperties" + } + } + } + } +}; + +export const PrivateEndpointConnectionDescription: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionDescription", + modelProperties: { + ...PrivateEndpointConnection.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const PrivateLinkResourceDescription: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceDescription", + modelProperties: { + ...PrivateLinkResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const Workspace: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Workspace", + modelProperties: { + ...TaggedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "WorkspaceProperties" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const DicomService: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DicomService", + modelProperties: { + ...TaggedResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + authenticationConfiguration: { + serializedName: "properties.authenticationConfiguration", + type: { + name: "Composite", + className: "DicomServiceAuthenticationConfiguration" + } + }, + serviceUrl: { + serializedName: "properties.serviceUrl", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const IotFhirDestination: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotFhirDestination", + modelProperties: { + ...LocationBasedResource.type.modelProperties, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + resourceIdentityResolutionType: { + serializedName: "properties.resourceIdentityResolutionType", + required: true, + type: { + name: "String" + } + }, + fhirServiceResourceId: { + serializedName: "properties.fhirServiceResourceId", + required: true, + type: { + name: "String" + } + }, + fhirMapping: { + serializedName: "properties.fhirMapping", + type: { + name: "Composite", + className: "IotMappingProperties" } } } diff --git a/sdk/healthcareapis/arm-healthcareapis/src/models/operationResultsMappers.ts b/sdk/healthcareapis/arm-healthcareapis/src/models/operationResultsMappers.ts deleted file mode 100644 index dbd5e7895407..000000000000 --- a/sdk/healthcareapis/arm-healthcareapis/src/models/operationResultsMappers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorDetails, - ErrorDetailsInternal, - OperationResultsDescription -} from "../models/mappers"; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/models/operationsMappers.ts b/sdk/healthcareapis/arm-healthcareapis/src/models/operationsMappers.ts deleted file mode 100644 index dad157b4e8d6..000000000000 --- a/sdk/healthcareapis/arm-healthcareapis/src/models/operationsMappers.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - ErrorDetails, - ErrorDetailsInternal, - Operation, - OperationDisplay, - OperationListResult -} from "../models/mappers"; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/models/parameters.ts b/sdk/healthcareapis/arm-healthcareapis/src/models/parameters.ts index f4873eee85e3..e61b86bdb34c 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/models/parameters.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/models/parameters.ts @@ -1,120 +1,312 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + ServicesDescription as ServicesDescriptionMapper, + ServicesPatchDescription as ServicesPatchDescriptionMapper, + CheckNameAvailabilityParameters as CheckNameAvailabilityParametersMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + Workspace as WorkspaceMapper, + WorkspacePatchResource as WorkspacePatchResourceMapper, + DicomService as DicomServiceMapper, + DicomServicePatchResource as DicomServicePatchResourceMapper, + IotConnector as IotConnectorMapper, + IotConnectorPatchResource as IotConnectorPatchResourceMapper, + IotFhirDestination as IotFhirDestinationMapper, + FhirService as FhirServiceMapper, + FhirServicePatchResource as FhirServicePatchResourceMapper +} from "../models/mappers"; -export const acceptLanguage: msRest.OperationParameter = { - parameterPath: "acceptLanguage", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - serializedName: "accept-language", - defaultValue: 'en-US', + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", type: { name: "String" } } }; -export const apiVersion: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", + +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { + serializedName: "$host", required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-06-01-preview", + isConstant: true, serializedName: "api-version", type: { name: "String" } } }; -export const groupName: msRest.OperationURLParameter = { - parameterPath: "groupName", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + serializedName: "subscriptionId", required: true, - serializedName: "groupName", type: { name: "String" } } }; -export const locationName: msRest.OperationURLParameter = { - parameterPath: "locationName", + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", mapper: { + constraints: { + Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"), + MaxLength: 90, + MinLength: 1 + }, + serializedName: "resourceGroupName", required: true, - serializedName: "locationName", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const resourceName: OperationURLParameter = { + parameterPath: "resourceName", mapper: { + constraints: { + MaxLength: 24, + MinLength: 3 + }, + serializedName: "resourceName", required: true, + type: { + name: "String" + } + } +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const serviceDescription: OperationParameter = { + parameterPath: "serviceDescription", + mapper: ServicesDescriptionMapper +}; + +export const servicePatchDescription: OperationParameter = { + parameterPath: "servicePatchDescription", + mapper: ServicesPatchDescriptionMapper +}; + +export const checkNameAvailabilityInputs: OperationParameter = { + parameterPath: "checkNameAvailabilityInputs", + mapper: CheckNameAvailabilityParametersMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { serializedName: "nextLink", + required: true, type: { name: "String" } }, skipEncoding: true }; -export const operationResultId: msRest.OperationURLParameter = { - parameterPath: "operationResultId", + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", mapper: { + serializedName: "privateEndpointConnectionName", required: true, - serializedName: "operationResultId", type: { name: "String" } } }; -export const privateEndpointConnectionName: msRest.OperationURLParameter = { - parameterPath: "privateEndpointConnectionName", + +export const properties: OperationParameter = { + parameterPath: "properties", + mapper: PrivateEndpointConnectionMapper +}; + +export const groupName: OperationURLParameter = { + parameterPath: "groupName", mapper: { + serializedName: "groupName", required: true, - serializedName: "privateEndpointConnectionName", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { - parameterPath: "resourceGroupName", + +export const workspaceName: OperationURLParameter = { + parameterPath: "workspaceName", mapper: { + constraints: { + MaxLength: 24, + MinLength: 3 + }, + serializedName: "workspaceName", required: true, - serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; + +export const workspace: OperationParameter = { + parameterPath: "workspace", + mapper: WorkspaceMapper +}; + +export const workspacePatchResource: OperationParameter = { + parameterPath: "workspacePatchResource", + mapper: WorkspacePatchResourceMapper +}; + +export const dicomServiceName: OperationURLParameter = { + parameterPath: "dicomServiceName", + mapper: { constraints: { - MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MaxLength: 24, + MinLength: 3 }, + serializedName: "dicomServiceName", + required: true, type: { name: "String" } } }; -export const resourceName: msRest.OperationURLParameter = { - parameterPath: "resourceName", + +export const dicomservice: OperationParameter = { + parameterPath: "dicomservice", + mapper: DicomServiceMapper +}; + +export const dicomservicePatchResource: OperationParameter = { + parameterPath: "dicomservicePatchResource", + mapper: DicomServicePatchResourceMapper +}; + +export const iotConnectorName: OperationURLParameter = { + parameterPath: "iotConnectorName", mapper: { + constraints: { + MaxLength: 24, + MinLength: 3 + }, + serializedName: "iotConnectorName", required: true, - serializedName: "resourceName", + type: { + name: "String" + } + } +}; + +export const iotConnector: OperationParameter = { + parameterPath: "iotConnector", + mapper: IotConnectorMapper +}; + +export const iotConnectorPatchResource: OperationParameter = { + parameterPath: "iotConnectorPatchResource", + mapper: IotConnectorPatchResourceMapper +}; + +export const fhirDestinationName: OperationURLParameter = { + parameterPath: "fhirDestinationName", + mapper: { constraints: { MaxLength: 24, MinLength: 3 }, + serializedName: "fhirDestinationName", + required: true, type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const iotFhirDestination: OperationParameter = { + parameterPath: "iotFhirDestination", + mapper: IotFhirDestinationMapper +}; + +export const fhirServiceName: OperationURLParameter = { + parameterPath: "fhirServiceName", mapper: { + constraints: { + MaxLength: 24, + MinLength: 3 + }, + serializedName: "fhirServiceName", + required: true, + type: { + name: "String" + } + } +}; + +export const fhirservice: OperationParameter = { + parameterPath: "fhirservice", + mapper: FhirServiceMapper +}; + +export const fhirservicePatchResource: OperationParameter = { + parameterPath: "fhirservicePatchResource", + mapper: FhirServicePatchResourceMapper +}; + +export const locationName: OperationURLParameter = { + parameterPath: "locationName", + mapper: { + serializedName: "locationName", + required: true, + type: { + name: "String" + } + } +}; + +export const operationResultId: OperationURLParameter = { + parameterPath: "operationResultId", + mapper: { + serializedName: "operationResultId", required: true, - serializedName: "subscriptionId", type: { name: "String" } diff --git a/sdk/healthcareapis/arm-healthcareapis/src/models/privateEndpointConnectionsMappers.ts b/sdk/healthcareapis/arm-healthcareapis/src/models/privateEndpointConnectionsMappers.ts deleted file mode 100644 index f87561bab5c5..000000000000 --- a/sdk/healthcareapis/arm-healthcareapis/src/models/privateEndpointConnectionsMappers.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AzureEntityResource, - BaseResource, - ErrorDetails, - ErrorDetailsInternal, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateEndpointConnectionListResult, - PrivateLinkResource, - PrivateLinkServiceConnectionState, - ProxyResource, - Resource, - ServiceAccessPolicyEntry, - ServiceAuthenticationConfigurationInfo, - ServiceCorsConfigurationInfo, - ServiceCosmosDbConfigurationInfo, - ServiceExportConfigurationInfo, - ServicesDescription, - ServicesProperties, - ServicesResource, - ServicesResourceIdentity, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/models/privateLinkResourcesMappers.ts b/sdk/healthcareapis/arm-healthcareapis/src/models/privateLinkResourcesMappers.ts deleted file mode 100644 index 704670297f75..000000000000 --- a/sdk/healthcareapis/arm-healthcareapis/src/models/privateLinkResourcesMappers.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AzureEntityResource, - BaseResource, - ErrorDetails, - ErrorDetailsInternal, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateLinkResource, - PrivateLinkResourceListResult, - PrivateLinkServiceConnectionState, - ProxyResource, - Resource, - ServiceAccessPolicyEntry, - ServiceAuthenticationConfigurationInfo, - ServiceCorsConfigurationInfo, - ServiceCosmosDbConfigurationInfo, - ServiceExportConfigurationInfo, - ServicesDescription, - ServicesProperties, - ServicesResource, - ServicesResourceIdentity, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/models/servicesMappers.ts b/sdk/healthcareapis/arm-healthcareapis/src/models/servicesMappers.ts deleted file mode 100644 index 0de63e86f6f6..000000000000 --- a/sdk/healthcareapis/arm-healthcareapis/src/models/servicesMappers.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export { - AzureEntityResource, - BaseResource, - CheckNameAvailabilityParameters, - ErrorDetails, - ErrorDetailsInternal, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateLinkResource, - PrivateLinkServiceConnectionState, - ProxyResource, - Resource, - ServiceAccessPolicyEntry, - ServiceAuthenticationConfigurationInfo, - ServiceCorsConfigurationInfo, - ServiceCosmosDbConfigurationInfo, - ServiceExportConfigurationInfo, - ServicesDescription, - ServicesDescriptionListResult, - ServicesNameAvailabilityInfo, - ServicesPatchDescription, - ServicesProperties, - ServicesResource, - ServicesResourceIdentity, - TrackedResource -} from "../models/mappers"; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/dicomServices.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/dicomServices.ts new file mode 100644 index 000000000000..4774759caf89 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/dicomServices.ts @@ -0,0 +1,620 @@ +/* + * 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 { DicomServices } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HealthcareApisManagementClient } from "../healthcareApisManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + DicomService, + DicomServicesListByWorkspaceNextOptionalParams, + DicomServicesListByWorkspaceOptionalParams, + DicomServicesListByWorkspaceResponse, + DicomServicesGetOptionalParams, + DicomServicesGetResponse, + DicomServicesCreateOrUpdateOptionalParams, + DicomServicesCreateOrUpdateResponse, + DicomServicePatchResource, + DicomServicesUpdateOptionalParams, + DicomServicesUpdateResponse, + DicomServicesDeleteOptionalParams, + DicomServicesListByWorkspaceNextResponse +} from "../models"; + +/// +/** Class containing DicomServices operations. */ +export class DicomServicesImpl implements DicomServices { + private readonly client: HealthcareApisManagementClient; + + /** + * Initialize a new instance of the class DicomServices class. + * @param client Reference to the service client + */ + constructor(client: HealthcareApisManagementClient) { + this.client = client; + } + + /** + * Lists all DICOM Services for the given workspace + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + public listByWorkspace( + resourceGroupName: string, + workspaceName: string, + options?: DicomServicesListByWorkspaceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByWorkspacePagingAll( + resourceGroupName, + workspaceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByWorkspacePagingPage( + resourceGroupName, + workspaceName, + options + ); + } + }; + } + + private async *listByWorkspacePagingPage( + resourceGroupName: string, + workspaceName: string, + options?: DicomServicesListByWorkspaceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByWorkspaceNext( + resourceGroupName, + workspaceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByWorkspacePagingAll( + resourceGroupName: string, + workspaceName: string, + options?: DicomServicesListByWorkspaceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByWorkspacePagingPage( + resourceGroupName, + workspaceName, + options + )) { + yield* page; + } + } + + /** + * Lists all DICOM Services for the given workspace + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + private _listByWorkspace( + resourceGroupName: string, + workspaceName: string, + options?: DicomServicesListByWorkspaceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, options }, + listByWorkspaceOperationSpec + ); + } + + /** + * Gets the properties of the specified DICOM Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + dicomServiceName: string, + options?: DicomServicesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, dicomServiceName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + workspaceName: string, + dicomServiceName: string, + dicomservice: DicomService, + options?: DicomServicesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DicomServicesCreateOrUpdateResponse + > + > { + 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, + workspaceName, + dicomServiceName, + dicomservice, + options + }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + dicomServiceName: string, + dicomservice: DicomService, + options?: DicomServicesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + workspaceName, + dicomServiceName, + dicomservice, + options + ); + return poller.pollUntilDone(); + } + + /** + * Patch DICOM Service details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + dicomServiceName: string, + workspaceName: string, + dicomservicePatchResource: DicomServicePatchResource, + options?: DicomServicesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DicomServicesUpdateResponse + > + > { + 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, + dicomServiceName, + workspaceName, + dicomservicePatchResource, + options + }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Patch DICOM Service details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + dicomServiceName: string, + workspaceName: string, + dicomservicePatchResource: DicomServicePatchResource, + options?: DicomServicesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + dicomServiceName, + workspaceName, + dicomservicePatchResource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a DICOM Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + dicomServiceName: string, + workspaceName: string, + options?: DicomServicesDeleteOptionalParams + ): Promise, void>> { + 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, dicomServiceName, workspaceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a DICOM Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + dicomServiceName: string, + workspaceName: string, + options?: DicomServicesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + dicomServiceName, + workspaceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByWorkspaceNext + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param nextLink The nextLink from the previous successful call to the ListByWorkspace method. + * @param options The options parameters. + */ + private _listByWorkspaceNext( + resourceGroupName: string, + workspaceName: string, + nextLink: string, + options?: DicomServicesListByWorkspaceNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, nextLink, options }, + listByWorkspaceNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByWorkspaceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DicomServiceCollection + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DicomService + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.dicomServiceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DicomService + }, + 201: { + bodyMapper: Mappers.DicomService + }, + 202: { + bodyMapper: Mappers.DicomService + }, + 204: { + bodyMapper: Mappers.DicomService + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.dicomservice, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.dicomServiceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DicomService + }, + 201: { + bodyMapper: Mappers.DicomService + }, + 202: { + bodyMapper: Mappers.DicomService + }, + 204: { + bodyMapper: Mappers.DicomService + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.dicomservicePatchResource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.dicomServiceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.dicomServiceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DicomServiceCollection + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/fhirDestinations.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/fhirDestinations.ts new file mode 100644 index 000000000000..9283c62aaa06 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/fhirDestinations.ts @@ -0,0 +1,204 @@ +/* + * 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 { FhirDestinations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HealthcareApisManagementClient } from "../healthcareApisManagementClient"; +import { + IotFhirDestination, + FhirDestinationsListByIotConnectorNextOptionalParams, + FhirDestinationsListByIotConnectorOptionalParams, + FhirDestinationsListByIotConnectorResponse, + FhirDestinationsListByIotConnectorNextResponse +} from "../models"; + +/// +/** Class containing FhirDestinations operations. */ +export class FhirDestinationsImpl implements FhirDestinations { + private readonly client: HealthcareApisManagementClient; + + /** + * Initialize a new instance of the class FhirDestinations class. + * @param client Reference to the service client + */ + constructor(client: HealthcareApisManagementClient) { + this.client = client; + } + + /** + * Lists all FHIR destinations for the given IoT Connector + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param options The options parameters. + */ + public listByIotConnector( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + options?: FhirDestinationsListByIotConnectorOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByIotConnectorPagingAll( + resourceGroupName, + workspaceName, + iotConnectorName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByIotConnectorPagingPage( + resourceGroupName, + workspaceName, + iotConnectorName, + options + ); + } + }; + } + + private async *listByIotConnectorPagingPage( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + options?: FhirDestinationsListByIotConnectorOptionalParams + ): AsyncIterableIterator { + let result = await this._listByIotConnector( + resourceGroupName, + workspaceName, + iotConnectorName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByIotConnectorNext( + resourceGroupName, + workspaceName, + iotConnectorName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByIotConnectorPagingAll( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + options?: FhirDestinationsListByIotConnectorOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByIotConnectorPagingPage( + resourceGroupName, + workspaceName, + iotConnectorName, + options + )) { + yield* page; + } + } + + /** + * Lists all FHIR destinations for the given IoT Connector + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param options The options parameters. + */ + private _listByIotConnector( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + options?: FhirDestinationsListByIotConnectorOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, iotConnectorName, options }, + listByIotConnectorOperationSpec + ); + } + + /** + * ListByIotConnectorNext + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param nextLink The nextLink from the previous successful call to the ListByIotConnector method. + * @param options The options parameters. + */ + private _listByIotConnectorNext( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + nextLink: string, + options?: FhirDestinationsListByIotConnectorNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, iotConnectorName, nextLink, options }, + listByIotConnectorNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByIotConnectorOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IotFhirDestinationCollection + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.iotConnectorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByIotConnectorNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IotFhirDestinationCollection + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.workspaceName, + Parameters.iotConnectorName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/fhirServices.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/fhirServices.ts new file mode 100644 index 000000000000..152efc9769a9 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/fhirServices.ts @@ -0,0 +1,620 @@ +/* + * 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 { FhirServices } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HealthcareApisManagementClient } from "../healthcareApisManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + FhirService, + FhirServicesListByWorkspaceNextOptionalParams, + FhirServicesListByWorkspaceOptionalParams, + FhirServicesListByWorkspaceResponse, + FhirServicesGetOptionalParams, + FhirServicesGetResponse, + FhirServicesCreateOrUpdateOptionalParams, + FhirServicesCreateOrUpdateResponse, + FhirServicePatchResource, + FhirServicesUpdateOptionalParams, + FhirServicesUpdateResponse, + FhirServicesDeleteOptionalParams, + FhirServicesListByWorkspaceNextResponse +} from "../models"; + +/// +/** Class containing FhirServices operations. */ +export class FhirServicesImpl implements FhirServices { + private readonly client: HealthcareApisManagementClient; + + /** + * Initialize a new instance of the class FhirServices class. + * @param client Reference to the service client + */ + constructor(client: HealthcareApisManagementClient) { + this.client = client; + } + + /** + * Lists all FHIR Services for the given workspace + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + public listByWorkspace( + resourceGroupName: string, + workspaceName: string, + options?: FhirServicesListByWorkspaceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByWorkspacePagingAll( + resourceGroupName, + workspaceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByWorkspacePagingPage( + resourceGroupName, + workspaceName, + options + ); + } + }; + } + + private async *listByWorkspacePagingPage( + resourceGroupName: string, + workspaceName: string, + options?: FhirServicesListByWorkspaceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByWorkspaceNext( + resourceGroupName, + workspaceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByWorkspacePagingAll( + resourceGroupName: string, + workspaceName: string, + options?: FhirServicesListByWorkspaceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByWorkspacePagingPage( + resourceGroupName, + workspaceName, + options + )) { + yield* page; + } + } + + /** + * Lists all FHIR Services for the given workspace + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + private _listByWorkspace( + resourceGroupName: string, + workspaceName: string, + options?: FhirServicesListByWorkspaceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, options }, + listByWorkspaceOperationSpec + ); + } + + /** + * Gets the properties of the specified FHIR Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + fhirServiceName: string, + options?: FhirServicesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, fhirServiceName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + workspaceName: string, + fhirServiceName: string, + fhirservice: FhirService, + options?: FhirServicesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FhirServicesCreateOrUpdateResponse + > + > { + 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, + workspaceName, + fhirServiceName, + fhirservice, + options + }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + fhirServiceName: string, + fhirservice: FhirService, + options?: FhirServicesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + workspaceName, + fhirServiceName, + fhirservice, + options + ); + return poller.pollUntilDone(); + } + + /** + * Patch FHIR Service details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + fhirServiceName: string, + workspaceName: string, + fhirservicePatchResource: FhirServicePatchResource, + options?: FhirServicesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FhirServicesUpdateResponse + > + > { + 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, + fhirServiceName, + workspaceName, + fhirservicePatchResource, + options + }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Patch FHIR Service details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + fhirServiceName: string, + workspaceName: string, + fhirservicePatchResource: FhirServicePatchResource, + options?: FhirServicesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + fhirServiceName, + workspaceName, + fhirservicePatchResource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a FHIR Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + fhirServiceName: string, + workspaceName: string, + options?: FhirServicesDeleteOptionalParams + ): Promise, void>> { + 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, fhirServiceName, workspaceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a FHIR Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + fhirServiceName: string, + workspaceName: string, + options?: FhirServicesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + fhirServiceName, + workspaceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByWorkspaceNext + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param nextLink The nextLink from the previous successful call to the ListByWorkspace method. + * @param options The options parameters. + */ + private _listByWorkspaceNext( + resourceGroupName: string, + workspaceName: string, + nextLink: string, + options?: FhirServicesListByWorkspaceNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, nextLink, options }, + listByWorkspaceNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByWorkspaceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FhirServiceCollection + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FhirService + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.fhirServiceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.FhirService + }, + 201: { + bodyMapper: Mappers.FhirService + }, + 202: { + bodyMapper: Mappers.FhirService + }, + 204: { + bodyMapper: Mappers.FhirService + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.fhirservice, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.fhirServiceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.FhirService + }, + 201: { + bodyMapper: Mappers.FhirService + }, + 202: { + bodyMapper: Mappers.FhirService + }, + 204: { + bodyMapper: Mappers.FhirService + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.fhirservicePatchResource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.fhirServiceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.fhirServiceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FhirServiceCollection + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/index.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/index.ts index 0e8ba668f2c1..e5c0e99e7d61 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/operations/index.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/index.ts @@ -1,15 +1,19 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export * from "./services"; -export * from "./operations"; -export * from "./operationResults"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; +export * from "./workspaces"; +export * from "./dicomServices"; +export * from "./iotConnectors"; +export * from "./fhirDestinations"; +export * from "./iotConnectorFhirDestination"; +export * from "./fhirServices"; +export * from "./operations"; +export * from "./operationResults"; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/iotConnectorFhirDestination.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/iotConnectorFhirDestination.ts new file mode 100644 index 000000000000..11f5ded31d9d --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/iotConnectorFhirDestination.ts @@ -0,0 +1,356 @@ +/* + * 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 { IotConnectorFhirDestination } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HealthcareApisManagementClient } from "../healthcareApisManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + IotConnectorFhirDestinationGetOptionalParams, + IotConnectorFhirDestinationGetResponse, + IotFhirDestination, + IotConnectorFhirDestinationCreateOrUpdateOptionalParams, + IotConnectorFhirDestinationCreateOrUpdateResponse, + IotConnectorFhirDestinationDeleteOptionalParams +} from "../models"; + +/** Class containing IotConnectorFhirDestination operations. */ +export class IotConnectorFhirDestinationImpl + implements IotConnectorFhirDestination { + private readonly client: HealthcareApisManagementClient; + + /** + * Initialize a new instance of the class IotConnectorFhirDestination class. + * @param client Reference to the service client + */ + constructor(client: HealthcareApisManagementClient) { + this.client = client; + } + + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + fhirDestinationName: string, + options?: IotConnectorFhirDestinationGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + iotConnectorName, + fhirDestinationName, + options + }, + getOperationSpec + ); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination + * resource. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + fhirDestinationName: string, + iotFhirDestination: IotFhirDestination, + options?: IotConnectorFhirDestinationCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotConnectorFhirDestinationCreateOrUpdateResponse + > + > { + 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, + workspaceName, + iotConnectorName, + fhirDestinationName, + iotFhirDestination, + options + }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination + * resource. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + fhirDestinationName: string, + iotFhirDestination: IotFhirDestination, + options?: IotConnectorFhirDestinationCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + workspaceName, + iotConnectorName, + fhirDestinationName, + iotFhirDestination, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an IoT Connector FHIR destination. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + fhirDestinationName: string, + options?: IotConnectorFhirDestinationDeleteOptionalParams + ): Promise, void>> { + 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, + workspaceName, + iotConnectorName, + fhirDestinationName, + options + }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes an IoT Connector FHIR destination. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + fhirDestinationName: string, + options?: IotConnectorFhirDestinationDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + workspaceName, + iotConnectorName, + fhirDestinationName, + options + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IotFhirDestination + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.iotConnectorName, + Parameters.fhirDestinationName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.IotFhirDestination + }, + 201: { + bodyMapper: Mappers.IotFhirDestination + }, + 202: { + bodyMapper: Mappers.IotFhirDestination + }, + 204: { + bodyMapper: Mappers.IotFhirDestination + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.iotFhirDestination, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.iotConnectorName, + Parameters.fhirDestinationName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.iotConnectorName, + Parameters.fhirDestinationName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/iotConnectors.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/iotConnectors.ts new file mode 100644 index 000000000000..95c368aa3ae0 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/iotConnectors.ts @@ -0,0 +1,620 @@ +/* + * 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 { IotConnectors } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HealthcareApisManagementClient } from "../healthcareApisManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + IotConnector, + IotConnectorsListByWorkspaceNextOptionalParams, + IotConnectorsListByWorkspaceOptionalParams, + IotConnectorsListByWorkspaceResponse, + IotConnectorsGetOptionalParams, + IotConnectorsGetResponse, + IotConnectorsCreateOrUpdateOptionalParams, + IotConnectorsCreateOrUpdateResponse, + IotConnectorPatchResource, + IotConnectorsUpdateOptionalParams, + IotConnectorsUpdateResponse, + IotConnectorsDeleteOptionalParams, + IotConnectorsListByWorkspaceNextResponse +} from "../models"; + +/// +/** Class containing IotConnectors operations. */ +export class IotConnectorsImpl implements IotConnectors { + private readonly client: HealthcareApisManagementClient; + + /** + * Initialize a new instance of the class IotConnectors class. + * @param client Reference to the service client + */ + constructor(client: HealthcareApisManagementClient) { + this.client = client; + } + + /** + * Lists all IoT Connectors for the given workspace + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + public listByWorkspace( + resourceGroupName: string, + workspaceName: string, + options?: IotConnectorsListByWorkspaceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByWorkspacePagingAll( + resourceGroupName, + workspaceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByWorkspacePagingPage( + resourceGroupName, + workspaceName, + options + ); + } + }; + } + + private async *listByWorkspacePagingPage( + resourceGroupName: string, + workspaceName: string, + options?: IotConnectorsListByWorkspaceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByWorkspace( + resourceGroupName, + workspaceName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByWorkspaceNext( + resourceGroupName, + workspaceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByWorkspacePagingAll( + resourceGroupName: string, + workspaceName: string, + options?: IotConnectorsListByWorkspaceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByWorkspacePagingPage( + resourceGroupName, + workspaceName, + options + )) { + yield* page; + } + } + + /** + * Lists all IoT Connectors for the given workspace + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + private _listByWorkspace( + resourceGroupName: string, + workspaceName: string, + options?: IotConnectorsListByWorkspaceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, options }, + listByWorkspaceOperationSpec + ); + } + + /** + * Gets the properties of the specified IoT Connector. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + options?: IotConnectorsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, iotConnectorName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + iotConnector: IotConnector, + options?: IotConnectorsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotConnectorsCreateOrUpdateResponse + > + > { + 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, + workspaceName, + iotConnectorName, + iotConnector, + options + }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + iotConnector: IotConnector, + options?: IotConnectorsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + workspaceName, + iotConnectorName, + iotConnector, + options + ); + return poller.pollUntilDone(); + } + + /** + * Patch an IoT Connector. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + iotConnectorName: string, + workspaceName: string, + iotConnectorPatchResource: IotConnectorPatchResource, + options?: IotConnectorsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotConnectorsUpdateResponse + > + > { + 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, + iotConnectorName, + workspaceName, + iotConnectorPatchResource, + options + }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Patch an IoT Connector. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + iotConnectorName: string, + workspaceName: string, + iotConnectorPatchResource: IotConnectorPatchResource, + options?: IotConnectorsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + iotConnectorName, + workspaceName, + iotConnectorPatchResource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an IoT Connector. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + iotConnectorName: string, + workspaceName: string, + options?: IotConnectorsDeleteOptionalParams + ): Promise, void>> { + 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, iotConnectorName, workspaceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes an IoT Connector. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + iotConnectorName: string, + workspaceName: string, + options?: IotConnectorsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + iotConnectorName, + workspaceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListByWorkspaceNext + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param nextLink The nextLink from the previous successful call to the ListByWorkspace method. + * @param options The options parameters. + */ + private _listByWorkspaceNext( + resourceGroupName: string, + workspaceName: string, + nextLink: string, + options?: IotConnectorsListByWorkspaceNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, nextLink, options }, + listByWorkspaceNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByWorkspaceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IotConnectorCollection + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IotConnector + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.iotConnectorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.IotConnector + }, + 201: { + bodyMapper: Mappers.IotConnector + }, + 202: { + bodyMapper: Mappers.IotConnector + }, + 204: { + bodyMapper: Mappers.IotConnector + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.iotConnector, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.iotConnectorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.IotConnector + }, + 201: { + bodyMapper: Mappers.IotConnector + }, + 202: { + bodyMapper: Mappers.IotConnector + }, + 204: { + bodyMapper: Mappers.IotConnector + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.iotConnectorPatchResource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.iotConnectorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.iotConnectorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.IotConnectorCollection + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/operationResults.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/operationResults.ts index 8e3c2e4a5ada..1625e8d1c479 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/operations/operationResults.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/operationResults.ts @@ -1,28 +1,30 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationResultsMappers"; +import { OperationResults } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthcareApisManagementClientContext } from "../healthcareApisManagementClientContext"; +import { HealthcareApisManagementClient } from "../healthcareApisManagementClient"; +import { + OperationResultsGetOptionalParams, + OperationResultsGetResponse +} from "../models"; -/** Class representing a OperationResults. */ -export class OperationResults { - private readonly client: HealthcareApisManagementClientContext; +/** Class containing OperationResults operations. */ +export class OperationResultsImpl implements OperationResults { + private readonly client: HealthcareApisManagementClient; /** - * Create a OperationResults. - * @param {HealthcareApisManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class OperationResults class. + * @param client Reference to the service client */ - constructor(client: HealthcareApisManagementClientContext) { + constructor(client: HealthcareApisManagementClient) { this.client = client; } @@ -30,61 +32,41 @@ export class OperationResults { * Get the operation result for a long running operation. * @param locationName The location of the operation. * @param operationResultId The ID of the operation result to get. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(locationName: string, operationResultId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param locationName The location of the operation. - * @param operationResultId The ID of the operation result to get. - * @param callback The callback - */ - get(locationName: string, operationResultId: string, callback: msRest.ServiceCallback): void; - /** - * @param locationName The location of the operation. - * @param operationResultId The ID of the operation result to get. - * @param options The optional parameters - * @param callback The callback - */ - get(locationName: string, operationResultId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(locationName: string, operationResultId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + locationName: string, + operationResultId: string, + options?: OperationResultsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - locationName, - operationResultId, - options - }, - getOperationSpec, - callback) as Promise; + { locationName, operationResultId, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.locationName, - Parameters.operationResultId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationResultsDescription }, - 404: { - bodyMapper: Mappers.ErrorDetails - }, default: { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.locationName, + Parameters.operationResultId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/operations.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/operations.ts index 385220df48d1..0a00878508d1 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/operations/operations.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/operations.ts @@ -1,123 +1,137 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/operationsMappers"; +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 { HealthcareApisManagementClientContext } from "../healthcareApisManagementClientContext"; +import { HealthcareApisManagementClient } from "../healthcareApisManagementClient"; +import { + OperationDetail, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: HealthcareApisManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: HealthcareApisManagementClient; /** - * Create a Operations. - * @param {HealthcareApisManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: HealthcareApisManagementClientContext) { + constructor(client: HealthcareApisManagementClient) { this.client = client; } /** - * Lists all of the available Healthcare service REST API operations. - * @param [options] The optional parameters - * @returns Promise + * Lists all of the available operations supported by Microsoft Healthcare resource provider. + * @param options The options parameters. */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options + public list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; }, - listOperationSpec, - callback) as Promise; + 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 of the available Healthcare service REST API operations. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * Lists all of the available operations supported by Microsoft Healthcare resource provider. + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: OperationsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { nextLink, options }, + listNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.HealthcareApis/operations", httpMethod: "GET", - path: "providers/Microsoft.HealthcareApis/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.ListOperations }, default: { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.ListOperations }, default: { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/privateEndpointConnections.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/privateEndpointConnections.ts index 315539d3c21c..caab2d3aa6d1 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/operations/privateEndpointConnections.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/privateEndpointConnections.ts @@ -1,29 +1,42 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/privateEndpointConnectionsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthcareApisManagementClientContext } from "../healthcareApisManagementClientContext"; +import { HealthcareApisManagementClient } from "../healthcareApisManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateEndpointConnectionDescription, + PrivateEndpointConnectionsListByServiceOptionalParams, + PrivateEndpointConnectionsListByServiceResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnection, + PrivateEndpointConnectionsCreateOrUpdateOptionalParams, + PrivateEndpointConnectionsCreateOrUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams +} from "../models"; -/** Class representing a PrivateEndpointConnections. */ -export class PrivateEndpointConnections { - private readonly client: HealthcareApisManagementClientContext; +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: HealthcareApisManagementClient; /** - * Create a PrivateEndpointConnections. - * @param {HealthcareApisManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client */ - constructor(client: HealthcareApisManagementClientContext) { + constructor(client: HealthcareApisManagementClient) { this.client = client; } @@ -31,255 +44,402 @@ export class PrivateEndpointConnections { * Lists all private endpoint connections for a service. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByService(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + public listByService( + resourceGroupName: string, + resourceName: string, + options?: PrivateEndpointConnectionsListByServiceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByServicePagingAll( + resourceGroupName, + resourceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByServicePagingPage( + resourceGroupName, + resourceName, + options + ); + } + }; + } + + private async *listByServicePagingPage( + resourceGroupName: string, + resourceName: string, + options?: PrivateEndpointConnectionsListByServiceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByService( + resourceGroupName, + resourceName, + options + ); + yield result.value || []; + } + + private async *listByServicePagingAll( + resourceGroupName: string, + resourceName: string, + options?: PrivateEndpointConnectionsListByServiceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByServicePagingPage( + resourceGroupName, + resourceName, + options + )) { + yield* page; + } + } + /** + * Lists all private endpoint connections for a service. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param callback The callback + * @param options The options parameters. */ - listByService(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + private _listByService( + resourceGroupName: string, + resourceName: string, + options?: PrivateEndpointConnectionsListByServiceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + listByServiceOperationSpec + ); + } + /** + * Gets the specified private endpoint connection associated with the service. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param options The optional parameters - * @param callback The callback + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. */ - listByService(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByService(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, + privateEndpointConnectionName, options }, - listByServiceOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** - * Gets the specified private endpoint connection associated with the service. - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param resourceName The name of the service instance. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param resourceName The name of the service instance. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; - /** + * Update the state of the specified private endpoint connection associated with the service. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param options The optional parameters - * @param callback The callback + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param properties The private endpoint connection properties. + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsCreateOrUpdateResponse + > + > { + 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, resourceName, privateEndpointConnectionName, + properties, options }, - getOperationSpec, - callback) as Promise; + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Update the state of the specified private endpoint connection associated with the service. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource * @param properties The private endpoint connection properties. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - createOrUpdate(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,resourceName,privateEndpointConnectionName,properties,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + resourceName, + privateEndpointConnectionName, + properties, + options + ); + return poller.pollUntilDone(); } /** * Deletes a private endpoint connection. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param [options] The optional parameters - * @returns Promise + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,resourceName,privateEndpointConnectionName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginDelete( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>> { + 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() + } + }; + }; - /** - * Update the state of the specified private endpoint connection associated with the service. - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param resourceName The name of the service instance. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param properties The private endpoint connection properties. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreateOrUpdate(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + const lro = new LroImpl( + sendOperation, { resourceGroupName, resourceName, privateEndpointConnectionName, - properties, options }, - beginCreateOrUpdateOperationSpec, - options); + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Deletes a private endpoint connection. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with - * the Azure resource - * @param [options] The optional parameters - * @returns Promise + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - privateEndpointConnectionName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + resourceName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByServiceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByServiceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult + bodyMapper: Mappers.PrivateEndpointConnectionListResultDescription }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.privateEndpointConnectionName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionDescription }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, Parameters.privateEndpointConnectionName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "properties", - mapper: { - ...Mappers.PrivateEndpointConnection, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.PrivateEndpointConnection + bodyMapper: Mappers.PrivateEndpointConnectionDescription + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnectionDescription + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnectionDescription + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnectionDescription }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + requestBody: Parameters.properties, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName, Parameters.privateEndpointConnectionName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", responses: { 200: {}, + 201: {}, 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/privateLinkResources.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/privateLinkResources.ts index 499a9f923909..dd35c8436b67 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/operations/privateLinkResources.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/privateLinkResources.ts @@ -1,28 +1,32 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as Models from "../models"; -import * as Mappers from "../models/privateLinkResourcesMappers"; +import { PrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthcareApisManagementClientContext } from "../healthcareApisManagementClientContext"; +import { HealthcareApisManagementClient } from "../healthcareApisManagementClient"; +import { + PrivateLinkResourcesListByServiceOptionalParams, + PrivateLinkResourcesListByServiceResponse, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; -/** Class representing a PrivateLinkResources. */ -export class PrivateLinkResources { - private readonly client: HealthcareApisManagementClientContext; +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: HealthcareApisManagementClient; /** - * Create a PrivateLinkResources. - * @param {HealthcareApisManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client */ - constructor(client: HealthcareApisManagementClientContext) { + constructor(client: HealthcareApisManagementClient) { this.client = client; } @@ -30,32 +34,17 @@ export class PrivateLinkResources { * Gets the private link resources that need to be created for a service. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByService(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param resourceName The name of the service instance. - * @param callback The callback - */ - listByService(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param resourceName The name of the service instance. - * @param options The optional parameters - * @param callback The callback - */ - listByService(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByService(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByService( + resourceGroupName: string, + resourceName: string, + options?: PrivateLinkResourcesListByServiceOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - options - }, - listByServiceOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, options }, + listByServiceOperationSpec + ); } /** @@ -63,87 +52,65 @@ export class PrivateLinkResources { * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. * @param groupName The name of the private link resource group. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, groupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param resourceName The name of the service instance. - * @param groupName The name of the private link resource group. - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, groupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param resourceName The name of the service instance. - * @param groupName The name of the private link resource group. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, resourceName: string, groupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, groupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + resourceName: string, + groupName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - resourceName, - groupName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, resourceName, groupName, options }, + getOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByServiceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByServiceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { - bodyMapper: Mappers.PrivateLinkResourceListResult + bodyMapper: Mappers.PrivateLinkResourceListResultDescription }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.resourceName, - Parameters.groupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}/privateLinkResources/{groupName}", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.PrivateLinkResource + bodyMapper: Mappers.PrivateLinkResourceDescription }, default: { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.groupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/services.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/services.ts index b019fdd021ca..eef0bbd69346 100644 --- a/sdk/healthcareapis/arm-healthcareapis/src/operations/services.ts +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/services.ts @@ -1,316 +1,507 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as Models from "../models"; -import * as Mappers from "../models/servicesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Services } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthcareApisManagementClientContext } from "../healthcareApisManagementClientContext"; +import { HealthcareApisManagementClient } from "../healthcareApisManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ServicesDescription, + ServicesListNextOptionalParams, + ServicesListOptionalParams, + ServicesListByResourceGroupNextOptionalParams, + ServicesListByResourceGroupOptionalParams, + ServicesGetOptionalParams, + ServicesGetResponse, + ServicesCreateOrUpdateOptionalParams, + ServicesCreateOrUpdateResponse, + ServicesPatchDescription, + ServicesUpdateOptionalParams, + ServicesUpdateResponse, + ServicesDeleteOptionalParams, + ServicesListResponse, + ServicesListByResourceGroupResponse, + CheckNameAvailabilityParameters, + ServicesCheckNameAvailabilityOptionalParams, + ServicesCheckNameAvailabilityResponse, + ServicesListNextResponse, + ServicesListByResourceGroupNextResponse +} from "../models"; -/** Class representing a Services. */ -export class Services { - private readonly client: HealthcareApisManagementClientContext; +/// +/** Class containing Services operations. */ +export class ServicesImpl implements Services { + private readonly client: HealthcareApisManagementClient; /** - * Create a Services. - * @param {HealthcareApisManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Services class. + * @param client Reference to the service client */ - constructor(client: HealthcareApisManagementClientContext) { + constructor(client: HealthcareApisManagementClient) { this.client = client; } /** - * Get the metadata of a service instance. - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param resourceName The name of the service instance. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param resourceName The name of the service instance. - * @param callback The callback + * Get all the service instances in a subscription. + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + public list( + options?: ServicesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ServicesListOptionalParams + ): 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?: ServicesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + /** + * Get all the service instances in a resource group. * @param resourceGroupName The name of the resource group that contains the service instance. - * @param resourceName The name of the service instance. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { + public listByResourceGroup( + resourceGroupName: string, + options?: ServicesListByResourceGroupOptionalParams + ): 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?: ServicesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( resourceGroupName, - resourceName, + continuationToken, options - }, - getOperationSpec, - callback) as Promise; + ); + continuationToken = result.nextLink; + yield result.value || []; + } } - /** - * Create or update the metadata of a service instance. - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param resourceName The name of the service instance. - * @param serviceDescription The service instance metadata. - * @param [options] The optional parameters - * @returns Promise - */ - createOrUpdate(resourceGroupName: string, resourceName: string, serviceDescription: Models.ServicesDescription, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreateOrUpdate(resourceGroupName,resourceName,serviceDescription,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ServicesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } } /** - * Update the metadata of a service instance. + * Get the metadata of a service instance. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param servicePatchDescription The service instance metadata and security metadata. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update(resourceGroupName: string, resourceName: string, servicePatchDescription: Models.ServicesPatchDescription, options?: msRest.RequestOptionsBase): Promise { - return this.beginUpdate(resourceGroupName,resourceName,servicePatchDescription,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + get( + resourceGroupName: string, + resourceName: string, + options?: ServicesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + getOperationSpec + ); } /** - * Delete a service instance. + * Create or update the metadata of a service instance. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param [options] The optional parameters - * @returns Promise + * @param serviceDescription The service instance metadata. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,resourceName,options) - .then(lroPoller => lroPoller.pollUntilFinished()); - } + async beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + serviceDescription: ServicesDescription, + options?: ServicesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServicesCreateOrUpdateResponse + > + > { + 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() + } + }; + }; - /** - * Get all the service instances in a subscription. - * @param [options] The optional parameters - * @returns Promise - */ - list(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - list(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback - */ - list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - options - }, - listOperationSpec, - callback) as Promise; + const lro = new LroImpl( + sendOperation, + { resourceGroupName, resourceName, serviceDescription, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Get all the service instances in a resource group. - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group that contains the service instance. - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** + * Create or update the metadata of a service instance. * @param resourceGroupName The name of the resource group that contains the service instance. - * @param options The optional parameters - * @param callback The callback + * @param resourceName The name of the service instance. + * @param serviceDescription The service instance metadata. + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + serviceDescription: ServicesDescription, + options?: ServicesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + resourceName, + serviceDescription, + options + ); + return poller.pollUntilDone(); } /** - * Check if a service instance name is available. - * @param checkNameAvailabilityInputs Set the name parameter in the CheckNameAvailabilityParameters - * structure to the name of the service instance to check. - * @param [options] The optional parameters - * @returns Promise - */ - checkNameAvailability(checkNameAvailabilityInputs: Models.CheckNameAvailabilityParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param checkNameAvailabilityInputs Set the name parameter in the CheckNameAvailabilityParameters - * structure to the name of the service instance to check. - * @param callback The callback - */ - checkNameAvailability(checkNameAvailabilityInputs: Models.CheckNameAvailabilityParameters, callback: msRest.ServiceCallback): void; - /** - * @param checkNameAvailabilityInputs Set the name parameter in the CheckNameAvailabilityParameters - * structure to the name of the service instance to check. - * @param options The optional parameters - * @param callback The callback + * Update the metadata of a service instance. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param servicePatchDescription The service instance metadata and security metadata. + * @param options The options parameters. */ - checkNameAvailability(checkNameAvailabilityInputs: Models.CheckNameAvailabilityParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(checkNameAvailabilityInputs: Models.CheckNameAvailabilityParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - checkNameAvailabilityInputs, - options - }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + async beginUpdate( + resourceGroupName: string, + resourceName: string, + servicePatchDescription: ServicesPatchDescription, + options?: ServicesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServicesUpdateResponse + > + > { + 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, resourceName, servicePatchDescription, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Create or update the metadata of a service instance. + * Update the metadata of a service instance. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param serviceDescription The service instance metadata. - * @param [options] The optional parameters - * @returns Promise + * @param servicePatchDescription The service instance metadata and security metadata. + * @param options The options parameters. */ - beginCreateOrUpdate(resourceGroupName: string, resourceName: string, serviceDescription: Models.ServicesDescription, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - serviceDescription, - options - }, - beginCreateOrUpdateOperationSpec, - options); + async beginUpdateAndWait( + resourceGroupName: string, + resourceName: string, + servicePatchDescription: ServicesPatchDescription, + options?: ServicesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + resourceName, + servicePatchDescription, + options + ); + return poller.pollUntilDone(); } /** - * Update the metadata of a service instance. + * Delete a service instance. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param servicePatchDescription The service instance metadata and security metadata. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginUpdate(resourceGroupName: string, resourceName: string, servicePatchDescription: Models.ServicesPatchDescription, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - servicePatchDescription, - options - }, - beginUpdateOperationSpec, - options); + async beginDelete( + resourceGroupName: string, + resourceName: string, + options?: ServicesDeleteOptionalParams + ): Promise, void>> { + 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, resourceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** * Delete a service instance. * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - resourceName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + options?: ServicesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + resourceName, + options + ); + return poller.pollUntilDone(); } /** * Get all the service instances in a subscription. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise - */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * @param options The options parameters. */ - listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _list( + options?: ServicesListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * Get all the service instances in a resource group. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param options The options parameters. */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: ServicesListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listNextOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** - * Get all the service instances in a resource group. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * Check if a service instance name is available. + * @param checkNameAvailabilityInputs Set the name parameter in the CheckNameAvailabilityParameters + * structure to the name of the service instance to check. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + checkNameAvailability( + checkNameAvailabilityInputs: CheckNameAvailabilityParameters, + options?: ServicesCheckNameAvailabilityOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { checkNameAvailabilityInputs, options }, + checkNameAvailabilityOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + private _listNext( + nextLink: string, + options?: ServicesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param options The optional parameters - * @param callback The callback + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. */ - listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ServicesListByResourceGroupNextOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - nextPageLink, - options - }, - listByResourceGroupNextOperationSpec, - callback) as Promise; + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.ServicesDescription @@ -319,187 +510,165 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services", + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", + httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.ServicesDescriptionListResult + bodyMapper: Mappers.ServicesDescription + }, + 201: { + bodyMapper: Mappers.ServicesDescription + }, + 202: { + bodyMapper: Mappers.ServicesDescription + }, + 204: { + bodyMapper: Mappers.ServicesDescription }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services", + requestBody: Parameters.serviceDescription, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.resourceName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.ServicesDescriptionListResult + bodyMapper: Mappers.ServicesDescription + }, + 201: { + bodyMapper: Mappers.ServicesDescription + }, + 202: { + bodyMapper: Mappers.ServicesDescription + }, + 204: { + bodyMapper: Mappers.ServicesDescription }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability", + requestBody: Parameters.servicePatchDescription, + queryParameters: [Parameters.apiVersion], urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName ], - requestBody: { - parameterPath: "checkNameAvailabilityInputs", - mapper: { - ...Mappers.CheckNameAvailabilityParameters, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", + httpMethod: "DELETE", responses: { - 200: { - bodyMapper: Mappers.ServicesNameAvailabilityInfo - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.resourceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "serviceDescription", - mapper: { - ...Mappers.ServicesDescription, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ServicesDescription - }, - 201: { - bodyMapper: Mappers.ServicesDescription + bodyMapper: Mappers.ServicesDescriptionListResult }, default: { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "servicePatchDescription", - mapper: { - ...Mappers.ServicesPatchDescription, - required: true - } - }, +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.ServicesDescription + bodyMapper: Mappers.ServicesDescriptionListResult }, default: { bodyMapper: Mappers.ErrorDetails } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.resourceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName ], + headerParameters: [Parameters.accept], + serializer +}; +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability", + httpMethod: "POST", responses: { - 202: {}, - 204: {}, + 200: { + bodyMapper: Mappers.ServicesNameAvailabilityInfo + }, default: { bodyMapper: Mappers.ErrorDetails } }, + requestBody: Parameters.checkNameAvailabilityInputs, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const listNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ServicesDescriptionListResult @@ -508,19 +677,18 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; - -const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - baseUrl: "https://management.azure.com", +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", - urlParameters: [ - Parameters.nextPageLink - ], - headerParameters: [ - Parameters.acceptLanguage - ], + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ServicesDescriptionListResult @@ -529,5 +697,13 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.ErrorDetails } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operations/workspaces.ts b/sdk/healthcareapis/arm-healthcareapis/src/operations/workspaces.ts new file mode 100644 index 000000000000..561788776530 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operations/workspaces.ts @@ -0,0 +1,674 @@ +/* + * 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 { Workspaces } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HealthcareApisManagementClient } from "../healthcareApisManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + Workspace, + WorkspacesListBySubscriptionNextOptionalParams, + WorkspacesListBySubscriptionOptionalParams, + WorkspacesListByResourceGroupNextOptionalParams, + WorkspacesListByResourceGroupOptionalParams, + WorkspacesListBySubscriptionResponse, + WorkspacesListByResourceGroupResponse, + WorkspacesGetOptionalParams, + WorkspacesGetResponse, + WorkspacesCreateOrUpdateOptionalParams, + WorkspacesCreateOrUpdateResponse, + WorkspacePatchResource, + WorkspacesUpdateOptionalParams, + WorkspacesUpdateResponse, + WorkspacesDeleteOptionalParams, + WorkspacesListBySubscriptionNextResponse, + WorkspacesListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing Workspaces operations. */ +export class WorkspacesImpl implements Workspaces { + private readonly client: HealthcareApisManagementClient; + + /** + * Initialize a new instance of the class Workspaces class. + * @param client Reference to the service client + */ + constructor(client: HealthcareApisManagementClient) { + this.client = client; + } + + /** + * Lists all the available workspaces under the specified subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: WorkspacesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: WorkspacesListBySubscriptionOptionalParams + ): 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?: WorkspacesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all the available workspaces under the specified resource group. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: WorkspacesListByResourceGroupOptionalParams + ): 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?: WorkspacesListByResourceGroupOptionalParams + ): 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?: WorkspacesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Lists all the available workspaces under the specified subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: WorkspacesListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * Lists all the available workspaces under the specified resource group. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: WorkspacesListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets the properties of the specified workspace. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + options?: WorkspacesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, workspaceName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + workspaceName: string, + workspace: Workspace, + options?: WorkspacesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + WorkspacesCreateOrUpdateResponse + > + > { + 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, workspaceName, workspace, options }, + createOrUpdateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Creates or updates a workspace resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + workspace: Workspace, + options?: WorkspacesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + workspaceName, + workspace, + options + ); + return poller.pollUntilDone(); + } + + /** + * Patch workspace details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + workspaceName: string, + workspacePatchResource: WorkspacePatchResource, + options?: WorkspacesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + WorkspacesUpdateResponse + > + > { + 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, workspaceName, workspacePatchResource, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Patch workspace details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + workspacePatchResource: WorkspacePatchResource, + options?: WorkspacesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + workspaceName, + workspacePatchResource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a specified workspace. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + workspaceName: string, + options?: WorkspacesDeleteOptionalParams + ): Promise, void>> { + 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, workspaceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes a specified workspace. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + workspaceName: string, + options?: WorkspacesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + workspaceName, + options + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: WorkspacesListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group that contains the service instance. + * @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?: WorkspacesListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/workspaces", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkspaceList + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkspaceList + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Workspace + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Workspace + }, + 201: { + bodyMapper: Mappers.Workspace + }, + 202: { + bodyMapper: Mappers.Workspace + }, + 204: { + bodyMapper: Mappers.Workspace + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.workspace, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Workspace + }, + 201: { + bodyMapper: Mappers.Workspace + }, + 202: { + bodyMapper: Mappers.Workspace + }, + 204: { + bodyMapper: Mappers.Workspace + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + requestBody: Parameters.workspacePatchResource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkspaceList + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkspaceList + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/dicomServices.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/dicomServices.ts new file mode 100644 index 000000000000..08f12dd77986 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/dicomServices.ts @@ -0,0 +1,147 @@ +/* + * 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 { + DicomService, + DicomServicesListByWorkspaceOptionalParams, + DicomServicesGetOptionalParams, + DicomServicesGetResponse, + DicomServicesCreateOrUpdateOptionalParams, + DicomServicesCreateOrUpdateResponse, + DicomServicePatchResource, + DicomServicesUpdateOptionalParams, + DicomServicesUpdateResponse, + DicomServicesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a DicomServices. */ +export interface DicomServices { + /** + * Lists all DICOM Services for the given workspace + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + listByWorkspace( + resourceGroupName: string, + workspaceName: string, + options?: DicomServicesListByWorkspaceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified DICOM Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + dicomServiceName: string, + options?: DicomServicesGetOptionalParams + ): Promise; + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + workspaceName: string, + dicomServiceName: string, + dicomservice: DicomService, + options?: DicomServicesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DicomServicesCreateOrUpdateResponse + > + >; + /** + * Creates or updates a DICOM Service resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param dicomServiceName The name of DICOM Service resource. + * @param dicomservice The parameters for creating or updating a Dicom Service resource. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + dicomServiceName: string, + dicomservice: DicomService, + options?: DicomServicesCreateOrUpdateOptionalParams + ): Promise; + /** + * Patch DICOM Service details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + dicomServiceName: string, + workspaceName: string, + dicomservicePatchResource: DicomServicePatchResource, + options?: DicomServicesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + DicomServicesUpdateResponse + > + >; + /** + * Patch DICOM Service details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param dicomservicePatchResource The parameters for updating a Dicom Service. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + dicomServiceName: string, + workspaceName: string, + dicomservicePatchResource: DicomServicePatchResource, + options?: DicomServicesUpdateOptionalParams + ): Promise; + /** + * Deletes a DICOM Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + dicomServiceName: string, + workspaceName: string, + options?: DicomServicesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a DICOM Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param dicomServiceName The name of DICOM Service resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + dicomServiceName: string, + workspaceName: string, + options?: DicomServicesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/fhirDestinations.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/fhirDestinations.ts new file mode 100644 index 000000000000..ef831531edf2 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/fhirDestinations.ts @@ -0,0 +1,31 @@ +/* + * 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 { + IotFhirDestination, + FhirDestinationsListByIotConnectorOptionalParams +} from "../models"; + +/// +/** Interface representing a FhirDestinations. */ +export interface FhirDestinations { + /** + * Lists all FHIR destinations for the given IoT Connector + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param options The options parameters. + */ + listByIotConnector( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + options?: FhirDestinationsListByIotConnectorOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/fhirServices.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/fhirServices.ts new file mode 100644 index 000000000000..c186f2b8894a --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/fhirServices.ts @@ -0,0 +1,147 @@ +/* + * 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 { + FhirService, + FhirServicesListByWorkspaceOptionalParams, + FhirServicesGetOptionalParams, + FhirServicesGetResponse, + FhirServicesCreateOrUpdateOptionalParams, + FhirServicesCreateOrUpdateResponse, + FhirServicePatchResource, + FhirServicesUpdateOptionalParams, + FhirServicesUpdateResponse, + FhirServicesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a FhirServices. */ +export interface FhirServices { + /** + * Lists all FHIR Services for the given workspace + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + listByWorkspace( + resourceGroupName: string, + workspaceName: string, + options?: FhirServicesListByWorkspaceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified FHIR Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + fhirServiceName: string, + options?: FhirServicesGetOptionalParams + ): Promise; + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + workspaceName: string, + fhirServiceName: string, + fhirservice: FhirService, + options?: FhirServicesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FhirServicesCreateOrUpdateResponse + > + >; + /** + * Creates or updates a FHIR Service resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param fhirServiceName The name of FHIR Service resource. + * @param fhirservice The parameters for creating or updating a Fhir Service resource. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + fhirServiceName: string, + fhirservice: FhirService, + options?: FhirServicesCreateOrUpdateOptionalParams + ): Promise; + /** + * Patch FHIR Service details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + fhirServiceName: string, + workspaceName: string, + fhirservicePatchResource: FhirServicePatchResource, + options?: FhirServicesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + FhirServicesUpdateResponse + > + >; + /** + * Patch FHIR Service details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param fhirservicePatchResource The parameters for updating a Fhir Service. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + fhirServiceName: string, + workspaceName: string, + fhirservicePatchResource: FhirServicePatchResource, + options?: FhirServicesUpdateOptionalParams + ): Promise; + /** + * Deletes a FHIR Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + fhirServiceName: string, + workspaceName: string, + options?: FhirServicesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a FHIR Service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param fhirServiceName The name of FHIR Service resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + fhirServiceName: string, + workspaceName: string, + options?: FhirServicesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/index.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..e5c0e99e7d61 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/index.ts @@ -0,0 +1,19 @@ +/* + * 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 "./services"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; +export * from "./workspaces"; +export * from "./dicomServices"; +export * from "./iotConnectors"; +export * from "./fhirDestinations"; +export * from "./iotConnectorFhirDestination"; +export * from "./fhirServices"; +export * from "./operations"; +export * from "./operationResults"; diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/iotConnectorFhirDestination.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/iotConnectorFhirDestination.ts new file mode 100644 index 000000000000..5c31da35e2f2 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/iotConnectorFhirDestination.ts @@ -0,0 +1,107 @@ +/* + * 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 { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + IotConnectorFhirDestinationGetOptionalParams, + IotConnectorFhirDestinationGetResponse, + IotFhirDestination, + IotConnectorFhirDestinationCreateOrUpdateOptionalParams, + IotConnectorFhirDestinationCreateOrUpdateResponse, + IotConnectorFhirDestinationDeleteOptionalParams +} from "../models"; + +/** Interface representing a IotConnectorFhirDestination. */ +export interface IotConnectorFhirDestination { + /** + * Gets the properties of the specified Iot Connector FHIR destination. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + fhirDestinationName: string, + options?: IotConnectorFhirDestinationGetOptionalParams + ): Promise; + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination + * resource. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + fhirDestinationName: string, + iotFhirDestination: IotFhirDestination, + options?: IotConnectorFhirDestinationCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotConnectorFhirDestinationCreateOrUpdateResponse + > + >; + /** + * Creates or updates an IoT Connector FHIR destination resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param iotFhirDestination The parameters for creating or updating an IoT Connector FHIR destination + * resource. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + fhirDestinationName: string, + iotFhirDestination: IotFhirDestination, + options?: IotConnectorFhirDestinationCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes an IoT Connector FHIR destination. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + fhirDestinationName: string, + options?: IotConnectorFhirDestinationDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes an IoT Connector FHIR destination. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param fhirDestinationName The name of IoT Connector FHIR destination resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + fhirDestinationName: string, + options?: IotConnectorFhirDestinationDeleteOptionalParams + ): Promise; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/iotConnectors.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/iotConnectors.ts new file mode 100644 index 000000000000..795077e37e01 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/iotConnectors.ts @@ -0,0 +1,147 @@ +/* + * 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 { + IotConnector, + IotConnectorsListByWorkspaceOptionalParams, + IotConnectorsGetOptionalParams, + IotConnectorsGetResponse, + IotConnectorsCreateOrUpdateOptionalParams, + IotConnectorsCreateOrUpdateResponse, + IotConnectorPatchResource, + IotConnectorsUpdateOptionalParams, + IotConnectorsUpdateResponse, + IotConnectorsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a IotConnectors. */ +export interface IotConnectors { + /** + * Lists all IoT Connectors for the given workspace + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + listByWorkspace( + resourceGroupName: string, + workspaceName: string, + options?: IotConnectorsListByWorkspaceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified IoT Connector. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + options?: IotConnectorsGetOptionalParams + ): Promise; + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + iotConnector: IotConnector, + options?: IotConnectorsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotConnectorsCreateOrUpdateResponse + > + >; + /** + * Creates or updates an IoT Connector resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param iotConnectorName The name of IoT Connector resource. + * @param iotConnector The parameters for creating or updating an IoT Connectors resource. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + iotConnectorName: string, + iotConnector: IotConnector, + options?: IotConnectorsCreateOrUpdateOptionalParams + ): Promise; + /** + * Patch an IoT Connector. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + iotConnectorName: string, + workspaceName: string, + iotConnectorPatchResource: IotConnectorPatchResource, + options?: IotConnectorsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + IotConnectorsUpdateResponse + > + >; + /** + * Patch an IoT Connector. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param iotConnectorPatchResource The parameters for updating an IoT Connector. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + iotConnectorName: string, + workspaceName: string, + iotConnectorPatchResource: IotConnectorPatchResource, + options?: IotConnectorsUpdateOptionalParams + ): Promise; + /** + * Deletes an IoT Connector. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + iotConnectorName: string, + workspaceName: string, + options?: IotConnectorsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes an IoT Connector. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param iotConnectorName The name of IoT Connector resource. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + iotConnectorName: string, + workspaceName: string, + options?: IotConnectorsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/operationResults.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/operationResults.ts new file mode 100644 index 000000000000..3af495030afc --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/operationResults.ts @@ -0,0 +1,27 @@ +/* + * 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 { + OperationResultsGetOptionalParams, + OperationResultsGetResponse +} from "../models"; + +/** Interface representing a OperationResults. */ +export interface OperationResults { + /** + * Get the operation result for a long running operation. + * @param locationName The location of the operation. + * @param operationResultId The ID of the operation result to get. + * @param options The options parameters. + */ + get( + locationName: string, + operationResultId: string, + options?: OperationResultsGetOptionalParams + ): Promise; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/operations.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..155485f19679 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/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 { OperationDetail, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available operations supported by Microsoft Healthcare resource provider. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..ad3e5efa7278 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,115 @@ +/* + * 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 { + PrivateEndpointConnectionDescription, + PrivateEndpointConnectionsListByServiceOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnection, + PrivateEndpointConnectionsCreateOrUpdateOptionalParams, + PrivateEndpointConnectionsCreateOrUpdateResponse, + PrivateEndpointConnectionsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * Lists all private endpoint connections for a service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param options The options parameters. + */ + listByService( + resourceGroupName: string, + resourceName: string, + options?: PrivateEndpointConnectionsListByServiceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the specified private endpoint connection associated with the service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; + /** + * Update the state of the specified private endpoint connection associated with the service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param properties The private endpoint connection properties. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsCreateOrUpdateResponse + > + >; + /** + * Update the state of the specified private endpoint connection associated with the service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param properties The private endpoint connection properties. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a private endpoint connection. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a private endpoint connection. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/privateLinkResources.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..a1c944fc1dca --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,42 @@ +/* + * 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 { + PrivateLinkResourcesListByServiceOptionalParams, + PrivateLinkResourcesListByServiceResponse, + PrivateLinkResourcesGetOptionalParams, + PrivateLinkResourcesGetResponse +} from "../models"; + +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param options The options parameters. + */ + listByService( + resourceGroupName: string, + resourceName: string, + options?: PrivateLinkResourcesListByServiceOptionalParams + ): Promise; + /** + * Gets a private link resource that need to be created for a service. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param groupName The name of the private link resource group. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + groupName: string, + options?: PrivateLinkResourcesGetOptionalParams + ): Promise; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/services.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/services.ts new file mode 100644 index 000000000000..f2ca5889449f --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/services.ts @@ -0,0 +1,152 @@ +/* + * 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 { + ServicesDescription, + ServicesListOptionalParams, + ServicesListByResourceGroupOptionalParams, + ServicesGetOptionalParams, + ServicesGetResponse, + ServicesCreateOrUpdateOptionalParams, + ServicesCreateOrUpdateResponse, + ServicesPatchDescription, + ServicesUpdateOptionalParams, + ServicesUpdateResponse, + ServicesDeleteOptionalParams, + CheckNameAvailabilityParameters, + ServicesCheckNameAvailabilityOptionalParams, + ServicesCheckNameAvailabilityResponse +} from "../models"; + +/// +/** Interface representing a Services. */ +export interface Services { + /** + * Get all the service instances in a subscription. + * @param options The options parameters. + */ + list( + options?: ServicesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get all the service instances in a resource group. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ServicesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get the metadata of a service instance. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: ServicesGetOptionalParams + ): Promise; + /** + * Create or update the metadata of a service instance. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceDescription The service instance metadata. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + resourceName: string, + serviceDescription: ServicesDescription, + options?: ServicesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServicesCreateOrUpdateResponse + > + >; + /** + * Create or update the metadata of a service instance. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param serviceDescription The service instance metadata. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + resourceName: string, + serviceDescription: ServicesDescription, + options?: ServicesCreateOrUpdateOptionalParams + ): Promise; + /** + * Update the metadata of a service instance. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param servicePatchDescription The service instance metadata and security metadata. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + resourceName: string, + servicePatchDescription: ServicesPatchDescription, + options?: ServicesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServicesUpdateResponse + > + >; + /** + * Update the metadata of a service instance. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param servicePatchDescription The service instance metadata and security metadata. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + resourceName: string, + servicePatchDescription: ServicesPatchDescription, + options?: ServicesUpdateOptionalParams + ): Promise; + /** + * Delete a service instance. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + resourceName: string, + options?: ServicesDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a service instance. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param resourceName The name of the service instance. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + resourceName: string, + options?: ServicesDeleteOptionalParams + ): Promise; + /** + * Check if a service instance name is available. + * @param checkNameAvailabilityInputs Set the name parameter in the CheckNameAvailabilityParameters + * structure to the name of the service instance to check. + * @param options The options parameters. + */ + checkNameAvailability( + checkNameAvailabilityInputs: CheckNameAvailabilityParameters, + options?: ServicesCheckNameAvailabilityOptionalParams + ): Promise; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/workspaces.ts b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/workspaces.ts new file mode 100644 index 000000000000..21d99bf84579 --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/src/operationsInterfaces/workspaces.ts @@ -0,0 +1,139 @@ +/* + * 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 { + Workspace, + WorkspacesListBySubscriptionOptionalParams, + WorkspacesListByResourceGroupOptionalParams, + WorkspacesGetOptionalParams, + WorkspacesGetResponse, + WorkspacesCreateOrUpdateOptionalParams, + WorkspacesCreateOrUpdateResponse, + WorkspacePatchResource, + WorkspacesUpdateOptionalParams, + WorkspacesUpdateResponse, + WorkspacesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a Workspaces. */ +export interface Workspaces { + /** + * Lists all the available workspaces under the specified subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: WorkspacesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists all the available workspaces under the specified resource group. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: WorkspacesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the properties of the specified workspace. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + workspaceName: string, + options?: WorkspacesGetOptionalParams + ): Promise; + /** + * Creates or updates a workspace resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + workspaceName: string, + workspace: Workspace, + options?: WorkspacesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + WorkspacesCreateOrUpdateResponse + > + >; + /** + * Creates or updates a workspace resource with the specified parameters. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspace The parameters for creating or updating a healthcare workspace. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + workspace: Workspace, + options?: WorkspacesCreateOrUpdateOptionalParams + ): Promise; + /** + * Patch workspace details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + workspaceName: string, + workspacePatchResource: WorkspacePatchResource, + options?: WorkspacesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + WorkspacesUpdateResponse + > + >; + /** + * Patch workspace details. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param workspacePatchResource The parameters for updating a specified workspace. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + workspaceName: string, + workspacePatchResource: WorkspacePatchResource, + options?: WorkspacesUpdateOptionalParams + ): Promise; + /** + * Deletes a specified workspace. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + workspaceName: string, + options?: WorkspacesDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes a specified workspace. + * @param resourceGroupName The name of the resource group that contains the service instance. + * @param workspaceName The name of workspace resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + workspaceName: string, + options?: WorkspacesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/healthcareapis/arm-healthcareapis/test/sampleTest.ts b/sdk/healthcareapis/arm-healthcareapis/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/healthcareapis/arm-healthcareapis/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/healthcareapis/arm-healthcareapis/tsconfig.json b/sdk/healthcareapis/arm-healthcareapis/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/healthcareapis/arm-healthcareapis/tsconfig.json +++ b/sdk/healthcareapis/arm-healthcareapis/tsconfig.json @@ -3,7 +3,7 @@ "module": "es6", "moduleResolution": "node", "strict": true, - "target": "es5", + "target": "es6", "sourceMap": true, "declarationMap": true, "esModuleInterop": true, @@ -11,9 +11,9 @@ "forceConsistentCasingInFileNames": true, "lib": ["es6", "dom"], "declaration": true, - "outDir": "./esm", + "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./src/**/*.ts", "./test/**/*.ts"], "exclude": ["node_modules"] } diff --git a/sdk/healthcareapis/ci.yml b/sdk/healthcareapis/ci.yml new file mode 100644 index 000000000000..af51a0ca52cc --- /dev/null +++ b/sdk/healthcareapis/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/healthcareapis/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/healthcareapis/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: healthcareapis + Artifacts: + - name: azure-arm-healthcareapis + safeName: azurearmhealthcareapis + \ No newline at end of file