From 9859a932082fdd015fdbb90936a62d281e103447 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 5 Jan 2022 12:53:58 +0000 Subject: [PATCH] CodeGen from PR 17000 in Azure/azure-rest-api-specs [Go] Track2 modify readme.go.md 9 (#17000) * [Go] Track2 modify readme.go.md 9 * fix --- common/config/rush/pnpm-lock.yaml | 131 +- rush.json | 5 + sdk/storagesync/arm-storagesync/CHANGELOG.md | 11 + .../arm-storagesync/{LICENSE.txt => LICENSE} | 4 +- sdk/storagesync/arm-storagesync/README.md | 143 +- sdk/storagesync/arm-storagesync/_meta.json | 7 + .../arm-storagesync/api-extractor.json | 18 + sdk/storagesync/arm-storagesync/package.json | 94 +- .../review/arm-storagesync.api.md | 1614 +++++++ .../arm-storagesync/rollup.config.js | 211 +- sdk/storagesync/arm-storagesync/src/index.ts | 12 + .../arm-storagesync/src/lroImpl.ts | 34 + .../src/microsoftStorageSync.ts | 164 + .../src/models/cloudEndpointsMappers.ts | 52 - .../arm-storagesync/src/models/index.ts | 4041 ++++++++--------- .../arm-storagesync/src/models/mappers.ts | 3519 +++++++++----- .../operationStatusOperationsMappers.ts | 15 - .../src/models/operationsMappers.ts | 17 - .../arm-storagesync/src/models/parameters.ts | 251 +- .../src/models/registeredServersMappers.ts | 42 - .../src/models/serverEndpointsMappers.ts | 44 - .../src/models/storageSyncServicesMappers.ts | 46 - .../src/models/syncGroupsMappers.ts | 40 - .../src/models/workflowsMappers.ts | 39 - .../src/operations/cloudEndpoints.ts | 1307 ++++-- .../arm-storagesync/src/operations/index.ts | 10 +- .../operations/operationStatusOperations.ts | 106 +- .../src/operations/operations.ts | 162 +- .../operations/privateEndpointConnections.ts | 451 ++ .../src/operations/privateLinkResources.ts | 70 + .../src/operations/registeredServers.ts | 607 ++- .../src/operations/serverEndpoints.ts | 816 +++- .../src/operations/storageSyncServices.ts | 746 +-- .../src/operations/syncGroups.ts | 342 +- .../src/operations/workflows.ts | 272 +- .../operationsInterfaces/cloudEndpoints.ts | 338 ++ .../src/operationsInterfaces/index.ts | 18 + .../operationStatusOperations.ts | 31 + .../src/operationsInterfaces/operations.ts | 22 + .../privateEndpointConnections.ts | 119 + .../privateLinkResources.ts | 28 + .../operationsInterfaces/registeredServers.ts | 154 + .../operationsInterfaces/serverEndpoints.ts | 207 + .../storageSyncServices.ts | 155 + .../src/operationsInterfaces/syncGroups.ts | 77 + .../src/operationsInterfaces/workflows.ts | 59 + .../src/storageSyncManagementClient.ts | 56 - .../src/storageSyncManagementClientContext.ts | 62 - .../arm-storagesync/test/sampleTest.ts | 48 + sdk/storagesync/arm-storagesync/tsconfig.json | 6 +- sdk/storagesync/ci.yml | 29 + 51 files changed, 11267 insertions(+), 5585 deletions(-) create mode 100644 sdk/storagesync/arm-storagesync/CHANGELOG.md rename sdk/storagesync/arm-storagesync/{LICENSE.txt => LICENSE} (96%) create mode 100644 sdk/storagesync/arm-storagesync/_meta.json create mode 100644 sdk/storagesync/arm-storagesync/api-extractor.json create mode 100644 sdk/storagesync/arm-storagesync/review/arm-storagesync.api.md create mode 100644 sdk/storagesync/arm-storagesync/src/index.ts create mode 100644 sdk/storagesync/arm-storagesync/src/lroImpl.ts create mode 100644 sdk/storagesync/arm-storagesync/src/microsoftStorageSync.ts delete mode 100644 sdk/storagesync/arm-storagesync/src/models/cloudEndpointsMappers.ts delete mode 100644 sdk/storagesync/arm-storagesync/src/models/operationStatusOperationsMappers.ts delete mode 100644 sdk/storagesync/arm-storagesync/src/models/operationsMappers.ts delete mode 100644 sdk/storagesync/arm-storagesync/src/models/registeredServersMappers.ts delete mode 100644 sdk/storagesync/arm-storagesync/src/models/serverEndpointsMappers.ts delete mode 100644 sdk/storagesync/arm-storagesync/src/models/storageSyncServicesMappers.ts delete mode 100644 sdk/storagesync/arm-storagesync/src/models/syncGroupsMappers.ts delete mode 100644 sdk/storagesync/arm-storagesync/src/models/workflowsMappers.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operations/privateEndpointConnections.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operations/privateLinkResources.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operationsInterfaces/cloudEndpoints.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operationsInterfaces/index.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operationsInterfaces/operationStatusOperations.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operationsInterfaces/operations.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operationsInterfaces/privateEndpointConnections.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operationsInterfaces/privateLinkResources.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operationsInterfaces/registeredServers.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operationsInterfaces/serverEndpoints.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operationsInterfaces/storageSyncServices.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operationsInterfaces/syncGroups.ts create mode 100644 sdk/storagesync/arm-storagesync/src/operationsInterfaces/workflows.ts delete mode 100644 sdk/storagesync/arm-storagesync/src/storageSyncManagementClient.ts delete mode 100644 sdk/storagesync/arm-storagesync/src/storageSyncManagementClientContext.ts create mode 100644 sdk/storagesync/arm-storagesync/test/sampleTest.ts create mode 100644 sdk/storagesync/ci.yml diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 694e81b4a476..926a57fae967 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -74,6 +74,7 @@ specifiers: '@rush-temp/arm-sql': file:./projects/arm-sql.tgz '@rush-temp/arm-sqlvirtualmachine': file:./projects/arm-sqlvirtualmachine.tgz '@rush-temp/arm-storage': file:./projects/arm-storage.tgz + '@rush-temp/arm-storagesync': file:./projects/arm-storagesync.tgz '@rush-temp/arm-streamanalytics': file:./projects/arm-streamanalytics.tgz '@rush-temp/arm-subscriptions': file:./projects/arm-subscriptions.tgz '@rush-temp/arm-templatespecs': file:./projects/arm-templatespecs.tgz @@ -255,6 +256,7 @@ dependencies: '@rush-temp/arm-sql': file:projects/arm-sql.tgz '@rush-temp/arm-sqlvirtualmachine': file:projects/arm-sqlvirtualmachine.tgz '@rush-temp/arm-storage': file:projects/arm-storage.tgz + '@rush-temp/arm-storagesync': file:projects/arm-storagesync.tgz '@rush-temp/arm-streamanalytics': file:projects/arm-streamanalytics.tgz '@rush-temp/arm-subscriptions': file:projects/arm-subscriptions.tgz '@rush-temp/arm-templatespecs': file:projects/arm-templatespecs.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 @@ -9339,6 +9341,27 @@ packages: uglify-js: 3.14.5 dev: false + file:projects/arm-storagesync.tgz: + resolution: {integrity: sha512-AGTjAq8iRMUWy7qmLkVOSrtY67H+MHV5vCYuSSGiYf+kwCzmmkuMDoIJguqt+132SLMOYRY5jMrwOiThTIis9Q==, tarball: file:projects/arm-storagesync.tgz} + name: '@rush-temp/arm-storagesync' + 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-streamanalytics.tgz: resolution: {integrity: sha512-2fjxFfFfAfxE5v0wXvUNE5FpL7shgJgqNvzFVbs6GOZFgPIMlhX5rr71h9S38XEUehUVyYtTHKh+Mmxlvx6Uqw==, tarball: file:projects/arm-streamanalytics.tgz} name: '@rush-temp/arm-streamanalytics' @@ -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..8918c45a587a 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-storagesync", + "projectFolder": "sdk/storagesync/arm-storagesync", + "versionPolicyName": "management" } ] } \ No newline at end of file diff --git a/sdk/storagesync/arm-storagesync/CHANGELOG.md b/sdk/storagesync/arm-storagesync/CHANGELOG.md new file mode 100644 index 000000000000..432b13818406 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 9.0.0 (2022-01-05) + +The package of @azure/arm-storagesync is using our next generation design principles since version 9.0.0, 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/storagesync/arm-storagesync/LICENSE.txt b/sdk/storagesync/arm-storagesync/LICENSE similarity index 96% rename from sdk/storagesync/arm-storagesync/LICENSE.txt rename to sdk/storagesync/arm-storagesync/LICENSE index ea8fb1516028..5d1d36e0af80 100644 --- a/sdk/storagesync/arm-storagesync/LICENSE.txt +++ b/sdk/storagesync/arm-storagesync/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/storagesync/arm-storagesync/README.md b/sdk/storagesync/arm-storagesync/README.md index 3020fe4cd139..f9269c1da30c 100644 --- a/sdk/storagesync/arm-storagesync/README.md +++ b/sdk/storagesync/arm-storagesync/README.md @@ -1,99 +1,98 @@ -## Azure StorageSyncManagementClient SDK for JavaScript +# Azure Service client library for JavaScript -This package contains an isomorphic SDK for StorageSyncManagementClient. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. + +Microsoft Storage Sync Service API + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storagesync/arm-storagesync) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-storagesync) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-storagesync) | +[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 + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-storagesync` package -### How to Install +Install the Azure Service client library for JavaScript with `npm`: ```bash npm install @azure/arm-storagesync ``` -### How to use +### Create and authenticate a `MicrosoftStorageSync` -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. -##### Install @azure/ms-rest-nodeauth +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" +npm install @azure/identity ``` -##### Sample code - -```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { StorageSyncManagementClient, StorageSyncManagementModels, StorageSyncManagementMappers } from "@azure/arm-storagesync"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new StorageSyncManagementClient(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); +You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { MicrosoftStorageSync } = require("@azure/arm-storagesync"); +const { DefaultAzureCredential } = require("@azure/identity"); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new MicrosoftStorageSync(new DefaultAzureCredential(), subscriptionId); ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth +### 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). -```bash -npm install @azure/ms-rest-browserauth -``` +## Key concepts -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-storagesync sample - - - - - - - - +### MicrosoftStorageSync + +`MicrosoftStorageSync` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); ``` +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + ## Related projects -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +- [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%2Fstoragesync%2Farm-storagesync%2FREADME.png) -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/storagesync/arm-storagesync/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/storagesync/arm-storagesync/_meta.json b/sdk/storagesync/arm-storagesync/_meta.json new file mode 100644 index 000000000000..04a00c762990 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/_meta.json @@ -0,0 +1,7 @@ +{ + "commit": "2ab4371edba33c23e8d680ed2bf6f98705b5cadb", + "readme": "specification/storagesync/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/storagesync/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/storagesync/arm-storagesync/api-extractor.json b/sdk/storagesync/arm-storagesync/api-extractor.json new file mode 100644 index 000000000000..7d7ca49f31a9 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/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-storagesync.d.ts" + }, + "messages": { + "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "extractorMessageReporting": { + "ae-missing-release-tag": { "logLevel": "none" }, + "ae-unresolved-link": { "logLevel": "none" } + } + } +} diff --git a/sdk/storagesync/arm-storagesync/package.json b/sdk/storagesync/arm-storagesync/package.json index 29b8ef52098c..f113ee877dde 100644 --- a/sdk/storagesync/arm-storagesync/package.json +++ b/sdk/storagesync/arm-storagesync/package.json @@ -1,57 +1,91 @@ { "name": "@azure/arm-storagesync", + "sdk-type": "mgmt", "author": "Microsoft Corporation", - "description": "StorageSyncManagementClient Library with typescript type definitions for node.js and browser.", - "version": "8.0.0", + "description": "A generated SDK for MicrosoftStorageSync.", + "version": "9.0.0", + "engines": { "node": ">=12.0.0" }, "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.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-storagesync.js", - "module": "./esm/storageSyncManagementClient.js", - "types": "./esm/storageSyncManagementClient.d.ts", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-storagesync.d.ts", "devDependencies": { - "typescript": "^3.5.3", - "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/storagesync/arm-storagesync", "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-storagesync.js.map'\" -o ./dist/arm-storagesync.min.js ./dist/arm-storagesync.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/storagesync/arm-storagesync/review/arm-storagesync.api.md b/sdk/storagesync/arm-storagesync/review/arm-storagesync.api.md new file mode 100644 index 000000000000..762e62b1aa1d --- /dev/null +++ b/sdk/storagesync/arm-storagesync/review/arm-storagesync.api.md @@ -0,0 +1,1614 @@ +## API Report File for "@azure/arm-storagesync" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; + +// @public +export interface BackupRequest { + azureFileShare?: string; +} + +// @public +export type ChangeDetectionMode = string; + +// @public +export interface CheckNameAvailabilityParameters { + name: string; + type: "Microsoft.StorageSync/storageSyncServices"; +} + +// @public +export interface CheckNameAvailabilityResult { + readonly message?: string; + readonly nameAvailable?: boolean; + readonly reason?: NameAvailabilityReason; +} + +// @public +export type CloudEndpoint = ProxyResource & { + storageAccountResourceId?: string; + azureFileShareName?: string; + storageAccountTenantId?: string; + partnershipId?: string; + friendlyName?: string; + readonly backupEnabled?: string; + provisioningState?: string; + lastWorkflowId?: string; + lastOperationName?: string; + readonly changeEnumerationStatus?: CloudEndpointChangeEnumerationStatus; +}; + +// @public +export interface CloudEndpointArray { + value?: CloudEndpoint[]; +} + +// @public +export interface CloudEndpointChangeEnumerationActivity { + readonly deletesProgressPercent?: number; + readonly lastUpdatedTimestamp?: Date; + readonly minutesRemaining?: number; + readonly operationState?: CloudEndpointChangeEnumerationActivityState; + readonly processedDirectoriesCount?: number; + readonly processedFilesCount?: number; + readonly progressPercent?: number; + readonly startedTimestamp?: Date; + readonly statusCode?: number; + readonly totalCountsState?: CloudEndpointChangeEnumerationTotalCountsState; + readonly totalDirectoriesCount?: number; + readonly totalFilesCount?: number; + readonly totalSizeBytes?: number; +} + +// @public +export type CloudEndpointChangeEnumerationActivityState = string; + +// @public +export interface CloudEndpointChangeEnumerationStatus { + readonly activity?: CloudEndpointChangeEnumerationActivity; + readonly lastEnumerationStatus?: CloudEndpointLastChangeEnumerationStatus; + readonly lastUpdatedTimestamp?: Date; +} + +// @public +export type CloudEndpointChangeEnumerationTotalCountsState = string; + +// @public +export type CloudEndpointCreateParameters = ProxyResource & { + storageAccountResourceId?: string; + azureFileShareName?: string; + storageAccountTenantId?: string; + friendlyName?: string; +}; + +// @public +export interface CloudEndpointLastChangeEnumerationStatus { + readonly completedTimestamp?: Date; + readonly namespaceDirectoriesCount?: number; + readonly namespaceFilesCount?: number; + readonly namespaceSizeBytes?: number; + readonly nextRunTimestamp?: Date; + readonly startedTimestamp?: Date; +} + +// @public +export interface CloudEndpoints { + beginCreate(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: CloudEndpointCreateParameters, options?: CloudEndpointsCreateOptionalParams): Promise, CloudEndpointsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: CloudEndpointCreateParameters, options?: CloudEndpointsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options?: CloudEndpointsDeleteOptionalParams): Promise, CloudEndpointsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options?: CloudEndpointsDeleteOptionalParams): Promise; + beginPostBackup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: BackupRequest, options?: CloudEndpointsPostBackupOptionalParams): Promise, CloudEndpointsPostBackupResponse>>; + beginPostBackupAndWait(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: BackupRequest, options?: CloudEndpointsPostBackupOptionalParams): Promise; + beginPostRestore(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: PostRestoreRequest, options?: CloudEndpointsPostRestoreOptionalParams): Promise, void>>; + beginPostRestoreAndWait(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: PostRestoreRequest, options?: CloudEndpointsPostRestoreOptionalParams): Promise; + beginPreBackup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: BackupRequest, options?: CloudEndpointsPreBackupOptionalParams): Promise, CloudEndpointsPreBackupResponse>>; + beginPreBackupAndWait(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: BackupRequest, options?: CloudEndpointsPreBackupOptionalParams): Promise; + beginPreRestore(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: PreRestoreRequest, options?: CloudEndpointsPreRestoreOptionalParams): Promise, void>>; + beginPreRestoreAndWait(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: PreRestoreRequest, options?: CloudEndpointsPreRestoreOptionalParams): Promise; + beginTriggerChangeDetection(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: TriggerChangeDetectionParameters, options?: CloudEndpointsTriggerChangeDetectionOptionalParams): Promise, void>>; + beginTriggerChangeDetectionAndWait(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: TriggerChangeDetectionParameters, options?: CloudEndpointsTriggerChangeDetectionOptionalParams): Promise; + get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options?: CloudEndpointsGetOptionalParams): Promise; + listBySyncGroup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: CloudEndpointsListBySyncGroupOptionalParams): PagedAsyncIterableIterator; + restoreheartbeat(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options?: CloudEndpointsRestoreheartbeatOptionalParams): Promise; +} + +// @public +export interface CloudEndpointsCreateHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface CloudEndpointsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CloudEndpointsCreateResponse = CloudEndpointsCreateHeaders & CloudEndpoint; + +// @public +export interface CloudEndpointsDeleteHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface CloudEndpointsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CloudEndpointsDeleteResponse = CloudEndpointsDeleteHeaders; + +// @public +export interface CloudEndpointsGetHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface CloudEndpointsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CloudEndpointsGetResponse = CloudEndpointsGetHeaders & CloudEndpoint; + +// @public +export interface CloudEndpointsListBySyncGroupHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface CloudEndpointsListBySyncGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CloudEndpointsListBySyncGroupResponse = CloudEndpointsListBySyncGroupHeaders & CloudEndpointArray; + +// @public +export interface CloudEndpointsPostBackupHeaders { + location?: string; + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface CloudEndpointsPostBackupOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CloudEndpointsPostBackupResponse = CloudEndpointsPostBackupHeaders & PostBackupResponse; + +// @public +export interface CloudEndpointsPostRestoreHeaders { + location?: string; + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface CloudEndpointsPostRestoreOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CloudEndpointsPreBackupHeaders { + location?: string; + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface CloudEndpointsPreBackupOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CloudEndpointsPreBackupResponse = CloudEndpointsPreBackupHeaders; + +// @public +export interface CloudEndpointsPreRestoreHeaders { + location?: string; + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface CloudEndpointsPreRestoreOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CloudEndpointsRestoreheartbeatHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface CloudEndpointsRestoreheartbeatOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CloudEndpointsRestoreheartbeatResponse = CloudEndpointsRestoreheartbeatHeaders; + +// @public +export interface CloudEndpointsTriggerChangeDetectionHeaders { + location?: string; + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface CloudEndpointsTriggerChangeDetectionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface CloudTieringCachePerformance { + readonly cacheHitBytes?: number; + readonly cacheHitBytesPercent?: number; + readonly cacheMissBytes?: number; + readonly lastUpdatedTimestamp?: Date; +} + +// @public +export interface CloudTieringDatePolicyStatus { + readonly lastUpdatedTimestamp?: Date; + readonly tieredFilesMostRecentAccessTimestamp?: Date; +} + +// @public +export interface CloudTieringFilesNotTiering { + readonly errors?: FilesNotTieringError[]; + readonly lastUpdatedTimestamp?: Date; + readonly totalFileCount?: number; +} + +// @public +export interface CloudTieringSpaceSavings { + readonly cachedSizeBytes?: number; + readonly lastUpdatedTimestamp?: Date; + readonly spaceSavingsBytes?: number; + readonly spaceSavingsPercent?: number; + readonly totalSizeCloudBytes?: number; + readonly volumeSizeBytes?: number; +} + +// @public +export interface CloudTieringVolumeFreeSpacePolicyStatus { + readonly currentVolumeFreeSpacePercent?: number; + readonly effectiveVolumeFreeSpacePolicy?: number; + readonly lastUpdatedTimestamp?: Date; +} + +// @public +export type FeatureStatus = string; + +// @public +export interface FilesNotTieringError { + readonly errorCode?: number; + readonly fileCount?: number; +} + +// @public +export type IncomingTrafficPolicy = string; + +// @public +export type InitialDownloadPolicy = string; + +// @public +export type InitialUploadPolicy = string; + +// @public +export enum KnownChangeDetectionMode { + // (undocumented) + Default = "Default", + // (undocumented) + Recursive = "Recursive" +} + +// @public +export enum KnownCloudEndpointChangeEnumerationActivityState { + // (undocumented) + EnumerationInProgress = "EnumerationInProgress", + // (undocumented) + InitialEnumerationInProgress = "InitialEnumerationInProgress" +} + +// @public +export enum KnownCloudEndpointChangeEnumerationTotalCountsState { + // (undocumented) + Calculating = "Calculating", + // (undocumented) + Final = "Final" +} + +// @public +export enum KnownFeatureStatus { + // (undocumented) + Off = "off", + // (undocumented) + On = "on" +} + +// @public +export enum KnownIncomingTrafficPolicy { + // (undocumented) + AllowAllTraffic = "AllowAllTraffic", + // (undocumented) + AllowVirtualNetworksOnly = "AllowVirtualNetworksOnly" +} + +// @public +export enum KnownInitialDownloadPolicy { + // (undocumented) + AvoidTieredFiles = "AvoidTieredFiles", + // (undocumented) + NamespaceOnly = "NamespaceOnly", + // (undocumented) + NamespaceThenModifiedFiles = "NamespaceThenModifiedFiles" +} + +// @public +export enum KnownInitialUploadPolicy { + // (undocumented) + Merge = "Merge", + // (undocumented) + ServerAuthoritative = "ServerAuthoritative" +} + +// @public +export enum KnownLocalCacheMode { + // (undocumented) + DownloadNewAndModifiedFiles = "DownloadNewAndModifiedFiles", + // (undocumented) + UpdateLocallyCachedFiles = "UpdateLocallyCachedFiles" +} + +// @public +export enum KnownOperationDirection { + // (undocumented) + Cancel = "cancel", + // (undocumented) + Do = "do", + // (undocumented) + Undo = "undo" +} + +// @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 KnownProgressType { + // (undocumented) + Download = "download", + // (undocumented) + Initialize = "initialize", + // (undocumented) + None = "none", + // (undocumented) + Recall = "recall", + // (undocumented) + Upload = "upload" +} + +// @public +export enum KnownReason { + // (undocumented) + Deleted = "Deleted", + // (undocumented) + Registered = "Registered", + // (undocumented) + Suspended = "Suspended", + // (undocumented) + Unregistered = "Unregistered", + // (undocumented) + Warned = "Warned" +} + +// @public +export enum KnownRegisteredServerAgentVersionStatus { + // (undocumented) + Blocked = "Blocked", + // (undocumented) + Expired = "Expired", + // (undocumented) + NearExpiry = "NearExpiry", + // (undocumented) + Ok = "Ok" +} + +// @public +export enum KnownServerEndpointHealthState { + // (undocumented) + Error = "Error", + // (undocumented) + Healthy = "Healthy", + // (undocumented) + Unavailable = "Unavailable" +} + +// @public +export enum KnownServerEndpointOfflineDataTransferState { + // (undocumented) + Complete = "Complete", + // (undocumented) + InProgress = "InProgress", + // (undocumented) + NotRunning = "NotRunning", + // (undocumented) + Stopping = "Stopping" +} + +// @public +export enum KnownServerEndpointSyncActivityState { + // (undocumented) + Download = "Download", + // (undocumented) + Upload = "Upload", + // (undocumented) + UploadAndDownload = "UploadAndDownload" +} + +// @public +export enum KnownServerEndpointSyncMode { + // (undocumented) + InitialFullDownload = "InitialFullDownload", + // (undocumented) + InitialUpload = "InitialUpload", + // (undocumented) + NamespaceDownload = "NamespaceDownload", + // (undocumented) + Regular = "Regular", + // (undocumented) + SnapshotUpload = "SnapshotUpload" +} + +// @public +export enum KnownWorkflowStatus { + // (undocumented) + Aborted = "aborted", + // (undocumented) + Active = "active", + // (undocumented) + Expired = "expired", + // (undocumented) + Failed = "failed", + // (undocumented) + Succeeded = "succeeded" +} + +// @public +export type LocalCacheMode = string; + +// @public +export interface LocationOperationStatus { + readonly endTime?: Date; + readonly error?: StorageSyncApiError; + readonly id?: string; + readonly name?: string; + readonly percentComplete?: number; + readonly startTime?: Date; + readonly status?: string; +} + +// @public +export interface LocationOperationStatusOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LocationOperationStatusResponse = MicrosoftStorageSyncLocationOperationStatusHeaders & LocationOperationStatus; + +// @public (undocumented) +export class MicrosoftStorageSync extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: MicrosoftStorageSyncOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + cloudEndpoints: CloudEndpoints; + locationOperationStatus(locationName: string, operationId: string, options?: LocationOperationStatusOptionalParams): Promise; + // (undocumented) + operations: Operations; + // (undocumented) + operationStatusOperations: OperationStatusOperations; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) + registeredServers: RegisteredServers; + // (undocumented) + serverEndpoints: ServerEndpoints; + // (undocumented) + storageSyncServices: StorageSyncServices; + // (undocumented) + subscriptionId: string; + // (undocumented) + syncGroups: SyncGroups; + // (undocumented) + workflows: Workflows; +} + +// @public +export interface MicrosoftStorageSyncLocationOperationStatusHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface MicrosoftStorageSyncOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type NameAvailabilityReason = "Invalid" | "AlreadyExists"; + +// @public +export type OperationDirection = string; + +// @public +export interface OperationDisplayInfo { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationDisplayResource { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationEntity { + display?: OperationDisplayInfo; + name?: string; + origin?: string; + properties?: OperationProperties; +} + +// @public +export interface OperationEntityListResult { + nextLink?: string; + value?: OperationEntity[]; +} + +// @public +export interface OperationProperties { + serviceSpecification?: OperationResourceServiceSpecification; +} + +// @public +export interface OperationResourceMetricSpecification { + aggregationType?: string; + dimensions?: OperationResourceMetricSpecificationDimension[]; + displayDescription?: string; + displayName?: string; + fillGapWithZero?: boolean; + name?: string; + unit?: string; +} + +// @public +export interface OperationResourceMetricSpecificationDimension { + displayName?: string; + name?: string; + toBeExportedForShoebox?: boolean; +} + +// @public +export interface OperationResourceServiceSpecification { + metricSpecifications?: OperationResourceMetricSpecification[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface OperationsListNextHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationsListNextHeaders & OperationEntityListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationsListHeaders & OperationEntityListResult; + +// @public +export interface OperationStatus { + readonly endTime?: Date; + readonly error?: StorageSyncApiError; + readonly name?: string; + readonly startTime?: Date; + readonly status?: string; +} + +// @public +export interface OperationStatusGetHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface OperationStatusGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationStatusGetResponse = OperationStatusGetHeaders & OperationStatus; + +// @public +export interface OperationStatusOperations { + get(resourceGroupName: string, locationName: string, workflowId: string, operationId: string, options?: OperationStatusGetOptionalParams): Promise; +} + +// @public +export interface PostBackupResponse { + readonly cloudEndpointName?: string; +} + +// @public +export interface PostRestoreRequest { + azureFileShareUri?: string; + failedFileList?: string; + partition?: string; + replicaGroup?: string; + requestId?: string; + restoreFileSpec?: RestoreFileSpec[]; + sourceAzureFileShareUri?: string; + status?: string; +} + +// @public +export interface PreRestoreRequest { + azureFileShareUri?: string; + backupMetadataPropertyBag?: string; + partition?: string; + pauseWaitForSyncDrainTimePeriodInSeconds?: number; + replicaGroup?: string; + requestId?: string; + restoreFileSpec?: RestoreFileSpec[]; + sourceAzureFileShareUri?: string; + status?: string; +} + +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export type PrivateEndpointConnection = Resource & { + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +}; + +// @public +export interface PrivateEndpointConnectionListResult { + value?: PrivateEndpointConnection[]; +} + +// @public +export type PrivateEndpointConnectionProvisioningState = string; + +// @public +export interface PrivateEndpointConnections { + beginCreate(resourceGroupName: string, storageSyncServiceName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise, PrivateEndpointConnectionsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, storageSyncServiceName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, storageSyncServiceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, storageSyncServiceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + get(resourceGroupName: string, storageSyncServiceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: PrivateEndpointConnectionsListByStorageSyncServiceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsCreateHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: string; + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface PrivateEndpointConnectionsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsDeleteHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: string; + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListByStorageSyncServiceHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface PrivateEndpointConnectionsListByStorageSyncServiceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListByStorageSyncServiceResponse = PrivateEndpointConnectionsListByStorageSyncServiceHeaders & PrivateEndpointConnectionListResult; + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export type PrivateLinkResource = Resource & { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +}; + +// @public +export interface PrivateLinkResourceListResult { + value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResources { + listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: PrivateLinkResourcesListByStorageSyncServiceOptionalParams): Promise; +} + +// @public +export interface PrivateLinkResourcesListByStorageSyncServiceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByStorageSyncServiceResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + +// @public +export type ProgressType = string; + +// @public +export type ProxyResource = Resource & {}; + +// @public +export type Reason = string; + +// @public +export interface RecallActionParameters { + pattern?: string; + recallPath?: string; +} + +// @public +export type RegisteredServer = ProxyResource & { + serverCertificate?: string; + agentVersion?: string; + readonly agentVersionStatus?: RegisteredServerAgentVersionStatus; + readonly agentVersionExpirationDate?: Date; + serverOSVersion?: string; + serverManagementErrorCode?: number; + lastHeartBeat?: string; + provisioningState?: string; + serverRole?: string; + clusterId?: string; + clusterName?: string; + serverId?: string; + storageSyncServiceUid?: string; + lastWorkflowId?: string; + lastOperationName?: string; + discoveryEndpointUri?: string; + resourceLocation?: string; + serviceLocation?: string; + friendlyName?: string; + managementEndpointUri?: string; + monitoringEndpointUri?: string; + monitoringConfiguration?: string; + readonly serverName?: string; +}; + +// @public +export type RegisteredServerAgentVersionStatus = string; + +// @public +export interface RegisteredServerArray { + value?: RegisteredServer[]; +} + +// @public +export type RegisteredServerCreateParameters = ProxyResource & { + serverCertificate?: string; + agentVersion?: string; + serverOSVersion?: string; + lastHeartBeat?: string; + serverRole?: string; + clusterId?: string; + clusterName?: string; + serverId?: string; + friendlyName?: string; +}; + +// @public +export interface RegisteredServers { + beginCreate(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: RegisteredServerCreateParameters, options?: RegisteredServersCreateOptionalParams): Promise, RegisteredServersCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: RegisteredServerCreateParameters, options?: RegisteredServersCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, storageSyncServiceName: string, serverId: string, options?: RegisteredServersDeleteOptionalParams): Promise, RegisteredServersDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, storageSyncServiceName: string, serverId: string, options?: RegisteredServersDeleteOptionalParams): Promise; + beginTriggerRollover(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: TriggerRolloverRequest, options?: RegisteredServersTriggerRolloverOptionalParams): Promise, RegisteredServersTriggerRolloverResponse>>; + beginTriggerRolloverAndWait(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: TriggerRolloverRequest, options?: RegisteredServersTriggerRolloverOptionalParams): Promise; + get(resourceGroupName: string, storageSyncServiceName: string, serverId: string, options?: RegisteredServersGetOptionalParams): Promise; + listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: RegisteredServersListByStorageSyncServiceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RegisteredServersCreateHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface RegisteredServersCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type RegisteredServersCreateResponse = RegisteredServersCreateHeaders & RegisteredServer; + +// @public +export interface RegisteredServersDeleteHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface RegisteredServersDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type RegisteredServersDeleteResponse = RegisteredServersDeleteHeaders; + +// @public +export interface RegisteredServersGetHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface RegisteredServersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RegisteredServersGetResponse = RegisteredServersGetHeaders & RegisteredServer; + +// @public +export interface RegisteredServersListByStorageSyncServiceHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface RegisteredServersListByStorageSyncServiceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type RegisteredServersListByStorageSyncServiceResponse = RegisteredServersListByStorageSyncServiceHeaders & RegisteredServerArray; + +// @public +export interface RegisteredServersTriggerRolloverHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface RegisteredServersTriggerRolloverOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type RegisteredServersTriggerRolloverResponse = RegisteredServersTriggerRolloverHeaders; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + +// @public +export interface ResourcesMoveInfo { + resources?: string[]; + targetResourceGroup?: string; +} + +// @public +export interface RestoreFileSpec { + isdir?: boolean; + path?: string; +} + +// @public +export type ServerEndpoint = ProxyResource & { + serverLocalPath?: string; + cloudTiering?: FeatureStatus; + volumeFreeSpacePercent?: number; + tierFilesOlderThanDays?: number; + friendlyName?: string; + serverResourceId?: string; + readonly provisioningState?: string; + readonly lastWorkflowId?: string; + readonly lastOperationName?: string; + readonly syncStatus?: ServerEndpointSyncStatus; + offlineDataTransfer?: FeatureStatus; + readonly offlineDataTransferStorageAccountResourceId?: string; + readonly offlineDataTransferStorageAccountTenantId?: string; + offlineDataTransferShareName?: string; + readonly cloudTieringStatus?: ServerEndpointCloudTieringStatus; + readonly recallStatus?: ServerEndpointRecallStatus; + initialDownloadPolicy?: InitialDownloadPolicy; + localCacheMode?: LocalCacheMode; + initialUploadPolicy?: InitialUploadPolicy; + readonly serverName?: string; +}; + +// @public +export interface ServerEndpointArray { + value?: ServerEndpoint[]; +} + +// @public +export interface ServerEndpointBackgroundDataDownloadActivity { + readonly downloadedBytes?: number; + readonly percentProgress?: number; + readonly startedTimestamp?: Date; + readonly timestamp?: Date; +} + +// @public +export interface ServerEndpointCloudTieringStatus { + readonly cachePerformance?: CloudTieringCachePerformance; + readonly datePolicyStatus?: CloudTieringDatePolicyStatus; + readonly filesNotTiering?: CloudTieringFilesNotTiering; + readonly health?: ServerEndpointHealthState; + readonly healthLastUpdatedTimestamp?: Date; + readonly lastCloudTieringResult?: number; + readonly lastSuccessTimestamp?: Date; + readonly lastUpdatedTimestamp?: Date; + readonly spaceSavings?: CloudTieringSpaceSavings; + readonly volumeFreeSpacePolicyStatus?: CloudTieringVolumeFreeSpacePolicyStatus; +} + +// @public +export type ServerEndpointCreateParameters = ProxyResource & { + serverLocalPath?: string; + cloudTiering?: FeatureStatus; + volumeFreeSpacePercent?: number; + tierFilesOlderThanDays?: number; + friendlyName?: string; + serverResourceId?: string; + offlineDataTransfer?: FeatureStatus; + offlineDataTransferShareName?: string; + initialDownloadPolicy?: InitialDownloadPolicy; + localCacheMode?: LocalCacheMode; + initialUploadPolicy?: InitialUploadPolicy; +}; + +// @public +export interface ServerEndpointFilesNotSyncingError { + readonly errorCode?: number; + readonly persistentCount?: number; + readonly transientCount?: number; +} + +// @public +export type ServerEndpointHealthState = string; + +// @public +export type ServerEndpointOfflineDataTransferState = string; + +// @public +export interface ServerEndpointRecallError { + readonly count?: number; + readonly errorCode?: number; +} + +// @public +export interface ServerEndpointRecallStatus { + readonly lastUpdatedTimestamp?: Date; + readonly recallErrors?: ServerEndpointRecallError[]; + readonly totalRecallErrorsCount?: number; +} + +// @public +export interface ServerEndpoints { + beginCreate(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, parameters: ServerEndpointCreateParameters, options?: ServerEndpointsCreateOptionalParams): Promise, ServerEndpointsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, parameters: ServerEndpointCreateParameters, options?: ServerEndpointsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options?: ServerEndpointsDeleteOptionalParams): Promise, ServerEndpointsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options?: ServerEndpointsDeleteOptionalParams): Promise; + beginRecallAction(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, parameters: RecallActionParameters, options?: ServerEndpointsRecallActionOptionalParams): Promise, ServerEndpointsRecallActionResponse>>; + beginRecallActionAndWait(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, parameters: RecallActionParameters, options?: ServerEndpointsRecallActionOptionalParams): Promise; + beginUpdate(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options?: ServerEndpointsUpdateOptionalParams): Promise, ServerEndpointsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options?: ServerEndpointsUpdateOptionalParams): Promise; + get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options?: ServerEndpointsGetOptionalParams): Promise; + listBySyncGroup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: ServerEndpointsListBySyncGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ServerEndpointsCreateHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface ServerEndpointsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ServerEndpointsCreateResponse = ServerEndpointsCreateHeaders & ServerEndpoint; + +// @public +export interface ServerEndpointsDeleteHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface ServerEndpointsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ServerEndpointsDeleteResponse = ServerEndpointsDeleteHeaders; + +// @public +export interface ServerEndpointsGetHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface ServerEndpointsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServerEndpointsGetResponse = ServerEndpointsGetHeaders & ServerEndpoint; + +// @public +export interface ServerEndpointsListBySyncGroupHeaders { + location?: string; + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface ServerEndpointsListBySyncGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServerEndpointsListBySyncGroupResponse = ServerEndpointsListBySyncGroupHeaders & ServerEndpointArray; + +// @public +export interface ServerEndpointsRecallActionHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface ServerEndpointsRecallActionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ServerEndpointsRecallActionResponse = ServerEndpointsRecallActionHeaders; + +// @public +export interface ServerEndpointsUpdateHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface ServerEndpointsUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: ServerEndpointUpdateParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ServerEndpointsUpdateResponse = ServerEndpointsUpdateHeaders & ServerEndpoint; + +// @public +export type ServerEndpointSyncActivityState = string; + +// @public +export interface ServerEndpointSyncActivityStatus { + readonly appliedBytes?: number; + readonly appliedItemCount?: number; + readonly perItemErrorCount?: number; + readonly sessionMinutesRemaining?: number; + readonly syncMode?: ServerEndpointSyncMode; + readonly timestamp?: Date; + readonly totalBytes?: number; + readonly totalItemCount?: number; +} + +// @public +export type ServerEndpointSyncMode = string; + +// @public +export interface ServerEndpointSyncSessionStatus { + readonly filesNotSyncingErrors?: ServerEndpointFilesNotSyncingError[]; + readonly lastSyncMode?: ServerEndpointSyncMode; + readonly lastSyncPerItemErrorCount?: number; + readonly lastSyncResult?: number; + readonly lastSyncSuccessTimestamp?: Date; + readonly lastSyncTimestamp?: Date; + readonly persistentFilesNotSyncingCount?: number; + readonly transientFilesNotSyncingCount?: number; +} + +// @public +export interface ServerEndpointSyncStatus { + readonly backgroundDataDownloadActivity?: ServerEndpointBackgroundDataDownloadActivity; + readonly combinedHealth?: ServerEndpointHealthState; + readonly downloadActivity?: ServerEndpointSyncActivityStatus; + readonly downloadHealth?: ServerEndpointHealthState; + readonly downloadStatus?: ServerEndpointSyncSessionStatus; + readonly lastUpdatedTimestamp?: Date; + readonly offlineDataTransferStatus?: ServerEndpointOfflineDataTransferState; + readonly syncActivity?: ServerEndpointSyncActivityState; + readonly totalPersistentFilesNotSyncingCount?: number; + readonly uploadActivity?: ServerEndpointSyncActivityStatus; + readonly uploadHealth?: ServerEndpointHealthState; + readonly uploadStatus?: ServerEndpointSyncSessionStatus; +} + +// @public +export interface ServerEndpointUpdateParameters { + cloudTiering?: FeatureStatus; + localCacheMode?: LocalCacheMode; + offlineDataTransfer?: FeatureStatus; + offlineDataTransferShareName?: string; + tierFilesOlderThanDays?: number; + volumeFreeSpacePercent?: number; +} + +// @public +export interface StorageSyncApiError { + code?: string; + details?: StorageSyncErrorDetails; + innerError?: StorageSyncInnerErrorDetails; + message?: string; + target?: string; +} + +// @public +export interface StorageSyncError { + error?: StorageSyncApiError; + innererror?: StorageSyncApiError; +} + +// @public +export interface StorageSyncErrorDetails { + code?: string; + exceptionType?: string; + hashedMessage?: string; + httpErrorCode?: string; + httpMethod?: string; + message?: string; + requestUri?: string; + target?: string; +} + +// @public +export interface StorageSyncInnerErrorDetails { + callStack?: string; + innerException?: string; + innerExceptionCallStack?: string; + message?: string; +} + +// @public +export type StorageSyncService = TrackedResource & { + incomingTrafficPolicy?: IncomingTrafficPolicy; + readonly storageSyncServiceStatus?: number; + readonly storageSyncServiceUid?: string; + readonly provisioningState?: string; + readonly lastWorkflowId?: string; + readonly lastOperationName?: string; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; +}; + +// @public +export interface StorageSyncServiceArray { + value?: StorageSyncService[]; +} + +// @public +export interface StorageSyncServiceCreateParameters { + incomingTrafficPolicy?: IncomingTrafficPolicy; + location: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface StorageSyncServices { + beginCreate(resourceGroupName: string, storageSyncServiceName: string, parameters: StorageSyncServiceCreateParameters, options?: StorageSyncServicesCreateOptionalParams): Promise, StorageSyncServicesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, storageSyncServiceName: string, parameters: StorageSyncServiceCreateParameters, options?: StorageSyncServicesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, storageSyncServiceName: string, options?: StorageSyncServicesDeleteOptionalParams): Promise, StorageSyncServicesDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, storageSyncServiceName: string, options?: StorageSyncServicesDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, storageSyncServiceName: string, options?: StorageSyncServicesUpdateOptionalParams): Promise, StorageSyncServicesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, storageSyncServiceName: string, options?: StorageSyncServicesUpdateOptionalParams): Promise; + checkNameAvailability(locationName: string, parameters: CheckNameAvailabilityParameters, options?: StorageSyncServicesCheckNameAvailabilityOptionalParams): Promise; + get(resourceGroupName: string, storageSyncServiceName: string, options?: StorageSyncServicesGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: StorageSyncServicesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: StorageSyncServicesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface StorageSyncServicesCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageSyncServicesCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +// @public +export interface StorageSyncServicesCreateHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: string; + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface StorageSyncServicesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageSyncServicesCreateResponse = StorageSyncService; + +// @public +export interface StorageSyncServicesDeleteHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface StorageSyncServicesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageSyncServicesDeleteResponse = StorageSyncServicesDeleteHeaders; + +// @public +export interface StorageSyncServicesGetHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface StorageSyncServicesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageSyncServicesGetResponse = StorageSyncServicesGetHeaders & StorageSyncService; + +// @public +export interface StorageSyncServicesListByResourceGroupHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface StorageSyncServicesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageSyncServicesListByResourceGroupResponse = StorageSyncServicesListByResourceGroupHeaders & StorageSyncServiceArray; + +// @public +export interface StorageSyncServicesListBySubscriptionHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface StorageSyncServicesListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type StorageSyncServicesListBySubscriptionResponse = StorageSyncServicesListBySubscriptionHeaders & StorageSyncServiceArray; + +// @public +export interface StorageSyncServicesUpdateHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface StorageSyncServicesUpdateOptionalParams extends coreClient.OperationOptions { + parameters?: StorageSyncServiceUpdateParameters; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type StorageSyncServicesUpdateResponse = StorageSyncServicesUpdateHeaders & StorageSyncService; + +// @public +export interface StorageSyncServiceUpdateParameters { + incomingTrafficPolicy?: IncomingTrafficPolicy; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface SubscriptionState { + readonly istransitioning?: boolean; + properties?: Record; + state?: Reason; +} + +// @public +export type SyncGroup = ProxyResource & { + readonly uniqueId?: string; + readonly syncGroupStatus?: string; +}; + +// @public +export interface SyncGroupArray { + value?: SyncGroup[]; +} + +// @public +export type SyncGroupCreateParameters = ProxyResource & { + properties?: Record; +}; + +// @public +export interface SyncGroups { + create(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, parameters: SyncGroupCreateParameters, options?: SyncGroupsCreateOptionalParams): Promise; + delete(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: SyncGroupsDeleteOptionalParams): Promise; + get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: SyncGroupsGetOptionalParams): Promise; + listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: SyncGroupsListByStorageSyncServiceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SyncGroupsCreateHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface SyncGroupsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SyncGroupsCreateResponse = SyncGroupsCreateHeaders & SyncGroup; + +// @public +export interface SyncGroupsDeleteHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface SyncGroupsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SyncGroupsDeleteResponse = SyncGroupsDeleteHeaders; + +// @public +export interface SyncGroupsGetHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface SyncGroupsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SyncGroupsGetResponse = SyncGroupsGetHeaders & SyncGroup; + +// @public +export interface SyncGroupsListByStorageSyncServiceHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface SyncGroupsListByStorageSyncServiceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SyncGroupsListByStorageSyncServiceResponse = SyncGroupsListByStorageSyncServiceHeaders & SyncGroupArray; + +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + +// @public +export interface TriggerChangeDetectionParameters { + changeDetectionMode?: ChangeDetectionMode; + directoryPath?: string; + paths?: string[]; +} + +// @public +export interface TriggerRolloverRequest { + serverCertificate?: string; +} + +// @public +export type Workflow = ProxyResource & { + lastStepName?: string; + status?: WorkflowStatus; + operation?: OperationDirection; + steps?: string; + lastOperationId?: string; + readonly commandName?: string; + readonly createdTimestamp?: Date; + readonly lastStatusTimestamp?: Date; +}; + +// @public +export interface WorkflowArray { + value?: Workflow[]; +} + +// @public +export interface Workflows { + abort(resourceGroupName: string, storageSyncServiceName: string, workflowId: string, options?: WorkflowsAbortOptionalParams): Promise; + get(resourceGroupName: string, storageSyncServiceName: string, workflowId: string, options?: WorkflowsGetOptionalParams): Promise; + listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: WorkflowsListByStorageSyncServiceOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface WorkflowsAbortHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface WorkflowsAbortOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkflowsAbortResponse = WorkflowsAbortHeaders; + +// @public +export interface WorkflowsGetHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface WorkflowsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkflowsGetResponse = WorkflowsGetHeaders & Workflow; + +// @public +export interface WorkflowsListByStorageSyncServiceHeaders { + xMsCorrelationRequestId?: string; + xMsRequestId?: string; +} + +// @public +export interface WorkflowsListByStorageSyncServiceOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkflowsListByStorageSyncServiceResponse = WorkflowsListByStorageSyncServiceHeaders & WorkflowArray; + +// @public +export type WorkflowStatus = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/storagesync/arm-storagesync/rollup.config.js b/sdk/storagesync/arm-storagesync/rollup.config.js index 11130dc93fb6..9be1955eb7f1 100644 --- a/sdk/storagesync/arm-storagesync/rollup.config.js +++ b/sdk/storagesync/arm-storagesync/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/storageSyncManagementClient.js", - external: [ - "@azure/ms-rest-js", - "@azure/ms-rest-azure-js" - ], - output: { - file: "./dist/arm-storagesync.js", - format: "umd", - name: "Azure.ArmStoragesync", - 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/storagesync/arm-storagesync/src/index.ts b/sdk/storagesync/arm-storagesync/src/index.ts new file mode 100644 index 000000000000..a1f87ce20182 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/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 { MicrosoftStorageSync } from "./microsoftStorageSync"; +export * from "./operationsInterfaces"; diff --git a/sdk/storagesync/arm-storagesync/src/lroImpl.ts b/sdk/storagesync/arm-storagesync/src/lroImpl.ts new file mode 100644 index 000000000000..518d5f053b4e --- /dev/null +++ b/sdk/storagesync/arm-storagesync/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/storagesync/arm-storagesync/src/microsoftStorageSync.ts b/sdk/storagesync/arm-storagesync/src/microsoftStorageSync.ts new file mode 100644 index 000000000000..9d9400ab30a6 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/microsoftStorageSync.ts @@ -0,0 +1,164 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + StorageSyncServicesImpl, + PrivateLinkResourcesImpl, + PrivateEndpointConnectionsImpl, + SyncGroupsImpl, + CloudEndpointsImpl, + ServerEndpointsImpl, + RegisteredServersImpl, + WorkflowsImpl, + OperationStatusOperationsImpl +} from "./operations"; +import { + Operations, + StorageSyncServices, + PrivateLinkResources, + PrivateEndpointConnections, + SyncGroups, + CloudEndpoints, + ServerEndpoints, + RegisteredServers, + Workflows, + OperationStatusOperations +} from "./operationsInterfaces"; +import * as Parameters from "./models/parameters"; +import * as Mappers from "./models/mappers"; +import { + MicrosoftStorageSyncOptionalParams, + LocationOperationStatusOptionalParams, + LocationOperationStatusResponse +} from "./models"; + +export class MicrosoftStorageSync extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the MicrosoftStorageSync class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: MicrosoftStorageSyncOptionalParams + ) { + 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: MicrosoftStorageSyncOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-arm-storagesync/9.0.0`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2020-09-01"; + this.operations = new OperationsImpl(this); + this.storageSyncServices = new StorageSyncServicesImpl(this); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.syncGroups = new SyncGroupsImpl(this); + this.cloudEndpoints = new CloudEndpointsImpl(this); + this.serverEndpoints = new ServerEndpointsImpl(this); + this.registeredServers = new RegisteredServersImpl(this); + this.workflows = new WorkflowsImpl(this); + this.operationStatusOperations = new OperationStatusOperationsImpl(this); + } + + /** + * Get Operation status + * @param locationName The desired region to obtain information from. + * @param operationId operation Id + * @param options The options parameters. + */ + locationOperationStatus( + locationName: string, + operationId: string, + options?: LocationOperationStatusOptionalParams + ): Promise { + return this.sendOperationRequest( + { locationName, operationId, options }, + locationOperationStatusOperationSpec + ); + } + + operations: Operations; + storageSyncServices: StorageSyncServices; + privateLinkResources: PrivateLinkResources; + privateEndpointConnections: PrivateEndpointConnections; + syncGroups: SyncGroups; + cloudEndpoints: CloudEndpoints; + serverEndpoints: ServerEndpoints; + registeredServers: RegisteredServers; + workflows: Workflows; + operationStatusOperations: OperationStatusOperations; +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const locationOperationStatusOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/operations/{operationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LocationOperationStatus, + headersMapper: Mappers.MicrosoftStorageSyncLocationOperationStatusHeaders + }, + default: { + bodyMapper: Mappers.StorageSyncError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.locationName, + Parameters.subscriptionId, + Parameters.operationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/storagesync/arm-storagesync/src/models/cloudEndpointsMappers.ts b/sdk/storagesync/arm-storagesync/src/models/cloudEndpointsMappers.ts deleted file mode 100644 index aad2b506cb6f..000000000000 --- a/sdk/storagesync/arm-storagesync/src/models/cloudEndpointsMappers.ts +++ /dev/null @@ -1,52 +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, - BackupRequest, - BaseResource, - CloudEndpoint, - CloudEndpointArray, - CloudEndpointCreateParameters, - CloudEndpointsCreateHeaders, - CloudEndpointsDeleteHeaders, - CloudEndpointsGetHeaders, - CloudEndpointsListBySyncGroupHeaders, - CloudEndpointsPostBackupHeaders, - CloudEndpointsPostRestoreHeaders, - CloudEndpointsPreBackupHeaders, - CloudEndpointsPreRestoreHeaders, - CloudEndpointsRestoreheartbeatHeaders, - CloudEndpointsTriggerChangeDetectionHeaders, - PostBackupResponse, - PostRestoreRequest, - PreRestoreRequest, - ProxyResource, - RegisteredServer, - RegisteredServerCreateParameters, - Resource, - RestoreFileSpec, - ServerEndpoint, - ServerEndpointCloudTieringStatus, - ServerEndpointCreateParameters, - ServerEndpointFilesNotSyncingError, - ServerEndpointRecallError, - ServerEndpointRecallStatus, - ServerEndpointSyncActivityStatus, - ServerEndpointSyncSessionStatus, - ServerEndpointSyncStatus, - StorageSyncApiError, - StorageSyncError, - StorageSyncErrorDetails, - StorageSyncService, - SyncGroup, - SyncGroupCreateParameters, - TrackedResource, - TriggerChangeDetectionParameters, - Workflow -} from "../models/mappers"; diff --git a/sdk/storagesync/arm-storagesync/src/models/index.ts b/sdk/storagesync/arm-storagesync/src/models/index.ts index b58aba1f343e..2034b7be0e7f 100644 --- a/sdk/storagesync/arm-storagesync/src/models/index.ts +++ b/sdk/storagesync/arm-storagesync/src/models/index.ts @@ -1,2700 +1,2483 @@ /* - * 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 }; +/** The list of storage sync operations. */ +export interface OperationEntityListResult { + /** The link used to get the next page of operations. */ + nextLink?: string; + /** The list of operations. */ + value?: OperationEntity[]; +} -/** - * Error Details object. - */ -export interface StorageSyncErrorDetails { - /** - * Error code of the given entry. - */ +/** The operation supported by storage sync. */ +export interface OperationEntity { + /** Operation name: {provider}/{resource}/{operation}. */ + name?: string; + /** The operation supported by storage sync. */ + display?: OperationDisplayInfo; + /** The origin. */ + origin?: string; + /** Properties of the operations resource. */ + properties?: OperationProperties; +} + +/** The operation supported by storage sync. */ +export interface OperationDisplayInfo { + /** The description of the operation. */ + description?: string; + /** The action that users can perform, based on their permission level. */ + operation?: string; + /** Service provider: Microsoft StorageSync. */ + provider?: string; + /** Resource on which the operation is performed. */ + resource?: string; +} + +/** Properties of the operations resource. */ +export interface OperationProperties { + /** Service specification for the operations resource. */ + serviceSpecification?: OperationResourceServiceSpecification; +} + +/** Service specification. */ +export interface OperationResourceServiceSpecification { + /** List of metric specifications. */ + metricSpecifications?: OperationResourceMetricSpecification[]; +} + +/** Operation Display Resource object. */ +export interface OperationResourceMetricSpecification { + /** Name of the metric. */ + name?: string; + /** Display name for the metric. */ + displayName?: string; + /** Display description for the metric. */ + displayDescription?: string; + /** Unit for the metric. */ + unit?: string; + /** Aggregation type for the metric. */ + aggregationType?: string; + /** Fill gaps in the metric with zero. */ + fillGapWithZero?: boolean; + /** Dimensions for the metric specification. */ + dimensions?: OperationResourceMetricSpecificationDimension[]; +} + +/** OperationResourceMetricSpecificationDimension object. */ +export interface OperationResourceMetricSpecificationDimension { + /** Name of the dimension. */ + name?: string; + /** Display name of the dimensions. */ + displayName?: string; + /** Indicates metric should be exported for Shoebox. */ + toBeExportedForShoebox?: boolean; +} + +/** Error type */ +export interface StorageSyncError { + /** Error details of the given entry. */ + error?: StorageSyncApiError; + /** Error details of the given entry. */ + innererror?: StorageSyncApiError; +} + +/** Error type */ +export interface StorageSyncApiError { + /** Error code of the given entry. */ code?: string; - /** - * Error message of the given entry. - */ + /** Error message of the given entry. */ message?: string; - /** - * Target of the given entry. - */ + /** Target of the given error entry. */ target?: string; + /** Error details of the given entry. */ + details?: StorageSyncErrorDetails; + /** Inner error details of the given entry. */ + innerError?: StorageSyncInnerErrorDetails; } -/** - * Error type - */ -export interface StorageSyncApiError { - /** - * Error code of the given entry. - */ +/** Error Details object. */ +export interface StorageSyncErrorDetails { + /** Error code of the given entry. */ code?: string; - /** - * Error message of the given entry. - */ + /** Error message of the given entry. */ message?: string; - /** - * Target of the given error entry. - */ + /** Target of the given entry. */ target?: string; - /** - * Error details of the given entry. - */ - details?: StorageSyncErrorDetails; + /** Request URI of the given entry. */ + requestUri?: string; + /** Exception type of the given entry. */ + exceptionType?: string; + /** HTTP method of the given entry. */ + httpMethod?: string; + /** Hashed message of the given entry. */ + hashedMessage?: string; + /** HTTP error code of the given entry. */ + httpErrorCode?: string; +} + +/** Error Details object. */ +export interface StorageSyncInnerErrorDetails { + /** Call stack of the error. */ + callStack?: string; + /** Error message of the error. */ + message?: string; + /** Exception of the inner error. */ + innerException?: string; + /** Call stack of the inner error. */ + innerExceptionCallStack?: string; } -/** - * Error type - */ -export interface StorageSyncError { - /** - * Error details of the given entry. - */ - error?: StorageSyncApiError; - /** - * Error details of the given entry. - */ - innererror?: StorageSyncApiError; +/** Parameters for a check name availability request. */ +export interface CheckNameAvailabilityParameters { + /** The name to check for availability */ + name: string; + /** The resource type. Must be set to Microsoft.StorageSync/storageSyncServices */ + type: "Microsoft.StorageSync/storageSyncServices"; } -/** - * Subscription State object. - */ -export interface SubscriptionState { +/** The CheckNameAvailability operation response. */ +export interface CheckNameAvailabilityResult { /** - * State of Azure Subscription. Possible values include: 'Registered', 'Unregistered', 'Warned', - * 'Suspended', 'Deleted' + * Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - state?: Reason; + readonly nameAvailable?: boolean; /** - * Is Transitioning - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Gets the reason that a Storage Sync Service name could not be used. The Reason element is only returned if NameAvailable is false. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly istransitioning?: boolean; + readonly reason?: NameAvailabilityReason; /** - * Subscription state properties. + * Gets an error message explaining the Reason value in more detail. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties?: any; + readonly message?: string; } -/** - * An interface representing Resource. - */ -export interface Resource extends BaseResource { +/** The parameters used when creating a storage sync service. */ +export interface StorageSyncServiceCreateParameters { + /** Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. */ + location: string; + /** Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. */ + tags?: { [propertyName: string]: string }; + /** Incoming Traffic Policy */ + incomingTrafficPolicy?: IncomingTrafficPolicy; +} + +/** 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. + */ + readonly id?: string; +} + +/** 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. */ + status?: PrivateEndpointServiceConnectionStatus; + /** 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. */ + actionsRequired?: string; +} + +/** 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 resource model definition for a ARM tracked top level resource - */ -export interface TrackedResource extends Resource { - /** - * Resource tags. - */ +/** Parameters for updating an Storage sync service. */ +export interface StorageSyncServiceUpdateParameters { + /** The user-specified tags associated with the storage sync service. */ tags?: { [propertyName: string]: string }; - /** - * The geo-location where the resource lives - */ - location: string; + /** Incoming Traffic Policy */ + incomingTrafficPolicy?: IncomingTrafficPolicy; } -/** - * Storage Sync Service object. - */ -export interface StorageSyncService extends TrackedResource { - /** - * Storage Sync service status. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly storageSyncServiceStatus?: number; - /** - * Storage Sync service Uid - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly storageSyncServiceUid?: string; +/** Array of StorageSyncServices */ +export interface StorageSyncServiceArray { + /** Collection of StorageSyncServices. */ + value?: StorageSyncService[]; } -/** - * The resource model definition for a ARM proxy resource. It will have everything other than - * required location and tags - */ -export interface ProxyResource extends Resource { +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** Array of private link resources */ + value?: PrivateLinkResource[]; } -/** - * Sync Group object. - */ -export interface SyncGroup extends ProxyResource { - /** - * Unique Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly uniqueId?: string; - /** - * Sync group status - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly syncGroupStatus?: string; +/** List of private endpoint connection associated with the specified storage account */ +export interface PrivateEndpointConnectionListResult { + /** Array of private endpoint connections */ + value?: PrivateEndpointConnection[]; } -/** - * Cloud Endpoint object. - */ -export interface CloudEndpoint extends ProxyResource { +/** Array of SyncGroup */ +export interface SyncGroupArray { + /** Collection of SyncGroup. */ + value?: SyncGroup[]; +} + +/** Cloud endpoint change enumeration status object */ +export interface CloudEndpointChangeEnumerationStatus { /** - * Storage Account Resource Id + * Last updated timestamp + * NOTE: This property will not be serialized. It can only be populated by the server. */ - storageAccountResourceId?: string; + readonly lastUpdatedTimestamp?: Date; /** - * Azure file share name + * Status of last completed change enumeration + * NOTE: This property will not be serialized. It can only be populated by the server. */ - azureFileShareName?: string; + readonly lastEnumerationStatus?: CloudEndpointLastChangeEnumerationStatus; /** - * Storage Account Tenant Id + * Change enumeration activity + * NOTE: This property will not be serialized. It can only be populated by the server. */ - storageAccountTenantId?: string; + readonly activity?: CloudEndpointChangeEnumerationActivity; +} + +/** Cloud endpoint change enumeration status object */ +export interface CloudEndpointLastChangeEnumerationStatus { /** - * Partnership Id + * Timestamp when change enumeration started + * NOTE: This property will not be serialized. It can only be populated by the server. */ - partnershipId?: string; + readonly startedTimestamp?: Date; /** - * Friendly Name + * Timestamp when change enumeration completed + * NOTE: This property will not be serialized. It can only be populated by the server. */ - friendlyName?: string; + readonly completedTimestamp?: Date; /** - * Backup Enabled - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Count of files in the namespace + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly backupEnabled?: string; + readonly namespaceFilesCount?: number; /** - * CloudEndpoint Provisioning State + * Count of directories in the namespace + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provisioningState?: string; + readonly namespaceDirectoriesCount?: number; /** - * CloudEndpoint lastWorkflowId + * Namespace size in bytes + * NOTE: This property will not be serialized. It can only be populated by the server. */ - lastWorkflowId?: string; + readonly namespaceSizeBytes?: number; /** - * Resource Last Operation Name + * Timestamp of when change enumeration is expected to run again + * NOTE: This property will not be serialized. It can only be populated by the server. */ - lastOperationName?: string; + readonly nextRunTimestamp?: Date; } -/** - * The parameters used when calling trigger change detection action on cloud endpoint. - */ -export interface TriggerChangeDetectionParameters { +/** Cloud endpoint change enumeration activity object */ +export interface CloudEndpointChangeEnumerationActivity { /** - * Relative path to a directory Azure File share for which change detection is to be performed. + * Last updated timestamp + * NOTE: This property will not be serialized. It can only be populated by the server. */ - directoryPath?: string; + readonly lastUpdatedTimestamp?: Date; /** - * Change Detection Mode. Applies to a directory specified in directoryPath parameter. Possible - * values include: 'Default', 'Recursive' + * Change enumeration operation state + * NOTE: This property will not be serialized. It can only be populated by the server. */ - changeDetectionMode?: ChangeDetectionMode; + readonly operationState?: CloudEndpointChangeEnumerationActivityState; /** - * Array of relative paths on the Azure File share to be included in the change detection. Can be - * files and directories. + * When non-zero, indicates an issue that is delaying change enumeration + * NOTE: This property will not be serialized. It can only be populated by the server. */ - paths?: string[]; -} - -/** - * The parameters used when calling recall action on server endpoint. - */ -export interface RecallActionParameters { + readonly statusCode?: number; /** - * Pattern of the files. + * Timestamp when change enumeration started + * NOTE: This property will not be serialized. It can only be populated by the server. */ - pattern?: string; + readonly startedTimestamp?: Date; /** - * Recall path. + * Count of files processed + * NOTE: This property will not be serialized. It can only be populated by the server. */ - recallPath?: string; -} - -/** - * The parameters used when creating a storage sync service. - */ -export interface StorageSyncServiceCreateParameters { + readonly processedFilesCount?: number; /** - * Required. Gets or sets the location of the resource. This will be one of the supported and - * registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of - * a resource cannot be changed once it is created, but if an identical geo region is specified - * on update, the request will succeed. + * Count of directories processed + * NOTE: This property will not be serialized. It can only be populated by the server. */ - location: string; + readonly processedDirectoriesCount?: number; /** - * Gets or sets a list of key value pairs that describe the resource. These tags can be used for - * viewing and grouping this resource (across resource groups). A maximum of 15 tags can be - * provided for a resource. Each tag must have a key with a length no greater than 128 characters - * and a value with a length no greater than 256 characters. + * Total count of files enumerated + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; - properties?: any; -} - -/** - * The parameters used when creating a sync group. - */ -export interface SyncGroupCreateParameters extends ProxyResource { + readonly totalFilesCount?: number; /** - * The parameters used to create the sync group + * Total count of directories enumerated + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties?: any; -} - -/** - * The parameters used when creating a cloud endpoint. - */ -export interface CloudEndpointCreateParameters extends ProxyResource { + readonly totalDirectoriesCount?: number; /** - * Storage Account Resource Id + * Total enumerated size in bytes + * NOTE: This property will not be serialized. It can only be populated by the server. */ - storageAccountResourceId?: string; + readonly totalSizeBytes?: number; /** - * Azure file share name + * Progress percentage for change enumeration run, excluding processing of deletes + * NOTE: This property will not be serialized. It can only be populated by the server. */ - azureFileShareName?: string; + readonly progressPercent?: number; /** - * Storage Account Tenant Id + * Estimate of time remaining for the enumeration run + * NOTE: This property will not be serialized. It can only be populated by the server. */ - storageAccountTenantId?: string; + readonly minutesRemaining?: number; /** - * Friendly Name + * Change enumeration total counts state + * NOTE: This property will not be serialized. It can only be populated by the server. */ - friendlyName?: string; + readonly totalCountsState?: CloudEndpointChangeEnumerationTotalCountsState; + /** + * Progress percentage for processing deletes. This is done separately from the rest of the enumeration run + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly deletesProgressPercent?: number; } -/** - * The parameters used when creating a server endpoint. - */ -export interface ServerEndpointCreateParameters extends ProxyResource { +/** Array of CloudEndpoint */ +export interface CloudEndpointArray { + /** Collection of CloudEndpoint. */ + value?: CloudEndpoint[]; +} + +/** Backup request */ +export interface BackupRequest { + /** Azure File Share. */ + azureFileShare?: string; +} + +/** Post Backup Response */ +export interface PostBackupResponse { /** - * Server Local path. + * cloud endpoint Name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serverLocalPath?: string; + readonly cloudEndpointName?: string; +} + +/** Pre Restore request object. */ +export interface PreRestoreRequest { + /** Pre Restore partition. */ + partition?: string; + /** Pre Restore replica group. */ + replicaGroup?: string; + /** Pre Restore request id. */ + requestId?: string; + /** Pre Restore Azure file share uri. */ + azureFileShareUri?: string; + /** Pre Restore Azure status. */ + status?: string; + /** Pre Restore Azure source azure file share uri. */ + sourceAzureFileShareUri?: string; + /** Pre Restore backup metadata property bag. */ + backupMetadataPropertyBag?: string; + /** Pre Restore restore file spec array. */ + restoreFileSpec?: RestoreFileSpec[]; + /** Pre Restore pause wait for sync drain time period in seconds. */ + pauseWaitForSyncDrainTimePeriodInSeconds?: number; +} + +/** Restore file spec. */ +export interface RestoreFileSpec { + /** Restore file spec path */ + path?: string; + /** Restore file spec isdir */ + isdir?: boolean; +} + +/** Post Restore Request */ +export interface PostRestoreRequest { + /** Post Restore partition. */ + partition?: string; + /** Post Restore replica group. */ + replicaGroup?: string; + /** Post Restore request id. */ + requestId?: string; + /** Post Restore Azure file share uri. */ + azureFileShareUri?: string; + /** Post Restore Azure status. */ + status?: string; + /** Post Restore Azure source azure file share uri. */ + sourceAzureFileShareUri?: string; + /** Post Restore Azure failed file list. */ + failedFileList?: string; + /** Post Restore restore file spec array. */ + restoreFileSpec?: RestoreFileSpec[]; +} + +/** The parameters used when calling trigger change detection action on cloud endpoint. */ +export interface TriggerChangeDetectionParameters { + /** Relative path to a directory Azure File share for which change detection is to be performed. */ + directoryPath?: string; + /** Change Detection Mode. Applies to a directory specified in directoryPath parameter. */ + changeDetectionMode?: ChangeDetectionMode; + /** Array of relative paths on the Azure File share to be included in the change detection. Can be files and directories. */ + paths?: string[]; +} + +/** Server Endpoint sync status */ +export interface ServerEndpointSyncStatus { /** - * Cloud Tiering. Possible values include: 'on', 'off' + * Download Health Status. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - cloudTiering?: CloudTiering; + readonly downloadHealth?: ServerEndpointHealthState; /** - * Level of free space to be maintained by Cloud Tiering if it is enabled. + * Upload Health Status. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - volumeFreeSpacePercent?: number; + readonly uploadHealth?: ServerEndpointHealthState; /** - * Tier files older than days. + * Combined Health Status. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tierFilesOlderThanDays?: number; + readonly combinedHealth?: ServerEndpointHealthState; /** - * Friendly Name + * Sync activity + * NOTE: This property will not be serialized. It can only be populated by the server. */ - friendlyName?: string; + readonly syncActivity?: ServerEndpointSyncActivityState; /** - * Server Resource Id. + * Total count of persistent files not syncing (combined upload + download). + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serverResourceId?: string; + readonly totalPersistentFilesNotSyncingCount?: number; /** - * Offline data transfer. Possible values include: 'on', 'off' + * Last Updated Timestamp + * NOTE: This property will not be serialized. It can only be populated by the server. */ - offlineDataTransfer?: OfflineDataTransfer; + readonly lastUpdatedTimestamp?: Date; /** - * Offline data transfer share name + * Upload Status + * NOTE: This property will not be serialized. It can only be populated by the server. */ - offlineDataTransferShareName?: string; -} - -/** - * Trigger Rollover Request. - */ -export interface TriggerRolloverRequest { + readonly uploadStatus?: ServerEndpointSyncSessionStatus; /** - * Certificate Data + * Download Status + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serverCertificate?: string; -} - -/** - * The parameters used when creating a registered server. - */ -export interface RegisteredServerCreateParameters extends ProxyResource { + readonly downloadStatus?: ServerEndpointSyncSessionStatus; /** - * Registered Server Certificate + * Upload sync activity + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serverCertificate?: string; + readonly uploadActivity?: ServerEndpointSyncActivityStatus; /** - * Registered Server Agent Version + * Download sync activity + * NOTE: This property will not be serialized. It can only be populated by the server. */ - agentVersion?: string; + readonly downloadActivity?: ServerEndpointSyncActivityStatus; /** - * Registered Server OS Version + * Offline Data Transfer State + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serverOSVersion?: string; + readonly offlineDataTransferStatus?: ServerEndpointOfflineDataTransferState; /** - * Registered Server last heart beat + * Background data download activity + * NOTE: This property will not be serialized. It can only be populated by the server. */ - lastHeartBeat?: string; - /** - * Registered Server serverRole - */ - serverRole?: string; - /** - * Registered Server clusterId - */ - clusterId?: string; - /** - * Registered Server clusterName - */ - clusterName?: string; - /** - * Registered Server serverId - */ - serverId?: string; - /** - * Friendly Name - */ - friendlyName?: string; -} - -/** - * Parameters for updating an Server Endpoint. - */ -export interface ServerEndpointUpdateParameters { - /** - * Cloud Tiering. Possible values include: 'on', 'off' - */ - cloudTiering?: CloudTiering1; - /** - * Level of free space to be maintained by Cloud Tiering if it is enabled. - */ - volumeFreeSpacePercent?: number; - /** - * Tier files older than days. - */ - tierFilesOlderThanDays?: number; - /** - * Offline data transfer. Possible values include: 'on', 'off' - */ - offlineDataTransfer?: OfflineDataTransfer1; - /** - * Offline data transfer share name - */ - offlineDataTransferShareName?: string; + readonly backgroundDataDownloadActivity?: ServerEndpointBackgroundDataDownloadActivity; } -/** - * Files not syncing error object - */ -export interface ServerEndpointFilesNotSyncingError { - /** - * Error code (HResult) - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly errorCode?: number; - /** - * Count of persistent files not syncing with the specified error code - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly persistentCount?: number; - /** - * Count of transient files not syncing with the specified error code - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly transientCount?: number; -} - -/** - * Sync Session status object. - */ +/** Sync Session status object. */ export interface ServerEndpointSyncSessionStatus { /** * Last sync result (HResult) - * **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 lastSyncResult?: number; /** * Last sync timestamp - * **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 lastSyncTimestamp?: Date; /** * Last sync success timestamp - * **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 lastSyncSuccessTimestamp?: Date; /** * Last sync per item error count. - * **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 lastSyncPerItemErrorCount?: number; /** * Count of persistent files not syncing. - * **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 persistentFilesNotSyncingCount?: number; /** * Count of transient files not syncing. - * **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 transientFilesNotSyncingCount?: number; /** * Array of per-item errors coming from the last sync session. - * **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 filesNotSyncingErrors?: ServerEndpointFilesNotSyncingError[]; + /** + * Sync mode + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastSyncMode?: ServerEndpointSyncMode; } -/** - * Sync Session status object. - */ +/** Files not syncing error object */ +export interface ServerEndpointFilesNotSyncingError { + /** + * Error code (HResult) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorCode?: number; + /** + * Count of persistent files not syncing with the specified error code + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly persistentCount?: number; + /** + * Count of transient files not syncing with the specified error code + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly transientCount?: number; +} + +/** Sync Session status object. */ export interface ServerEndpointSyncActivityStatus { /** * Timestamp when properties were updated - * **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 timestamp?: Date; /** * Per item error count - * **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 perItemErrorCount?: number; /** * Applied item count. - * **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 appliedItemCount?: number; /** * Total item count (if 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 totalItemCount?: number; /** * Applied bytes - * **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 appliedBytes?: number; /** * Total bytes (if 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 totalBytes?: number; -} - -/** - * Server Endpoint sync status - */ -export interface ServerEndpointSyncStatus { - /** - * Download Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', - * 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly downloadHealth?: DownloadHealth; - /** - * Upload Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', - * 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly uploadHealth?: UploadHealth; - /** - * Combined Health Status. Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', - * 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly combinedHealth?: CombinedHealth; - /** - * Sync activity. Possible values include: 'Upload', 'Download', 'UploadAndDownload' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly syncActivity?: SyncActivity; - /** - * Total count of persistent files not syncing (combined upload + download). - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly totalPersistentFilesNotSyncingCount?: number; /** - * Last Updated Timestamp - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Sync mode + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastUpdatedTimestamp?: Date; + readonly syncMode?: ServerEndpointSyncMode; /** - * Upload Status - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Session minutes remaining (if available) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly uploadStatus?: ServerEndpointSyncSessionStatus; + readonly sessionMinutesRemaining?: number; +} + +/** Background data download activity object */ +export interface ServerEndpointBackgroundDataDownloadActivity { /** - * Download Status - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Timestamp when properties were updated + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly downloadStatus?: ServerEndpointSyncSessionStatus; + readonly timestamp?: Date; /** - * Upload sync activity - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Timestamp when the operation started + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly uploadActivity?: ServerEndpointSyncActivityStatus; + readonly startedTimestamp?: Date; /** - * Download sync activity - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Progress percentage + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly downloadActivity?: ServerEndpointSyncActivityStatus; + readonly percentProgress?: number; /** - * Offline Data Transfer State. Possible values include: 'InProgress', 'Stopping', 'NotRunning', - * 'Complete' - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Running count of bytes downloaded + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly offlineDataTransferStatus?: OfflineDataTransferStatus; + readonly downloadedBytes?: number; } -/** - * Server endpoint cloud tiering status object. - */ +/** Server endpoint cloud tiering status object. */ export interface ServerEndpointCloudTieringStatus { - /** - * Cloud tiering health state. Possible values include: 'Healthy', 'Error' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly health?: Health; /** * Last updated timestamp - * **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 lastUpdatedTimestamp?: Date; + /** + * Cloud tiering health state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly health?: ServerEndpointHealthState; + /** + * The last updated timestamp of health state + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly healthLastUpdatedTimestamp?: Date; /** * Last cloud tiering result (HResult) - * **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 lastCloudTieringResult?: number; /** * Last cloud tiering success timestamp - * **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 lastSuccessTimestamp?: Date; -} - -/** - * Server endpoint recall error object - */ -export interface ServerEndpointRecallError { /** - * Error code (HResult) - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Information regarding how much local space cloud tiering is saving. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly errorCode?: number; + readonly spaceSavings?: CloudTieringSpaceSavings; /** - * Count of occurences of the error - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Information regarding how well the local cache on the server is performing. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly count?: number; -} - -/** - * Server endpoint recall status object. - */ -export interface ServerEndpointRecallStatus { + readonly cachePerformance?: CloudTieringCachePerformance; /** - * Last updated timestamp - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Information regarding files that failed to be tiered + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastUpdatedTimestamp?: Date; + readonly filesNotTiering?: CloudTieringFilesNotTiering; /** - * Total count of recall errors. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Status of the volume free space policy + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly totalRecallErrorsCount?: number; + readonly volumeFreeSpacePolicyStatus?: CloudTieringVolumeFreeSpacePolicyStatus; /** - * Array of recall errors - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Status of the date policy + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly recallErrors?: ServerEndpointRecallError[]; + readonly datePolicyStatus?: CloudTieringDatePolicyStatus; } -/** - * Server Endpoint object. - */ -export interface ServerEndpoint extends ProxyResource { - /** - * Server Local path. - */ - serverLocalPath?: string; +/** Server endpoint cloud tiering status object. */ +export interface CloudTieringSpaceSavings { /** - * Cloud Tiering. Possible values include: 'on', 'off' + * Last updated timestamp + * NOTE: This property will not be serialized. It can only be populated by the server. */ - cloudTiering?: CloudTiering2; + readonly lastUpdatedTimestamp?: Date; /** - * Level of free space to be maintained by Cloud Tiering if it is enabled. + * Volume size + * NOTE: This property will not be serialized. It can only be populated by the server. */ - volumeFreeSpacePercent?: number; + readonly volumeSizeBytes?: number; /** - * Tier files older than days. + * Total size of content in the azure file share + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tierFilesOlderThanDays?: number; + readonly totalSizeCloudBytes?: number; /** - * Friendly Name + * Cached content size on the server + * NOTE: This property will not be serialized. It can only be populated by the server. */ - friendlyName?: string; + readonly cachedSizeBytes?: number; /** - * Server Resource Id. + * Percentage of cached size over total size + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serverResourceId?: string; + readonly spaceSavingsPercent?: number; /** - * ServerEndpoint Provisioning State - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Count of bytes saved on the server + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: string; + readonly spaceSavingsBytes?: number; +} + +/** Server endpoint cloud tiering status object. */ +export interface CloudTieringCachePerformance { /** - * ServerEndpoint lastWorkflowId - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Last updated timestamp + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastWorkflowId?: string; + readonly lastUpdatedTimestamp?: Date; /** - * Resource Last Operation Name - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Count of bytes that were served from the local server + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly lastOperationName?: string; + readonly cacheHitBytes?: number; /** - * Server Endpoint sync status - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Count of bytes that were served from the cloud + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly syncStatus?: ServerEndpointSyncStatus; + readonly cacheMissBytes?: number; /** - * Offline data transfer. Possible values include: 'on', 'off' + * Percentage of total bytes (hit + miss) that were served from the local server + * NOTE: This property will not be serialized. It can only be populated by the server. */ - offlineDataTransfer?: OfflineDataTransfer2; + readonly cacheHitBytesPercent?: number; +} + +/** Server endpoint cloud tiering status object. */ +export interface CloudTieringFilesNotTiering { /** - * Offline data transfer storage account resource ID - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Last updated timestamp + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly offlineDataTransferStorageAccountResourceId?: string; + readonly lastUpdatedTimestamp?: Date; /** - * Offline data transfer storage account tenant ID - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Last cloud tiering result (HResult) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly offlineDataTransferStorageAccountTenantId?: string; + readonly totalFileCount?: number; /** - * Offline data transfer share name + * Array of tiering errors + * NOTE: This property will not be serialized. It can only be populated by the server. */ - offlineDataTransferShareName?: string; + readonly errors?: FilesNotTieringError[]; +} + +/** Files not tiering error object */ +export interface FilesNotTieringError { /** - * Cloud tiering status. Only populated if cloud tiering is enabled. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Error code (HResult) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly cloudTieringStatus?: ServerEndpointCloudTieringStatus; + readonly errorCode?: number; /** - * Recall status. Only populated if cloud tiering is enabled. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Count of files with this error + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly recallStatus?: ServerEndpointRecallStatus; + readonly fileCount?: number; } -/** - * Registered Server resource. - */ -export interface RegisteredServer extends ProxyResource { +/** Status of the volume free space policy */ +export interface CloudTieringVolumeFreeSpacePolicyStatus { /** - * Registered Server Certificate + * Last updated timestamp + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serverCertificate?: string; + readonly lastUpdatedTimestamp?: Date; /** - * Registered Server Agent Version + * In the case where multiple server endpoints are present in a volume, an effective free space policy is applied. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - agentVersion?: string; + readonly effectiveVolumeFreeSpacePolicy?: number; /** - * Registered Server OS Version + * Current volume free space percentage. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serverOSVersion?: string; + readonly currentVolumeFreeSpacePercent?: number; +} + +/** Status of the date policy */ +export interface CloudTieringDatePolicyStatus { /** - * Registered Server Management Error Code + * Last updated timestamp + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serverManagementErrorCode?: number; + readonly lastUpdatedTimestamp?: Date; /** - * Registered Server last heart beat + * Most recent access time of tiered files + * NOTE: This property will not be serialized. It can only be populated by the server. */ - lastHeartBeat?: string; + readonly tieredFilesMostRecentAccessTimestamp?: Date; +} + +/** Server endpoint recall status object. */ +export interface ServerEndpointRecallStatus { /** - * Registered Server Provisioning State + * Last updated timestamp + * NOTE: This property will not be serialized. It can only be populated by the server. */ - provisioningState?: string; + readonly lastUpdatedTimestamp?: Date; /** - * Registered Server serverRole + * Total count of recall errors. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serverRole?: string; + readonly totalRecallErrorsCount?: number; /** - * Registered Server clusterId + * Array of recall errors + * NOTE: This property will not be serialized. It can only be populated by the server. */ - clusterId?: string; + readonly recallErrors?: ServerEndpointRecallError[]; +} + +/** Server endpoint recall error object */ +export interface ServerEndpointRecallError { /** - * Registered Server clusterName + * Error code (HResult) + * NOTE: This property will not be serialized. It can only be populated by the server. */ - clusterName?: string; + readonly errorCode?: number; /** - * Registered Server serverId + * Count of occurences of the error + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serverId?: string; + readonly count?: number; +} + +/** Parameters for updating an Server Endpoint. */ +export interface ServerEndpointUpdateParameters { + /** Cloud Tiering. */ + cloudTiering?: FeatureStatus; + /** Level of free space to be maintained by Cloud Tiering if it is enabled. */ + volumeFreeSpacePercent?: number; + /** Tier files older than days. */ + tierFilesOlderThanDays?: number; + /** Offline data transfer */ + offlineDataTransfer?: FeatureStatus; + /** Offline data transfer share name */ + offlineDataTransferShareName?: string; + /** Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. */ + localCacheMode?: LocalCacheMode; +} + +/** Array of ServerEndpoint */ +export interface ServerEndpointArray { + /** Collection of ServerEndpoint. */ + value?: ServerEndpoint[]; +} + +/** The parameters used when calling recall action on server endpoint. */ +export interface RecallActionParameters { + /** Pattern of the files. */ + pattern?: string; + /** Recall path. */ + recallPath?: string; +} + +/** Array of RegisteredServer */ +export interface RegisteredServerArray { + /** Collection of Registered Server. */ + value?: RegisteredServer[]; +} + +/** Trigger Rollover Request. */ +export interface TriggerRolloverRequest { + /** Certificate Data */ + serverCertificate?: string; +} + +/** Array of Workflow */ +export interface WorkflowArray { + /** Collection of workflow items. */ + value?: Workflow[]; +} + +/** Operation status object */ +export interface OperationStatus { /** - * Registered Server storageSyncServiceUid + * Operation Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - storageSyncServiceUid?: string; + readonly name?: string; /** - * Registered Server lastWorkflowId + * Operation status + * NOTE: This property will not be serialized. It can only be populated by the server. */ - lastWorkflowId?: string; + readonly status?: string; /** - * Resource Last Operation Name + * Start time of the operation + * NOTE: This property will not be serialized. It can only be populated by the server. */ - lastOperationName?: string; + readonly startTime?: Date; /** - * Resource discoveryEndpointUri + * End time of the operation + * NOTE: This property will not be serialized. It can only be populated by the server. */ - discoveryEndpointUri?: string; + readonly endTime?: Date; /** - * Resource Location + * Error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resourceLocation?: string; + readonly error?: StorageSyncApiError; +} + +/** Operation status object */ +export interface LocationOperationStatus { /** - * Service Location + * Operation resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - serviceLocation?: string; + readonly id?: string; /** - * Friendly Name + * Operation Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - friendlyName?: string; + readonly name?: string; /** - * Management Endpoint Uri + * Operation status + * NOTE: This property will not be serialized. It can only be populated by the server. */ - managementEndpointUri?: string; + readonly status?: string; /** - * Monitoring Configuration + * Start time of the operation + * NOTE: This property will not be serialized. It can only be populated by the server. */ - monitoringConfiguration?: string; -} - -/** - * Resource Move Info. - */ -export interface ResourcesMoveInfo { - /** - * Target resource group. - */ - targetResourceGroup?: string; - /** - * Collection of Resources. - */ - resources?: string[]; -} - -/** - * Workflow resource. - */ -export interface Workflow extends ProxyResource { - /** - * last step name - */ - lastStepName?: string; - /** - * workflow status. Possible values include: 'active', 'expired', 'succeeded', 'aborted', - * 'failed' - */ - status?: Status; + readonly startTime?: Date; /** - * operation direction. Possible values include: 'do', 'undo', 'cancel' + * End time of the operation + * NOTE: This property will not be serialized. It can only be populated by the server. */ - operation?: Operation; + readonly endTime?: Date; /** - * workflow steps + * Error details. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - steps?: string; + readonly error?: StorageSyncApiError; /** - * workflow last operation identifier. + * Percent complete. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - lastOperationId?: string; + readonly percentComplete?: number; } -/** - * The operation supported by storage sync. - */ -export interface OperationDisplayInfo { - /** - * The description of the operation. - */ - description?: string; - /** - * The action that users can perform, based on their permission level. - */ - operation?: string; - /** - * Service provider: Microsoft StorageSync. - */ - provider?: string; +/** Subscription State object. */ +export interface SubscriptionState { + /** State of Azure Subscription */ + state?: Reason; /** - * Resource on which the operation is performed. + * Is Transitioning + * NOTE: This property will not be serialized. It can only be populated by the server. */ - resource?: string; + readonly istransitioning?: boolean; + /** Subscription state properties. */ + properties?: Record; } -/** - * The operation supported by storage sync. - */ -export interface OperationEntity { - /** - * Operation name: {provider}/{resource}/{operation}. - */ - name?: string; - /** - * The operation supported by storage sync. - */ - display?: OperationDisplayInfo; - /** - * The origin. - */ - origin?: string; +/** Resource Move Info. */ +export interface ResourcesMoveInfo { + /** Target resource group. */ + targetResourceGroup?: string; + /** Collection of Resources. */ + resources?: string[]; } -/** - * Operation Display Resource object. - */ +/** Operation Display Resource object. */ export interface OperationDisplayResource { - /** - * Operation Display Resource Provider. - */ + /** Operation Display Resource Provider. */ provider?: string; - /** - * Operation Display Resource. - */ + /** Operation Display Resource. */ resource?: string; - /** - * Operation Display Resource Operation. - */ + /** Operation Display Resource Operation. */ operation?: string; - /** - * Operation Display Resource Description. - */ + /** Operation Display Resource Description. */ description?: string; } -/** - * Parameters for a check name availability request. - */ -export interface CheckNameAvailabilityParameters { +/** 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 name to check for availability + * The provisioning state of the private endpoint connection resource. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - name: string; -} + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +}; -/** - * The CheckNameAvailability operation response. - */ -export interface CheckNameAvailabilityResult { - /** - * Gets a boolean value that indicates whether the name is available for you to use. If true, the - * name is available. If false, the name has already been taken or invalid and cannot be used. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly nameAvailable?: boolean; - /** - * Gets the reason that a Storage Sync Service name could not be used. The Reason element is only - * returned if NameAvailable is false. Possible values include: 'Invalid', 'AlreadyExists' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly reason?: NameAvailabilityReason; - /** - * Gets an error message explaining the Reason value in more detail. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly message?: string; -} +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; -/** - * Restore file spec. - */ -export interface RestoreFileSpec { +/** A private link resource */ +export type PrivateLinkResource = Resource & { /** - * Restore file spec path + * The private link resource group id. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - path?: string; + readonly groupId?: string; /** - * Restore file spec isdir + * The private link resource required member names. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - isdir?: boolean; -} + readonly requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; +}; -/** - * Post Restore Request - */ -export interface PostRestoreRequest { - /** - * Post Restore partition. - */ - partition?: string; - /** - * Post Restore replica group. - */ - replicaGroup?: string; +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export type ProxyResource = Resource & {}; + +/** Storage Sync Service object. */ +export type StorageSyncService = TrackedResource & { + /** Incoming Traffic Policy */ + incomingTrafficPolicy?: IncomingTrafficPolicy; /** - * Post Restore request id. + * Storage Sync service status. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - requestId?: string; + readonly storageSyncServiceStatus?: number; /** - * Post Restore Azure file share uri. + * Storage Sync service Uid + * NOTE: This property will not be serialized. It can only be populated by the server. */ - azureFileShareUri?: string; + readonly storageSyncServiceUid?: string; /** - * Post Restore Azure status. + * StorageSyncService Provisioning State + * NOTE: This property will not be serialized. It can only be populated by the server. */ - status?: string; + readonly provisioningState?: string; /** - * Post Restore Azure source azure file share uri. + * StorageSyncService lastWorkflowId + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sourceAzureFileShareUri?: string; + readonly lastWorkflowId?: string; /** - * Post Restore Azure failed file list. + * Resource Last Operation Name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - failedFileList?: string; + readonly lastOperationName?: string; /** - * Post Restore restore file spec array. + * List of private endpoint connection associated with the specified storage sync service + * NOTE: This property will not be serialized. It can only be populated by the server. */ - restoreFileSpec?: RestoreFileSpec[]; -} + readonly privateEndpointConnections?: PrivateEndpointConnection[]; +}; -/** - * Pre Restore request object. - */ -export interface PreRestoreRequest { - /** - * Pre Restore partition. - */ - partition?: string; +/** Sync Group object. */ +export type SyncGroup = ProxyResource & { /** - * Pre Restore replica group. - */ - replicaGroup?: string; - /** - * Pre Restore request id. - */ - requestId?: string; - /** - * Pre Restore Azure file share uri. - */ - azureFileShareUri?: string; - /** - * Pre Restore Azure status. - */ - status?: string; - /** - * Pre Restore Azure source azure file share uri. + * Unique Id + * NOTE: This property will not be serialized. It can only be populated by the server. */ - sourceAzureFileShareUri?: string; + readonly uniqueId?: string; /** - * Pre Restore backup metadata property bag. + * Sync group status + * NOTE: This property will not be serialized. It can only be populated by the server. */ - backupMetadataPropertyBag?: string; + readonly syncGroupStatus?: string; +}; + +/** The parameters used when creating a sync group. */ +export type SyncGroupCreateParameters = ProxyResource & { + /** The parameters used to create the sync group */ + properties?: Record; +}; + +/** The parameters used when creating a cloud endpoint. */ +export type CloudEndpointCreateParameters = ProxyResource & { + /** Storage Account Resource Id */ + storageAccountResourceId?: string; + /** Azure file share name */ + azureFileShareName?: string; + /** Storage Account Tenant Id */ + storageAccountTenantId?: string; + /** Friendly Name */ + friendlyName?: string; +}; + +/** Cloud Endpoint object. */ +export type CloudEndpoint = ProxyResource & { + /** Storage Account Resource Id */ + storageAccountResourceId?: string; + /** Azure file share name */ + azureFileShareName?: string; + /** Storage Account Tenant Id */ + storageAccountTenantId?: string; + /** Partnership Id */ + partnershipId?: string; + /** Friendly Name */ + friendlyName?: string; /** - * Pre Restore restore file spec array. + * Backup Enabled + * NOTE: This property will not be serialized. It can only be populated by the server. */ - restoreFileSpec?: RestoreFileSpec[]; + readonly backupEnabled?: string; + /** CloudEndpoint Provisioning State */ + provisioningState?: string; + /** CloudEndpoint lastWorkflowId */ + lastWorkflowId?: string; + /** Resource Last Operation Name */ + lastOperationName?: string; /** - * Pre Restore pause wait for sync drain time period in seconds. + * Cloud endpoint change enumeration status + * NOTE: This property will not be serialized. It can only be populated by the server. */ - pauseWaitForSyncDrainTimePeriodInSeconds?: number; -} + readonly changeEnumerationStatus?: CloudEndpointChangeEnumerationStatus; +}; -/** - * Backup request - */ -export interface BackupRequest { - /** - * Azure File Share. - */ - azureFileShare?: string; -} +/** The parameters used when creating a server endpoint. */ +export type ServerEndpointCreateParameters = ProxyResource & { + /** Server Local path. */ + serverLocalPath?: string; + /** Cloud Tiering. */ + cloudTiering?: FeatureStatus; + /** Level of free space to be maintained by Cloud Tiering if it is enabled. */ + volumeFreeSpacePercent?: number; + /** Tier files older than days. */ + tierFilesOlderThanDays?: number; + /** Friendly Name */ + friendlyName?: string; + /** Server Resource Id. */ + serverResourceId?: string; + /** Offline data transfer */ + offlineDataTransfer?: FeatureStatus; + /** Offline data transfer share name */ + offlineDataTransferShareName?: string; + /** Policy for how namespace and files are recalled during FastDr. */ + initialDownloadPolicy?: InitialDownloadPolicy; + /** Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. */ + localCacheMode?: LocalCacheMode; + /** Policy for how the initial upload sync session is performed. */ + initialUploadPolicy?: InitialUploadPolicy; +}; -/** - * Post Backup Response - */ -export interface PostBackupResponse { +/** Server Endpoint object. */ +export type ServerEndpoint = ProxyResource & { + /** Server Local path. */ + serverLocalPath?: string; + /** Cloud Tiering. */ + cloudTiering?: FeatureStatus; + /** Level of free space to be maintained by Cloud Tiering if it is enabled. */ + volumeFreeSpacePercent?: number; + /** Tier files older than days. */ + tierFilesOlderThanDays?: number; + /** Friendly Name */ + friendlyName?: string; + /** Server Resource Id. */ + serverResourceId?: string; /** - * cloud endpoint Name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * ServerEndpoint Provisioning State + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly cloudEndpointName?: string; -} - -/** - * Parameters for updating an Storage sync service. - */ -export interface StorageSyncServiceUpdateParameters { + readonly provisioningState?: string; /** - * The user-specified tags associated with the storage sync service. + * ServerEndpoint lastWorkflowId + * NOTE: This property will not be serialized. It can only be populated by the server. */ - tags?: { [propertyName: string]: string }; + readonly lastWorkflowId?: string; /** - * The properties of the storage sync service. + * Resource Last Operation Name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - properties?: any; -} - -/** - * Operation status object - */ -export interface OperationStatus { + readonly lastOperationName?: string; /** - * Operation Id - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Server Endpoint sync status + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: string; + readonly syncStatus?: ServerEndpointSyncStatus; + /** Offline data transfer */ + offlineDataTransfer?: FeatureStatus; /** - * Operation status - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Offline data transfer storage account resource ID + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: string; + readonly offlineDataTransferStorageAccountResourceId?: string; /** - * Start time of the operation - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Offline data transfer storage account tenant ID + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly startTime?: Date; + readonly offlineDataTransferStorageAccountTenantId?: string; + /** Offline data transfer share name */ + offlineDataTransferShareName?: string; /** - * End time of the operation - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Cloud tiering status. Only populated if cloud tiering is enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly endTime?: Date; + readonly cloudTieringStatus?: ServerEndpointCloudTieringStatus; /** - * Error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Recall status. Only populated if cloud tiering is enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly error?: StorageSyncApiError; -} - -/** - * The resource model definition for a Azure Resource Manager resource with an etag. - */ -export interface AzureEntityResource extends Resource { + readonly recallStatus?: ServerEndpointRecallStatus; + /** Policy for how namespace and files are recalled during FastDr. */ + initialDownloadPolicy?: InitialDownloadPolicy; + /** Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local access. */ + localCacheMode?: LocalCacheMode; + /** Policy for how the initial upload sync session is performed. */ + initialUploadPolicy?: InitialUploadPolicy; /** - * Resource Etag. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * Server name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly etag?: string; -} + readonly serverName?: string; +}; -/** - * Optional Parameters. - */ -export interface StorageSyncServicesUpdateOptionalParams extends msRest.RequestOptionsBase { +/** Registered Server resource. */ +export type RegisteredServer = ProxyResource & { + /** Registered Server Certificate */ + serverCertificate?: string; + /** Registered Server Agent Version */ + agentVersion?: string; /** - * Storage Sync Service resource. + * Registered Server Agent Version Status + * NOTE: This property will not be serialized. It can only be populated by the server. */ - parameters?: StorageSyncServiceUpdateParameters; -} - -/** - * Optional Parameters. - */ -export interface ServerEndpointsUpdateOptionalParams extends msRest.RequestOptionsBase { + readonly agentVersionStatus?: RegisteredServerAgentVersionStatus; /** - * Any of the properties applicable in PUT request. + * Registered Server Agent Version Expiration Date + * NOTE: This property will not be serialized. It can only be populated by the server. */ - parameters?: ServerEndpointUpdateParameters; -} - -/** - * Optional Parameters. - */ -export interface ServerEndpointsBeginUpdateOptionalParams extends msRest.RequestOptionsBase { + readonly agentVersionExpirationDate?: Date; + /** Registered Server OS Version */ + serverOSVersion?: string; + /** Registered Server Management Error Code */ + serverManagementErrorCode?: number; + /** Registered Server last heart beat */ + lastHeartBeat?: string; + /** Registered Server Provisioning State */ + provisioningState?: string; + /** Registered Server serverRole */ + serverRole?: string; + /** Registered Server clusterId */ + clusterId?: string; + /** Registered Server clusterName */ + clusterName?: string; + /** Registered Server serverId */ + serverId?: string; + /** Registered Server storageSyncServiceUid */ + storageSyncServiceUid?: string; + /** Registered Server lastWorkflowId */ + lastWorkflowId?: string; + /** Resource Last Operation Name */ + lastOperationName?: string; + /** Resource discoveryEndpointUri */ + discoveryEndpointUri?: string; + /** Resource Location */ + resourceLocation?: string; + /** Service Location */ + serviceLocation?: string; + /** Friendly Name */ + friendlyName?: string; + /** Management Endpoint Uri */ + managementEndpointUri?: string; + /** Telemetry Endpoint Uri */ + monitoringEndpointUri?: string; + /** Monitoring Configuration */ + monitoringConfiguration?: string; /** - * Any of the properties applicable in PUT request. + * Server name + * NOTE: This property will not be serialized. It can only be populated by the server. */ - parameters?: ServerEndpointUpdateParameters; -} + readonly serverName?: string; +}; -/** - * An interface representing StorageSyncManagementClientOptions. - */ -export interface StorageSyncManagementClientOptions extends AzureServiceClientOptions { - baseUri?: string; -} +/** The parameters used when creating a registered server. */ +export type RegisteredServerCreateParameters = ProxyResource & { + /** Registered Server Certificate */ + serverCertificate?: string; + /** Registered Server Agent Version */ + agentVersion?: string; + /** Registered Server OS Version */ + serverOSVersion?: string; + /** Registered Server last heart beat */ + lastHeartBeat?: string; + /** Registered Server serverRole */ + serverRole?: string; + /** Registered Server clusterId */ + clusterId?: string; + /** Registered Server clusterName */ + clusterName?: string; + /** Registered Server serverId */ + serverId?: string; + /** Friendly Name */ + friendlyName?: string; +}; -/** - * Defines headers for List operation. - */ -export interface OperationsListHeaders { - /** - * request id. - */ - xMsRequestId: string; +/** Workflow resource. */ +export type Workflow = ProxyResource & { + /** last step name */ + lastStepName?: string; + /** workflow status. */ + status?: WorkflowStatus; + /** operation direction. */ + operation?: OperationDirection; + /** workflow steps */ + steps?: string; + /** workflow last operation identifier. */ + lastOperationId?: string; /** - * correlation request id. + * workflow command name. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - xMsCorrelationRequestId: string; -} - -/** - * Defines headers for Get operation. - */ -export interface StorageSyncServicesGetHeaders { + readonly commandName?: string; /** - * request id. + * workflow created timestamp. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - xMsRequestId: string; + readonly createdTimestamp?: Date; /** - * correlation request id. + * workflow last status timestamp. + * NOTE: This property will not be serialized. It can only be populated by the server. */ - xMsCorrelationRequestId: string; + readonly lastStatusTimestamp?: Date; +}; + +/** Defines headers for Operations_list operation. */ +export interface OperationsListHeaders { + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; +} + +/** Defines headers for Operations_listNext operation. */ +export interface OperationsListNextHeaders { + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; +} + +/** Defines headers for StorageSyncServices_create operation. */ +export interface StorageSyncServicesCreateHeaders { + /** Operation Status Location URI */ + azureAsyncOperation?: string; + /** Operation Status Location URI */ + location?: string; + /** Retry After */ + retryAfter?: string; + /** Request id */ + xMsRequestId?: string; + /** correlation request id */ + xMsCorrelationRequestId?: string; +} + +/** Defines headers for StorageSyncServices_get operation. */ +export interface StorageSyncServicesGetHeaders { + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Update operation. - */ +/** Defines headers for StorageSyncServices_update operation. */ export interface StorageSyncServicesUpdateHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Delete operation. - */ +/** Defines headers for StorageSyncServices_delete operation. */ export interface StorageSyncServicesDeleteHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for ListByResourceGroup operation. - */ +/** Defines headers for StorageSyncServices_listByResourceGroup operation. */ export interface StorageSyncServicesListByResourceGroupHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for ListBySubscription operation. - */ +/** Defines headers for StorageSyncServices_listBySubscription operation. */ export interface StorageSyncServicesListBySubscriptionHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; -} - -/** - * Defines headers for ListByStorageSyncService operation. - */ + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; +} + +/** Defines headers for PrivateEndpointConnections_create operation. */ +export interface PrivateEndpointConnectionsCreateHeaders { + /** Operation Status Location URI */ + azureAsyncOperation?: string; + /** Operation Status Location URI */ + location?: string; + /** Retry After */ + retryAfter?: string; + /** Request id */ + xMsRequestId?: string; + /** correlation request id */ + xMsCorrelationRequestId?: string; +} + +/** Defines headers for PrivateEndpointConnections_delete operation. */ +export interface PrivateEndpointConnectionsDeleteHeaders { + /** Operation Status Location URI */ + azureAsyncOperation?: string; + /** Operation Status Location URI */ + location?: string; + /** Retry After */ + retryAfter?: string; + /** Request id */ + xMsRequestId?: string; + /** correlation request id */ + xMsCorrelationRequestId?: string; +} + +/** Defines headers for PrivateEndpointConnections_listByStorageSyncService operation. */ +export interface PrivateEndpointConnectionsListByStorageSyncServiceHeaders { + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; +} + +/** Defines headers for SyncGroups_listByStorageSyncService operation. */ export interface SyncGroupsListByStorageSyncServiceHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Create operation. - */ +/** Defines headers for SyncGroups_create operation. */ export interface SyncGroupsCreateHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Get operation. - */ +/** Defines headers for SyncGroups_get operation. */ export interface SyncGroupsGetHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Delete operation. - */ +/** Defines headers for SyncGroups_delete operation. */ export interface SyncGroupsDeleteHeaders { - /** - * Request id - */ - xMsRequestId: string; - /** - * correlation request id - */ - xMsCorrelationRequestId: string; + /** Request id */ + xMsRequestId?: string; + /** correlation request id */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Create operation. - */ +/** Defines headers for CloudEndpoints_create operation. */ export interface CloudEndpointsCreateHeaders { - /** - * Request id - */ - xMsRequestId: string; - /** - * correlation request id - */ - xMsCorrelationRequestId: string; - /** - * Operation Status Location URI - */ - azureAsyncOperation: string; - /** - * Operation Status Location URI - */ - location: string; - /** - * Retry After - */ - retryAfter: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Get operation. - */ +/** Defines headers for CloudEndpoints_get operation. */ export interface CloudEndpointsGetHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Delete operation. - */ +/** Defines headers for CloudEndpoints_delete operation. */ export interface CloudEndpointsDeleteHeaders { - /** - * Request id - */ - xMsRequestId: string; - /** - * correlation request id - */ - xMsCorrelationRequestId: string; - /** - * Operation Status Location URI - */ - azureAsyncOperation: string; - /** - * Operation Status Location URI - */ - location: string; - /** - * Retry After - */ - retryAfter: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for ListBySyncGroup operation. - */ +/** Defines headers for CloudEndpoints_listBySyncGroup operation. */ export interface CloudEndpointsListBySyncGroupHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for PreBackup operation. - */ +/** Defines headers for CloudEndpoints_preBackup operation. */ export interface CloudEndpointsPreBackupHeaders { - /** - * Operation Status Location URI - */ - location: string; - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** Operation Status Location URI */ + location?: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for PostBackup operation. - */ +/** Defines headers for CloudEndpoints_postBackup operation. */ export interface CloudEndpointsPostBackupHeaders { - /** - * Operation Status Location URI - */ - location: string; - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** Operation Status Location URI */ + location?: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for PreRestore operation. - */ +/** Defines headers for CloudEndpoints_preRestore operation. */ export interface CloudEndpointsPreRestoreHeaders { - /** - * Operation Status Location URI - */ - location: string; - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** Operation Status Location URI */ + location?: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for restoreheartbeat operation. - */ +/** Defines headers for CloudEndpoints_restoreheartbeat operation. */ export interface CloudEndpointsRestoreheartbeatHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for PostRestore operation. - */ +/** Defines headers for CloudEndpoints_postRestore operation. */ export interface CloudEndpointsPostRestoreHeaders { - /** - * Operation Status Location URI - */ - location: string; - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** Operation Status Location URI */ + location?: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for TriggerChangeDetection operation. - */ +/** Defines headers for CloudEndpoints_triggerChangeDetection operation. */ export interface CloudEndpointsTriggerChangeDetectionHeaders { - /** - * Operation Status Location URI - */ - location: string; - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** Operation Status Location URI */ + location?: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Create operation. - */ +/** Defines headers for ServerEndpoints_create operation. */ export interface ServerEndpointsCreateHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; - /** - * Operation Status Location URI - */ - azureAsyncOperation: string; - /** - * Operation Status Location URI - */ - location: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Update operation. - */ +/** Defines headers for ServerEndpoints_update operation. */ export interface ServerEndpointsUpdateHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; - /** - * Operation Status Location URI - */ - azureAsyncOperation: string; - /** - * Operation Status Location URI - */ - location: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Get operation. - */ +/** Defines headers for ServerEndpoints_get operation. */ export interface ServerEndpointsGetHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Delete operation. - */ +/** Defines headers for ServerEndpoints_delete operation. */ export interface ServerEndpointsDeleteHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; - /** - * Operation Status Location URI - */ - location: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for ListBySyncGroup operation. - */ +/** Defines headers for ServerEndpoints_listBySyncGroup operation. */ export interface ServerEndpointsListBySyncGroupHeaders { - /** - * Operation Status Location URI - */ - location: string; - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** Operation Status Location URI */ + location?: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for recallAction operation. - */ +/** Defines headers for ServerEndpoints_recallAction operation. */ export interface ServerEndpointsRecallActionHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; - /** - * Operation Status Location URI - */ - location: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for ListByStorageSyncService operation. - */ +/** Defines headers for RegisteredServers_listByStorageSyncService operation. */ export interface RegisteredServersListByStorageSyncServiceHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Get operation. - */ +/** Defines headers for RegisteredServers_get operation. */ export interface RegisteredServersGetHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Create operation. - */ +/** Defines headers for RegisteredServers_create operation. */ export interface RegisteredServersCreateHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; - /** - * Operation Status Location URI - */ - azureAsyncOperation: string; - /** - * Operation Status Location URI - */ - location: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } - -/** - * Defines headers for Delete operation. - */ + +/** Defines headers for RegisteredServers_delete operation. */ export interface RegisteredServersDeleteHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; - /** - * Operation Status Location URI - */ - location: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for triggerRollover operation. - */ +/** Defines headers for RegisteredServers_triggerRollover operation. */ export interface RegisteredServersTriggerRolloverHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; - /** - * Operation Status Location URI - */ - location: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for ListByStorageSyncService operation. - */ +/** Defines headers for Workflows_listByStorageSyncService operation. */ export interface WorkflowsListByStorageSyncServiceHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Get operation. - */ +/** Defines headers for Workflows_get operation. */ export interface WorkflowsGetHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Abort operation. - */ +/** Defines headers for Workflows_abort operation. */ export interface WorkflowsAbortHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * Defines headers for Get operation. - */ +/** Defines headers for OperationStatus_get operation. */ export interface OperationStatusGetHeaders { - /** - * request id. - */ - xMsRequestId: string; - /** - * correlation request id. - */ - xMsCorrelationRequestId: string; + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * @interface - * The list of storage sync operations. - * @extends Array - */ -export interface OperationEntityListResult extends Array { - /** - * The link used to get the next page of operations. - */ - nextLink?: string; +/** Defines headers for MicrosoftStorageSync_locationOperationStatus operation. */ +export interface MicrosoftStorageSyncLocationOperationStatusHeaders { + /** request id. */ + xMsRequestId?: string; + /** correlation request id. */ + xMsCorrelationRequestId?: string; } -/** - * @interface - * Array of StorageSyncServices - * @extends Array - */ -export interface StorageSyncServiceArray extends Array { +/** Known values of {@link IncomingTrafficPolicy} that the service accepts. */ +export enum KnownIncomingTrafficPolicy { + AllowAllTraffic = "AllowAllTraffic", + AllowVirtualNetworksOnly = "AllowVirtualNetworksOnly" } /** - * @interface - * Array of SyncGroup - * @extends Array + * Defines values for IncomingTrafficPolicy. \ + * {@link KnownIncomingTrafficPolicy} can be used interchangeably with IncomingTrafficPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AllowAllTraffic** \ + * **AllowVirtualNetworksOnly** */ -export interface SyncGroupArray extends Array { +export type IncomingTrafficPolicy = string; + +/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + Pending = "Pending", + Approved = "Approved", + Rejected = "Rejected" } /** - * @interface - * Array of CloudEndpoint - * @extends Array + * 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 interface CloudEndpointArray extends Array { +export type PrivateEndpointServiceConnectionStatus = string; + +/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + Succeeded = "Succeeded", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed" } /** - * @interface - * Array of ServerEndpoint - * @extends Array + * 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 interface ServerEndpointArray extends Array { +export type PrivateEndpointConnectionProvisioningState = string; + +/** Known values of {@link CloudEndpointChangeEnumerationActivityState} that the service accepts. */ +export enum KnownCloudEndpointChangeEnumerationActivityState { + InitialEnumerationInProgress = "InitialEnumerationInProgress", + EnumerationInProgress = "EnumerationInProgress" } /** - * @interface - * Array of RegisteredServer - * @extends Array + * Defines values for CloudEndpointChangeEnumerationActivityState. \ + * {@link KnownCloudEndpointChangeEnumerationActivityState} can be used interchangeably with CloudEndpointChangeEnumerationActivityState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **InitialEnumerationInProgress** \ + * **EnumerationInProgress** */ -export interface RegisteredServerArray extends Array { +export type CloudEndpointChangeEnumerationActivityState = string; + +/** Known values of {@link CloudEndpointChangeEnumerationTotalCountsState} that the service accepts. */ +export enum KnownCloudEndpointChangeEnumerationTotalCountsState { + Calculating = "Calculating", + Final = "Final" } /** - * @interface - * Array of Workflow - * @extends Array + * Defines values for CloudEndpointChangeEnumerationTotalCountsState. \ + * {@link KnownCloudEndpointChangeEnumerationTotalCountsState} can be used interchangeably with CloudEndpointChangeEnumerationTotalCountsState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Calculating** \ + * **Final** */ -export interface WorkflowArray extends Array { +export type CloudEndpointChangeEnumerationTotalCountsState = string; + +/** Known values of {@link ChangeDetectionMode} that the service accepts. */ +export enum KnownChangeDetectionMode { + Default = "Default", + Recursive = "Recursive" } /** - * Defines values for Reason. - * Possible values include: 'Registered', 'Unregistered', 'Warned', 'Suspended', 'Deleted' - * @readonly - * @enum {string} + * Defines values for ChangeDetectionMode. \ + * {@link KnownChangeDetectionMode} can be used interchangeably with ChangeDetectionMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default** \ + * **Recursive** */ -export type Reason = 'Registered' | 'Unregistered' | 'Warned' | 'Suspended' | 'Deleted'; +export type ChangeDetectionMode = string; -/** - * Defines values for ChangeDetectionMode. - * Possible values include: 'Default', 'Recursive' - * @readonly - * @enum {string} - */ -export type ChangeDetectionMode = 'Default' | 'Recursive'; +/** Known values of {@link FeatureStatus} that the service accepts. */ +export enum KnownFeatureStatus { + On = "on", + Off = "off" +} /** - * Defines values for NameAvailabilityReason. - * Possible values include: 'Invalid', 'AlreadyExists' - * @readonly - * @enum {string} + * Defines values for FeatureStatus. \ + * {@link KnownFeatureStatus} can be used interchangeably with FeatureStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **on** \ + * **off** */ -export type NameAvailabilityReason = 'Invalid' | 'AlreadyExists'; +export type FeatureStatus = string; -/** - * Defines values for CloudTiering. - * Possible values include: 'on', 'off' - * @readonly - * @enum {string} - */ -export type CloudTiering = 'on' | 'off'; +/** Known values of {@link InitialDownloadPolicy} that the service accepts. */ +export enum KnownInitialDownloadPolicy { + NamespaceOnly = "NamespaceOnly", + NamespaceThenModifiedFiles = "NamespaceThenModifiedFiles", + AvoidTieredFiles = "AvoidTieredFiles" +} /** - * Defines values for OfflineDataTransfer. - * Possible values include: 'on', 'off' - * @readonly - * @enum {string} + * Defines values for InitialDownloadPolicy. \ + * {@link KnownInitialDownloadPolicy} can be used interchangeably with InitialDownloadPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NamespaceOnly** \ + * **NamespaceThenModifiedFiles** \ + * **AvoidTieredFiles** */ -export type OfflineDataTransfer = 'on' | 'off'; +export type InitialDownloadPolicy = string; -/** - * Defines values for CloudTiering1. - * Possible values include: 'on', 'off' - * @readonly - * @enum {string} - */ -export type CloudTiering1 = 'on' | 'off'; +/** Known values of {@link LocalCacheMode} that the service accepts. */ +export enum KnownLocalCacheMode { + DownloadNewAndModifiedFiles = "DownloadNewAndModifiedFiles", + UpdateLocallyCachedFiles = "UpdateLocallyCachedFiles" +} /** - * Defines values for OfflineDataTransfer1. - * Possible values include: 'on', 'off' - * @readonly - * @enum {string} + * Defines values for LocalCacheMode. \ + * {@link KnownLocalCacheMode} can be used interchangeably with LocalCacheMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **DownloadNewAndModifiedFiles** \ + * **UpdateLocallyCachedFiles** */ -export type OfflineDataTransfer1 = 'on' | 'off'; +export type LocalCacheMode = string; -/** - * Defines values for DownloadHealth. - * Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', - * 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - * @readonly - * @enum {string} - */ -export type DownloadHealth = 'Healthy' | 'Error' | 'SyncBlockedForRestore' | 'SyncBlockedForChangeDetectionPostRestore' | 'NoActivity'; +/** Known values of {@link InitialUploadPolicy} that the service accepts. */ +export enum KnownInitialUploadPolicy { + ServerAuthoritative = "ServerAuthoritative", + Merge = "Merge" +} /** - * Defines values for UploadHealth. - * Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', - * 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - * @readonly - * @enum {string} + * Defines values for InitialUploadPolicy. \ + * {@link KnownInitialUploadPolicy} can be used interchangeably with InitialUploadPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ServerAuthoritative** \ + * **Merge** */ -export type UploadHealth = 'Healthy' | 'Error' | 'SyncBlockedForRestore' | 'SyncBlockedForChangeDetectionPostRestore' | 'NoActivity'; +export type InitialUploadPolicy = string; -/** - * Defines values for CombinedHealth. - * Possible values include: 'Healthy', 'Error', 'SyncBlockedForRestore', - * 'SyncBlockedForChangeDetectionPostRestore', 'NoActivity' - * @readonly - * @enum {string} - */ -export type CombinedHealth = 'Healthy' | 'Error' | 'SyncBlockedForRestore' | 'SyncBlockedForChangeDetectionPostRestore' | 'NoActivity'; +/** Known values of {@link ServerEndpointHealthState} that the service accepts. */ +export enum KnownServerEndpointHealthState { + Unavailable = "Unavailable", + Healthy = "Healthy", + Error = "Error" +} /** - * Defines values for SyncActivity. - * Possible values include: 'Upload', 'Download', 'UploadAndDownload' - * @readonly - * @enum {string} + * Defines values for ServerEndpointHealthState. \ + * {@link KnownServerEndpointHealthState} can be used interchangeably with ServerEndpointHealthState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unavailable** \ + * **Healthy** \ + * **Error** */ -export type SyncActivity = 'Upload' | 'Download' | 'UploadAndDownload'; +export type ServerEndpointHealthState = string; -/** - * Defines values for OfflineDataTransferStatus. - * Possible values include: 'InProgress', 'Stopping', 'NotRunning', 'Complete' - * @readonly - * @enum {string} - */ -export type OfflineDataTransferStatus = 'InProgress' | 'Stopping' | 'NotRunning' | 'Complete'; +/** Known values of {@link ServerEndpointSyncActivityState} that the service accepts. */ +export enum KnownServerEndpointSyncActivityState { + Upload = "Upload", + Download = "Download", + UploadAndDownload = "UploadAndDownload" +} /** - * Defines values for Health. - * Possible values include: 'Healthy', 'Error' - * @readonly - * @enum {string} + * Defines values for ServerEndpointSyncActivityState. \ + * {@link KnownServerEndpointSyncActivityState} can be used interchangeably with ServerEndpointSyncActivityState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Upload** \ + * **Download** \ + * **UploadAndDownload** */ -export type Health = 'Healthy' | 'Error'; +export type ServerEndpointSyncActivityState = string; -/** - * Defines values for CloudTiering2. - * Possible values include: 'on', 'off' - * @readonly - * @enum {string} - */ -export type CloudTiering2 = 'on' | 'off'; +/** Known values of {@link ServerEndpointSyncMode} that the service accepts. */ +export enum KnownServerEndpointSyncMode { + Regular = "Regular", + NamespaceDownload = "NamespaceDownload", + InitialUpload = "InitialUpload", + SnapshotUpload = "SnapshotUpload", + InitialFullDownload = "InitialFullDownload" +} /** - * Defines values for OfflineDataTransfer2. - * Possible values include: 'on', 'off' - * @readonly - * @enum {string} + * Defines values for ServerEndpointSyncMode. \ + * {@link KnownServerEndpointSyncMode} can be used interchangeably with ServerEndpointSyncMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Regular** \ + * **NamespaceDownload** \ + * **InitialUpload** \ + * **SnapshotUpload** \ + * **InitialFullDownload** */ -export type OfflineDataTransfer2 = 'on' | 'off'; +export type ServerEndpointSyncMode = string; -/** - * Defines values for Status. - * Possible values include: 'active', 'expired', 'succeeded', 'aborted', 'failed' - * @readonly - * @enum {string} - */ -export type Status = 'active' | 'expired' | 'succeeded' | 'aborted' | 'failed'; +/** Known values of {@link ServerEndpointOfflineDataTransferState} that the service accepts. */ +export enum KnownServerEndpointOfflineDataTransferState { + InProgress = "InProgress", + Stopping = "Stopping", + NotRunning = "NotRunning", + Complete = "Complete" +} /** - * Defines values for Operation. - * Possible values include: 'do', 'undo', 'cancel' - * @readonly - * @enum {string} + * Defines values for ServerEndpointOfflineDataTransferState. \ + * {@link KnownServerEndpointOfflineDataTransferState} can be used interchangeably with ServerEndpointOfflineDataTransferState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **InProgress** \ + * **Stopping** \ + * **NotRunning** \ + * **Complete** */ -export type Operation = 'do' | 'undo' | 'cancel'; +export type ServerEndpointOfflineDataTransferState = string; -/** - * Contains response data for the list operation. - */ -export type OperationsListResponse = OperationEntityListResult & OperationsListHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: OperationsListHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationEntityListResult; - }; -}; +/** Known values of {@link RegisteredServerAgentVersionStatus} that the service accepts. */ +export enum KnownRegisteredServerAgentVersionStatus { + Ok = "Ok", + NearExpiry = "NearExpiry", + Expired = "Expired", + Blocked = "Blocked" +} /** - * Contains response data for the checkNameAvailability operation. + * Defines values for RegisteredServerAgentVersionStatus. \ + * {@link KnownRegisteredServerAgentVersionStatus} can be used interchangeably with RegisteredServerAgentVersionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Ok** \ + * **NearExpiry** \ + * **Expired** \ + * **Blocked** */ -export type StorageSyncServicesCheckNameAvailabilityResponse = CheckNameAvailabilityResult & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +export type RegisteredServerAgentVersionStatus = string; - /** - * The response body as parsed JSON or XML - */ - parsedBody: CheckNameAvailabilityResult; - }; -}; +/** Known values of {@link WorkflowStatus} that the service accepts. */ +export enum KnownWorkflowStatus { + Active = "active", + Expired = "expired", + Succeeded = "succeeded", + Aborted = "aborted", + Failed = "failed" +} -/** - * Contains response data for the create operation. - */ -export type StorageSyncServicesCreateResponse = StorageSyncService & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; +/** + * Defines values for WorkflowStatus. \ + * {@link KnownWorkflowStatus} can be used interchangeably with WorkflowStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **active** \ + * **expired** \ + * **succeeded** \ + * **aborted** \ + * **failed** + */ +export type WorkflowStatus = string; + +/** Known values of {@link OperationDirection} that the service accepts. */ +export enum KnownOperationDirection { + Do = "do", + Undo = "undo", + Cancel = "cancel" +} + +/** + * Defines values for OperationDirection. \ + * {@link KnownOperationDirection} can be used interchangeably with OperationDirection, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **do** \ + * **undo** \ + * **cancel** + */ +export type OperationDirection = string; + +/** Known values of {@link Reason} that the service accepts. */ +export enum KnownReason { + Registered = "Registered", + Unregistered = "Unregistered", + Warned = "Warned", + Suspended = "Suspended", + Deleted = "Deleted" +} + +/** + * Defines values for Reason. \ + * {@link KnownReason} can be used interchangeably with Reason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Registered** \ + * **Unregistered** \ + * **Warned** \ + * **Suspended** \ + * **Deleted** + */ +export type Reason = string; + +/** Known values of {@link ProgressType} that the service accepts. */ +export enum KnownProgressType { + None = "none", + Initialize = "initialize", + Download = "download", + Upload = "upload", + Recall = "recall" +} + +/** + * Defines values for ProgressType. \ + * {@link KnownProgressType} can be used interchangeably with ProgressType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **none** \ + * **initialize** \ + * **download** \ + * **upload** \ + * **recall** + */ +export type ProgressType = string; +/** Defines values for NameAvailabilityReason. */ +export type NameAvailabilityReason = "Invalid" | "AlreadyExists"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationsListHeaders & + OperationEntityListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationsListNextHeaders & + OperationEntityListResult; + +/** Optional parameters. */ +export interface StorageSyncServicesCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type StorageSyncServicesCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +/** Optional parameters. */ +export interface StorageSyncServicesCreateOptionalParams + 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 create operation. */ +export type StorageSyncServicesCreateResponse = StorageSyncService; + +/** Optional parameters. */ +export interface StorageSyncServicesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type StorageSyncServicesGetResponse = StorageSyncServicesGetHeaders & + StorageSyncService; + +/** Optional parameters. */ +export interface StorageSyncServicesUpdateOptionalParams + extends coreClient.OperationOptions { + /** Storage Sync Service resource. */ + parameters?: StorageSyncServiceUpdateParameters; + /** 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: StorageSyncService; - }; -}; +/** Contains response data for the update operation. */ +export type StorageSyncServicesUpdateResponse = StorageSyncServicesUpdateHeaders & + StorageSyncService; -/** - * Contains response data for the get operation. - */ -export type StorageSyncServicesGetResponse = StorageSyncService & StorageSyncServicesGetHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: StorageSyncServicesGetHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageSyncService; - }; -}; +/** Optional parameters. */ +export interface StorageSyncServicesDeleteOptionalParams + 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 StorageSyncServicesUpdateResponse = StorageSyncService & StorageSyncServicesUpdateHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: StorageSyncServicesUpdateHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageSyncService; - }; -}; +/** Contains response data for the delete operation. */ +export type StorageSyncServicesDeleteResponse = StorageSyncServicesDeleteHeaders; -/** - * Contains response data for the deleteMethod operation. - */ -export type StorageSyncServicesDeleteResponse = StorageSyncServicesDeleteHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: StorageSyncServicesDeleteHeaders; - }; -}; +/** Optional parameters. */ +export interface StorageSyncServicesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByResourceGroup operation. - */ -export type StorageSyncServicesListByResourceGroupResponse = StorageSyncServiceArray & StorageSyncServicesListByResourceGroupHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: StorageSyncServicesListByResourceGroupHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageSyncServiceArray; - }; -}; +/** Contains response data for the listByResourceGroup operation. */ +export type StorageSyncServicesListByResourceGroupResponse = StorageSyncServicesListByResourceGroupHeaders & + StorageSyncServiceArray; -/** - * Contains response data for the listBySubscription operation. - */ -export type StorageSyncServicesListBySubscriptionResponse = StorageSyncServiceArray & StorageSyncServicesListBySubscriptionHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: StorageSyncServicesListBySubscriptionHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: StorageSyncServiceArray; - }; -}; +/** Optional parameters. */ +export interface StorageSyncServicesListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the listByStorageSyncService operation. - */ -export type SyncGroupsListByStorageSyncServiceResponse = SyncGroupArray & SyncGroupsListByStorageSyncServiceHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: SyncGroupsListByStorageSyncServiceHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SyncGroupArray; - }; -}; +/** Contains response data for the listBySubscription operation. */ +export type StorageSyncServicesListBySubscriptionResponse = StorageSyncServicesListBySubscriptionHeaders & + StorageSyncServiceArray; -/** - * Contains response data for the create operation. - */ -export type SyncGroupsCreateResponse = SyncGroup & SyncGroupsCreateHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: SyncGroupsCreateHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SyncGroup; - }; -}; +/** Optional parameters. */ +export interface PrivateLinkResourcesListByStorageSyncServiceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type SyncGroupsGetResponse = SyncGroup & SyncGroupsGetHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: SyncGroupsGetHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SyncGroup; - }; -}; +/** Contains response data for the listByStorageSyncService operation. */ +export type PrivateLinkResourcesListByStorageSyncServiceResponse = PrivateLinkResourceListResult; -/** - * Contains response data for the deleteMethod operation. - */ -export type SyncGroupsDeleteResponse = SyncGroupsDeleteHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: SyncGroupsDeleteHeaders; - }; -}; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the create operation. - */ -export type CloudEndpointsCreateResponse = CloudEndpoint & CloudEndpointsCreateHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CloudEndpointsCreateHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CloudEndpoint; - }; -}; +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; -/** - * Contains response data for the get operation. - */ -export type CloudEndpointsGetResponse = CloudEndpoint & CloudEndpointsGetHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CloudEndpointsGetHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CloudEndpoint; - }; -}; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOptionalParams + 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 deleteMethod operation. - */ -export type CloudEndpointsDeleteResponse = CloudEndpointsDeleteHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CloudEndpointsDeleteHeaders; - }; -}; +/** Contains response data for the create operation. */ +export type PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; -/** - * Contains response data for the listBySyncGroup operation. - */ -export type CloudEndpointsListBySyncGroupResponse = CloudEndpointArray & CloudEndpointsListBySyncGroupHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CloudEndpointsListBySyncGroupHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: CloudEndpointArray; - }; -}; +/** 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; +} -/** - * Contains response data for the preBackup operation. - */ -export type CloudEndpointsPreBackupResponse = CloudEndpointsPreBackupHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CloudEndpointsPreBackupHeaders; - }; -}; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListByStorageSyncServiceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the postBackup operation. - */ -export type CloudEndpointsPostBackupResponse = PostBackupResponse & CloudEndpointsPostBackupHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CloudEndpointsPostBackupHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PostBackupResponse; - }; -}; +/** Contains response data for the listByStorageSyncService operation. */ +export type PrivateEndpointConnectionsListByStorageSyncServiceResponse = PrivateEndpointConnectionsListByStorageSyncServiceHeaders & + PrivateEndpointConnectionListResult; -/** - * Contains response data for the preRestore operation. - */ -export type CloudEndpointsPreRestoreResponse = CloudEndpointsPreRestoreHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CloudEndpointsPreRestoreHeaders; - }; -}; +/** Optional parameters. */ +export interface SyncGroupsListByStorageSyncServiceOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the restoreheartbeat operation. - */ -export type CloudEndpointsRestoreheartbeatResponse = CloudEndpointsRestoreheartbeatHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CloudEndpointsRestoreheartbeatHeaders; - }; -}; +/** Contains response data for the listByStorageSyncService operation. */ +export type SyncGroupsListByStorageSyncServiceResponse = SyncGroupsListByStorageSyncServiceHeaders & + SyncGroupArray; -/** - * Contains response data for the postRestore operation. - */ -export type CloudEndpointsPostRestoreResponse = CloudEndpointsPostRestoreHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CloudEndpointsPostRestoreHeaders; - }; -}; +/** Optional parameters. */ +export interface SyncGroupsCreateOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the triggerChangeDetection operation. - */ -export type CloudEndpointsTriggerChangeDetectionResponse = CloudEndpointsTriggerChangeDetectionHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: CloudEndpointsTriggerChangeDetectionHeaders; - }; -}; +/** Contains response data for the create operation. */ +export type SyncGroupsCreateResponse = SyncGroupsCreateHeaders & SyncGroup; -/** - * Contains response data for the create operation. - */ -export type ServerEndpointsCreateResponse = ServerEndpoint & ServerEndpointsCreateHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: ServerEndpointsCreateHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServerEndpoint; - }; -}; +/** Optional parameters. */ +export interface SyncGroupsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the update operation. - */ -export type ServerEndpointsUpdateResponse = ServerEndpoint & ServerEndpointsUpdateHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: ServerEndpointsUpdateHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServerEndpoint; - }; -}; +/** Contains response data for the get operation. */ +export type SyncGroupsGetResponse = SyncGroupsGetHeaders & SyncGroup; -/** - * Contains response data for the get operation. - */ -export type ServerEndpointsGetResponse = ServerEndpoint & ServerEndpointsGetHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: ServerEndpointsGetHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServerEndpoint; - }; -}; +/** Optional parameters. */ +export interface SyncGroupsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the delete operation. */ +export type SyncGroupsDeleteResponse = SyncGroupsDeleteHeaders; -/** - * Contains response data for the deleteMethod operation. - */ -export type ServerEndpointsDeleteResponse = ServerEndpointsDeleteHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: ServerEndpointsDeleteHeaders; - }; -}; +/** Optional parameters. */ +export interface CloudEndpointsCreateOptionalParams + 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 listBySyncGroup operation. - */ -export type ServerEndpointsListBySyncGroupResponse = ServerEndpointArray & ServerEndpointsListBySyncGroupHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: ServerEndpointsListBySyncGroupHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ServerEndpointArray; - }; -}; +/** Contains response data for the create operation. */ +export type CloudEndpointsCreateResponse = CloudEndpointsCreateHeaders & + CloudEndpoint; -/** - * Contains response data for the recallAction operation. - */ -export type ServerEndpointsRecallActionResponse = ServerEndpointsRecallActionHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: ServerEndpointsRecallActionHeaders; - }; -}; +/** Optional parameters. */ +export interface CloudEndpointsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CloudEndpointsGetResponse = CloudEndpointsGetHeaders & + CloudEndpoint; + +/** Optional parameters. */ +export interface CloudEndpointsDeleteOptionalParams + 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 delete operation. */ +export type CloudEndpointsDeleteResponse = CloudEndpointsDeleteHeaders; + +/** Optional parameters. */ +export interface CloudEndpointsListBySyncGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySyncGroup operation. */ +export type CloudEndpointsListBySyncGroupResponse = CloudEndpointsListBySyncGroupHeaders & + CloudEndpointArray; + +/** Optional parameters. */ +export interface CloudEndpointsPreBackupOptionalParams + 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 listByStorageSyncService operation. - */ -export type RegisteredServersListByStorageSyncServiceResponse = RegisteredServerArray & RegisteredServersListByStorageSyncServiceHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: RegisteredServersListByStorageSyncServiceHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RegisteredServerArray; - }; -}; +/** Contains response data for the preBackup operation. */ +export type CloudEndpointsPreBackupResponse = CloudEndpointsPreBackupHeaders; + +/** Optional parameters. */ +export interface CloudEndpointsPostBackupOptionalParams + 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 get operation. - */ -export type RegisteredServersGetResponse = RegisteredServer & RegisteredServersGetHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: RegisteredServersGetHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RegisteredServer; - }; -}; +/** Contains response data for the postBackup operation. */ +export type CloudEndpointsPostBackupResponse = CloudEndpointsPostBackupHeaders & + PostBackupResponse; + +/** Optional parameters. */ +export interface CloudEndpointsPreRestoreOptionalParams + 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 create operation. - */ -export type RegisteredServersCreateResponse = RegisteredServer & RegisteredServersCreateHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: RegisteredServersCreateHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: RegisteredServer; - }; -}; +/** Optional parameters. */ +export interface CloudEndpointsRestoreheartbeatOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the deleteMethod operation. - */ -export type RegisteredServersDeleteResponse = RegisteredServersDeleteHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: RegisteredServersDeleteHeaders; - }; -}; +/** Contains response data for the restoreheartbeat operation. */ +export type CloudEndpointsRestoreheartbeatResponse = CloudEndpointsRestoreheartbeatHeaders; + +/** Optional parameters. */ +export interface CloudEndpointsPostRestoreOptionalParams + 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 CloudEndpointsTriggerChangeDetectionOptionalParams + 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 ServerEndpointsCreateOptionalParams + 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 create operation. */ +export type ServerEndpointsCreateResponse = ServerEndpointsCreateHeaders & + ServerEndpoint; + +/** Optional parameters. */ +export interface ServerEndpointsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Any of the properties applicable in PUT request. */ + parameters?: ServerEndpointUpdateParameters; + /** 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 triggerRollover operation. - */ -export type RegisteredServersTriggerRolloverResponse = RegisteredServersTriggerRolloverHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: RegisteredServersTriggerRolloverHeaders; - }; -}; +/** Contains response data for the update operation. */ +export type ServerEndpointsUpdateResponse = ServerEndpointsUpdateHeaders & + ServerEndpoint; -/** - * Contains response data for the listByStorageSyncService operation. - */ -export type WorkflowsListByStorageSyncServiceResponse = WorkflowArray & WorkflowsListByStorageSyncServiceHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: WorkflowsListByStorageSyncServiceHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: WorkflowArray; - }; -}; +/** Optional parameters. */ +export interface ServerEndpointsGetOptionalParams + extends coreClient.OperationOptions {} -/** - * Contains response data for the get operation. - */ -export type WorkflowsGetResponse = Workflow & WorkflowsGetHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: WorkflowsGetHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Workflow; - }; -}; +/** Contains response data for the get operation. */ +export type ServerEndpointsGetResponse = ServerEndpointsGetHeaders & + ServerEndpoint; -/** - * Contains response data for the abort operation. - */ -export type WorkflowsAbortResponse = WorkflowsAbortHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: WorkflowsAbortHeaders; - }; -}; +/** Optional parameters. */ +export interface ServerEndpointsDeleteOptionalParams + 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 get operation. - */ -export type OperationStatusGetResponse = OperationStatus & OperationStatusGetHeaders & { - /** - * The underlying HTTP response. - */ - _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: OperationStatusGetHeaders; - - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationStatus; - }; -}; +/** Contains response data for the delete operation. */ +export type ServerEndpointsDeleteResponse = ServerEndpointsDeleteHeaders; + +/** Optional parameters. */ +export interface ServerEndpointsListBySyncGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySyncGroup operation. */ +export type ServerEndpointsListBySyncGroupResponse = ServerEndpointsListBySyncGroupHeaders & + ServerEndpointArray; + +/** Optional parameters. */ +export interface ServerEndpointsRecallActionOptionalParams + 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 recallAction operation. */ +export type ServerEndpointsRecallActionResponse = ServerEndpointsRecallActionHeaders; + +/** Optional parameters. */ +export interface RegisteredServersListByStorageSyncServiceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByStorageSyncService operation. */ +export type RegisteredServersListByStorageSyncServiceResponse = RegisteredServersListByStorageSyncServiceHeaders & + RegisteredServerArray; + +/** Optional parameters. */ +export interface RegisteredServersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type RegisteredServersGetResponse = RegisteredServersGetHeaders & + RegisteredServer; + +/** Optional parameters. */ +export interface RegisteredServersCreateOptionalParams + 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 create operation. */ +export type RegisteredServersCreateResponse = RegisteredServersCreateHeaders & + RegisteredServer; + +/** Optional parameters. */ +export interface RegisteredServersDeleteOptionalParams + 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 delete operation. */ +export type RegisteredServersDeleteResponse = RegisteredServersDeleteHeaders; + +/** Optional parameters. */ +export interface RegisteredServersTriggerRolloverOptionalParams + 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 triggerRollover operation. */ +export type RegisteredServersTriggerRolloverResponse = RegisteredServersTriggerRolloverHeaders; + +/** Optional parameters. */ +export interface WorkflowsListByStorageSyncServiceOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByStorageSyncService operation. */ +export type WorkflowsListByStorageSyncServiceResponse = WorkflowsListByStorageSyncServiceHeaders & + WorkflowArray; + +/** Optional parameters. */ +export interface WorkflowsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type WorkflowsGetResponse = WorkflowsGetHeaders & Workflow; + +/** Optional parameters. */ +export interface WorkflowsAbortOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the abort operation. */ +export type WorkflowsAbortResponse = WorkflowsAbortHeaders; + +/** Optional parameters. */ +export interface OperationStatusGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type OperationStatusGetResponse = OperationStatusGetHeaders & + OperationStatus; + +/** Optional parameters. */ +export interface LocationOperationStatusOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the locationOperationStatus operation. */ +export type LocationOperationStatusResponse = MicrosoftStorageSyncLocationOperationStatusHeaders & + LocationOperationStatus; + +/** Optional parameters. */ +export interface MicrosoftStorageSyncOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/storagesync/arm-storagesync/src/models/mappers.ts b/sdk/storagesync/arm-storagesync/src/models/mappers.ts index 5a0f25e6e367..56e7b37c8720 100644 --- a/sdk/storagesync/arm-storagesync/src/models/mappers.ts +++ b/sdk/storagesync/arm-storagesync/src/models/mappers.ts @@ -1,312 +1,342 @@ /* - * 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 StorageSyncErrorDetails: msRest.CompositeMapper = { - serializedName: "StorageSyncErrorDetails", +export const OperationEntityListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageSyncErrorDetails", + className: "OperationEntityListResult", modelProperties: { - code: { - serializedName: "code", + nextLink: { + serializedName: "nextLink", type: { name: "String" } }, - message: { - serializedName: "message", + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationEntity" + } + } + } + } + } + } +}; + +export const OperationEntity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationEntity", + modelProperties: { + name: { + serializedName: "name", type: { name: "String" } }, - target: { - serializedName: "target", + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplayInfo" + } + }, + origin: { + serializedName: "origin", type: { name: "String" } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "OperationProperties" + } } } } }; -export const StorageSyncApiError: msRest.CompositeMapper = { - serializedName: "StorageSyncApiError", +export const OperationDisplayInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageSyncApiError", + className: "OperationDisplayInfo", modelProperties: { - code: { - serializedName: "code", + description: { + serializedName: "description", type: { name: "String" } }, - message: { - serializedName: "message", + operation: { + serializedName: "operation", type: { name: "String" } }, - target: { - serializedName: "target", + provider: { + serializedName: "provider", type: { name: "String" } }, - details: { - serializedName: "details", + resource: { + serializedName: "resource", type: { - name: "Composite", - className: "StorageSyncErrorDetails" + name: "String" } } } } }; -export const StorageSyncError: msRest.CompositeMapper = { - serializedName: "StorageSyncError", +export const OperationProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageSyncError", + className: "OperationProperties", modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "StorageSyncApiError" - } - }, - innererror: { - serializedName: "innererror", + serviceSpecification: { + serializedName: "serviceSpecification", type: { name: "Composite", - className: "StorageSyncApiError" + className: "OperationResourceServiceSpecification" } } } } }; -export const SubscriptionState: msRest.CompositeMapper = { - serializedName: "SubscriptionState", +export const OperationResourceServiceSpecification: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SubscriptionState", + className: "OperationResourceServiceSpecification", modelProperties: { - state: { - serializedName: "state", - type: { - name: "String" - } - }, - istransitioning: { - readOnly: true, - serializedName: "istransitioning", - type: { - name: "Boolean" - } - }, - properties: { - serializedName: "properties", + metricSpecifications: { + serializedName: "metricSpecifications", type: { - name: "Object" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationResourceMetricSpecification" + } + } } } } } }; -export const Resource: msRest.CompositeMapper = { - serializedName: "Resource", +export const OperationResourceMetricSpecification: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Resource", + className: "OperationResourceMetricSpecification", modelProperties: { - id: { - readOnly: true, - serializedName: "id", + name: { + serializedName: "name", type: { name: "String" } }, - name: { - readOnly: true, - serializedName: "name", + displayName: { + serializedName: "displayName", type: { name: "String" } }, - type: { - readOnly: true, - serializedName: "type", + displayDescription: { + serializedName: "displayDescription", type: { name: "String" } - } - } - } -}; - -export const TrackedResource: msRest.CompositeMapper = { - serializedName: "TrackedResource", - type: { - name: "Composite", - className: "TrackedResource", - modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", + }, + unit: { + serializedName: "unit", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } }, - location: { - required: true, - serializedName: "location", + aggregationType: { + serializedName: "aggregationType", type: { name: "String" } + }, + fillGapWithZero: { + serializedName: "fillGapWithZero", + type: { + name: "Boolean" + } + }, + dimensions: { + serializedName: "dimensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationResourceMetricSpecificationDimension" + } + } + } } } } }; -export const StorageSyncService: msRest.CompositeMapper = { - serializedName: "StorageSyncService", +export const OperationResourceMetricSpecificationDimension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageSyncService", + className: "OperationResourceMetricSpecificationDimension", modelProperties: { - ...TrackedResource.type.modelProperties, - storageSyncServiceStatus: { - readOnly: true, - serializedName: "properties.storageSyncServiceStatus", + name: { + serializedName: "name", type: { - name: "Number" + name: "String" } }, - storageSyncServiceUid: { - readOnly: true, - serializedName: "properties.storageSyncServiceUid", + displayName: { + serializedName: "displayName", type: { name: "String" } + }, + toBeExportedForShoebox: { + serializedName: "toBeExportedForShoebox", + type: { + name: "Boolean" + } } } } }; -export const ProxyResource: msRest.CompositeMapper = { - serializedName: "ProxyResource", +export const StorageSyncError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ProxyResource", + className: "StorageSyncError", modelProperties: { - ...Resource.type.modelProperties + error: { + serializedName: "error", + type: { + name: "Composite", + className: "StorageSyncApiError" + } + }, + innererror: { + serializedName: "innererror", + type: { + name: "Composite", + className: "StorageSyncApiError" + } + } } } }; -export const SyncGroup: msRest.CompositeMapper = { - serializedName: "SyncGroup", +export const StorageSyncApiError: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SyncGroup", + className: "StorageSyncApiError", modelProperties: { - ...ProxyResource.type.modelProperties, - uniqueId: { - readOnly: true, - serializedName: "properties.uniqueId", + code: { + serializedName: "code", type: { name: "String" } }, - syncGroupStatus: { - readOnly: true, - serializedName: "properties.syncGroupStatus", + message: { + serializedName: "message", + type: { + name: "String" + } + }, + target: { + serializedName: "target", type: { name: "String" } + }, + details: { + serializedName: "details", + type: { + name: "Composite", + className: "StorageSyncErrorDetails" + } + }, + innerError: { + serializedName: "innerError", + type: { + name: "Composite", + className: "StorageSyncInnerErrorDetails" + } } } } }; -export const CloudEndpoint: msRest.CompositeMapper = { - serializedName: "CloudEndpoint", +export const StorageSyncErrorDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudEndpoint", + className: "StorageSyncErrorDetails", modelProperties: { - ...ProxyResource.type.modelProperties, - storageAccountResourceId: { - serializedName: "properties.storageAccountResourceId", - type: { - name: "String" - } - }, - azureFileShareName: { - serializedName: "properties.azureFileShareName", + code: { + serializedName: "code", type: { name: "String" } }, - storageAccountTenantId: { - serializedName: "properties.storageAccountTenantId", + message: { + serializedName: "message", type: { name: "String" } }, - partnershipId: { - serializedName: "properties.partnershipId", + target: { + serializedName: "target", type: { name: "String" } }, - friendlyName: { - serializedName: "properties.friendlyName", + requestUri: { + serializedName: "requestUri", type: { name: "String" } }, - backupEnabled: { - readOnly: true, - serializedName: "properties.backupEnabled", + exceptionType: { + serializedName: "exceptionType", type: { name: "String" } }, - provisioningState: { - serializedName: "properties.provisioningState", + httpMethod: { + serializedName: "httpMethod", type: { name: "String" } }, - lastWorkflowId: { - serializedName: "properties.lastWorkflowId", + hashedMessage: { + serializedName: "hashedMessage", type: { name: "String" } }, - lastOperationName: { - serializedName: "properties.lastOperationName", + httpErrorCode: { + serializedName: "httpErrorCode", type: { name: "String" } @@ -315,53 +345,86 @@ export const CloudEndpoint: msRest.CompositeMapper = { } }; -export const TriggerChangeDetectionParameters: msRest.CompositeMapper = { - serializedName: "TriggerChangeDetectionParameters", +export const StorageSyncInnerErrorDetails: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TriggerChangeDetectionParameters", + className: "StorageSyncInnerErrorDetails", modelProperties: { - directoryPath: { - serializedName: "directoryPath", + callStack: { + serializedName: "callStack", type: { name: "String" } }, - changeDetectionMode: { - serializedName: "changeDetectionMode", + message: { + serializedName: "message", type: { name: "String" } }, - paths: { - serializedName: "paths", + innerException: { + serializedName: "innerException", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" + } + }, + innerExceptionCallStack: { + serializedName: "innerExceptionCallStack", + type: { + name: "String" } } } } }; -export const RecallActionParameters: msRest.CompositeMapper = { - serializedName: "RecallActionParameters", +export const CheckNameAvailabilityParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RecallActionParameters", + className: "CheckNameAvailabilityParameters", modelProperties: { - pattern: { - serializedName: "pattern", + name: { + serializedName: "name", + required: true, type: { name: "String" } }, - recallPath: { - serializedName: "recallPath", + type: { + defaultValue: "Microsoft.StorageSync/storageSyncServices", + isConstant: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const CheckNameAvailabilityResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityResult", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + readOnly: true, + type: { + name: "Boolean" + } + }, + reason: { + serializedName: "reason", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Invalid", "AlreadyExists"] + } + }, + message: { + serializedName: "message", + readOnly: true, type: { name: "String" } @@ -370,15 +433,14 @@ export const RecallActionParameters: msRest.CompositeMapper = { } }; -export const StorageSyncServiceCreateParameters: msRest.CompositeMapper = { - serializedName: "StorageSyncServiceCreateParameters", +export const StorageSyncServiceCreateParameters: coreClient.CompositeMapper = { type: { name: "Composite", className: "StorageSyncServiceCreateParameters", modelProperties: { location: { - required: true, serializedName: "location", + required: true, type: { name: "String" } @@ -387,67 +449,54 @@ export const StorageSyncServiceCreateParameters: msRest.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } } }, - properties: { - serializedName: "properties", + incomingTrafficPolicy: { + serializedName: "properties.incomingTrafficPolicy", type: { - name: "Object" + name: "String" } } } } }; -export const SyncGroupCreateParameters: msRest.CompositeMapper = { - serializedName: "SyncGroupCreateParameters", +export const PrivateEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SyncGroupCreateParameters", + className: "PrivateEndpoint", modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", + id: { + serializedName: "id", + readOnly: true, type: { - name: "Object" + name: "String" } } } } }; -export const CloudEndpointCreateParameters: msRest.CompositeMapper = { - serializedName: "CloudEndpointCreateParameters", +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CloudEndpointCreateParameters", + className: "PrivateLinkServiceConnectionState", modelProperties: { - ...ProxyResource.type.modelProperties, - storageAccountResourceId: { - serializedName: "properties.storageAccountResourceId", - type: { - name: "String" - } - }, - azureFileShareName: { - serializedName: "properties.azureFileShareName", + status: { + serializedName: "status", type: { name: "String" } }, - storageAccountTenantId: { - serializedName: "properties.storageAccountTenantId", + description: { + serializedName: "description", type: { name: "String" } }, - friendlyName: { - serializedName: "properties.friendlyName", + actionsRequired: { + serializedName: "actionsRequired", type: { name: "String" } @@ -456,305 +505,371 @@ export const CloudEndpointCreateParameters: msRest.CompositeMapper = { } }; -export const ServerEndpointCreateParameters: msRest.CompositeMapper = { - serializedName: "ServerEndpointCreateParameters", +export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServerEndpointCreateParameters", + className: "Resource", modelProperties: { - ...ProxyResource.type.modelProperties, - serverLocalPath: { - serializedName: "properties.serverLocalPath", + id: { + serializedName: "id", + readOnly: true, type: { name: "String" } }, - cloudTiering: { - serializedName: "properties.cloudTiering", + name: { + serializedName: "name", + readOnly: true, type: { name: "String" } }, - volumeFreeSpacePercent: { - serializedName: "properties.volumeFreeSpacePercent", - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 0 - }, + type: { + serializedName: "type", + readOnly: true, type: { - name: "Number" + name: "String" } - }, - tierFilesOlderThanDays: { - serializedName: "properties.tierFilesOlderThanDays", - constraints: { - InclusiveMaximum: 2147483647, - InclusiveMinimum: 0 - }, + } + } + } +}; + +export const StorageSyncServiceUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSyncServiceUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", type: { - name: "Number" + name: "Dictionary", + value: { type: { name: "String" } } } }, - friendlyName: { - serializedName: "properties.friendlyName", + incomingTrafficPolicy: { + serializedName: "properties.incomingTrafficPolicy", type: { name: "String" } - }, - serverResourceId: { - serializedName: "properties.serverResourceId", + } + } + } +}; + +export const StorageSyncServiceArray: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSyncServiceArray", + modelProperties: { + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "StorageSyncService" + } + } } - }, - offlineDataTransfer: { - serializedName: "properties.offlineDataTransfer", + } + } + } +}; + +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } } - }, - offlineDataTransferShareName: { - serializedName: "properties.offlineDataTransferShareName", + } + } + } +}; + +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionListResult", + modelProperties: { + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } } } } } }; -export const TriggerRolloverRequest: msRest.CompositeMapper = { - serializedName: "TriggerRolloverRequest", +export const SyncGroupArray: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TriggerRolloverRequest", + className: "SyncGroupArray", modelProperties: { - serverCertificate: { - serializedName: "serverCertificate", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SyncGroup" + } + } } } } } }; -export const RegisteredServerCreateParameters: msRest.CompositeMapper = { - serializedName: "RegisteredServerCreateParameters", +export const CloudEndpointChangeEnumerationStatus: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RegisteredServerCreateParameters", + className: "CloudEndpointChangeEnumerationStatus", modelProperties: { - ...ProxyResource.type.modelProperties, - serverCertificate: { - serializedName: "properties.serverCertificate", + lastUpdatedTimestamp: { + serializedName: "lastUpdatedTimestamp", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - agentVersion: { - serializedName: "properties.agentVersion", + lastEnumerationStatus: { + serializedName: "lastEnumerationStatus", type: { - name: "String" + name: "Composite", + className: "CloudEndpointLastChangeEnumerationStatus" } }, - serverOSVersion: { - serializedName: "properties.serverOSVersion", + activity: { + serializedName: "activity", type: { - name: "String" + name: "Composite", + className: "CloudEndpointChangeEnumerationActivity" } - }, - lastHeartBeat: { - serializedName: "properties.lastHeartBeat", + } + } + } +}; + +export const CloudEndpointLastChangeEnumerationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudEndpointLastChangeEnumerationStatus", + modelProperties: { + startedTimestamp: { + serializedName: "startedTimestamp", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - serverRole: { - serializedName: "properties.serverRole", + completedTimestamp: { + serializedName: "completedTimestamp", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - clusterId: { - serializedName: "properties.clusterId", + namespaceFilesCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "namespaceFilesCount", + readOnly: true, type: { - name: "String" + name: "Number" } }, - clusterName: { - serializedName: "properties.clusterName", + namespaceDirectoriesCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "namespaceDirectoriesCount", + readOnly: true, type: { - name: "String" + name: "Number" } }, - serverId: { - serializedName: "properties.serverId", - type: { - name: "String" + namespaceSizeBytes: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "namespaceSizeBytes", + readOnly: true, + type: { + name: "Number" } }, - friendlyName: { - serializedName: "properties.friendlyName", + nextRunTimestamp: { + serializedName: "nextRunTimestamp", + readOnly: true, type: { - name: "String" + name: "DateTime" } } } } }; -export const ServerEndpointUpdateParameters: msRest.CompositeMapper = { - serializedName: "ServerEndpointUpdateParameters", +export const CloudEndpointChangeEnumerationActivity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServerEndpointUpdateParameters", + className: "CloudEndpointChangeEnumerationActivity", modelProperties: { - cloudTiering: { - serializedName: "properties.cloudTiering", + lastUpdatedTimestamp: { + serializedName: "lastUpdatedTimestamp", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - volumeFreeSpacePercent: { - serializedName: "properties.volumeFreeSpacePercent", - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 0 - }, + operationState: { + serializedName: "operationState", + readOnly: true, type: { - name: "Number" + name: "String" } }, - tierFilesOlderThanDays: { - serializedName: "properties.tierFilesOlderThanDays", - constraints: { - InclusiveMaximum: 2147483647, - InclusiveMinimum: 0 - }, + statusCode: { + serializedName: "statusCode", + readOnly: true, type: { name: "Number" } }, - offlineDataTransfer: { - serializedName: "properties.offlineDataTransfer", + startedTimestamp: { + serializedName: "startedTimestamp", + readOnly: true, type: { - name: "String" + name: "DateTime" } }, - offlineDataTransferShareName: { - serializedName: "properties.offlineDataTransferShareName", - type: { - name: "String" - } - } - } - } -}; - -export const ServerEndpointFilesNotSyncingError: msRest.CompositeMapper = { - serializedName: "ServerEndpointFilesNotSyncingError", - type: { - name: "Composite", - className: "ServerEndpointFilesNotSyncingError", - modelProperties: { - errorCode: { + processedFilesCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "processedFilesCount", readOnly: true, - serializedName: "errorCode", type: { name: "Number" } }, - persistentCount: { - readOnly: true, - serializedName: "persistentCount", + processedDirectoriesCount: { constraints: { InclusiveMinimum: 0 }, + serializedName: "processedDirectoriesCount", + readOnly: true, type: { name: "Number" } }, - transientCount: { - readOnly: true, - serializedName: "transientCount", + totalFilesCount: { constraints: { InclusiveMinimum: 0 }, - type: { - name: "Number" - } - } - } - } -}; - -export const ServerEndpointSyncSessionStatus: msRest.CompositeMapper = { - serializedName: "ServerEndpointSyncSessionStatus", - type: { - name: "Composite", - className: "ServerEndpointSyncSessionStatus", - modelProperties: { - lastSyncResult: { + serializedName: "totalFilesCount", readOnly: true, - serializedName: "lastSyncResult", type: { name: "Number" } }, - lastSyncTimestamp: { + totalDirectoriesCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "totalDirectoriesCount", readOnly: true, - serializedName: "lastSyncTimestamp", type: { - name: "DateTime" + name: "Number" } }, - lastSyncSuccessTimestamp: { + totalSizeBytes: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "totalSizeBytes", readOnly: true, - serializedName: "lastSyncSuccessTimestamp", type: { - name: "DateTime" + name: "Number" } }, - lastSyncPerItemErrorCount: { - readOnly: true, - serializedName: "lastSyncPerItemErrorCount", + progressPercent: { constraints: { + InclusiveMaximum: 100, InclusiveMinimum: 0 }, + serializedName: "progressPercent", + readOnly: true, type: { name: "Number" } }, - persistentFilesNotSyncingCount: { - readOnly: true, - serializedName: "persistentFilesNotSyncingCount", + minutesRemaining: { constraints: { InclusiveMinimum: 0 }, + serializedName: "minutesRemaining", + readOnly: true, type: { name: "Number" } }, - transientFilesNotSyncingCount: { + totalCountsState: { + serializedName: "totalCountsState", readOnly: true, - serializedName: "transientFilesNotSyncingCount", + type: { + name: "String" + } + }, + deletesProgressPercent: { constraints: { + InclusiveMaximum: 100, InclusiveMinimum: 0 }, + serializedName: "deletesProgressPercent", + readOnly: true, type: { name: "Number" } - }, - filesNotSyncingErrors: { - readOnly: true, - serializedName: "filesNotSyncingErrors", + } + } + } +}; + +export const CloudEndpointArray: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudEndpointArray", + modelProperties: { + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ServerEndpointFilesNotSyncingError" + className: "CloudEndpoint" } } } @@ -763,274 +878,1689 @@ export const ServerEndpointSyncSessionStatus: msRest.CompositeMapper = { } }; -export const ServerEndpointSyncActivityStatus: msRest.CompositeMapper = { - serializedName: "ServerEndpointSyncActivityStatus", +export const BackupRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServerEndpointSyncActivityStatus", + className: "BackupRequest", modelProperties: { - timestamp: { - readOnly: true, - serializedName: "timestamp", - type: { - name: "DateTime" - } - }, - perItemErrorCount: { - readOnly: true, - serializedName: "perItemErrorCount", - constraints: { - InclusiveMinimum: 0 - }, - type: { - name: "Number" - } - }, - appliedItemCount: { - readOnly: true, - serializedName: "appliedItemCount", - constraints: { - InclusiveMinimum: 0 - }, - type: { - name: "Number" - } - }, - totalItemCount: { - readOnly: true, - serializedName: "totalItemCount", - constraints: { - InclusiveMinimum: 0 - }, - type: { - name: "Number" - } - }, - appliedBytes: { - readOnly: true, - serializedName: "appliedBytes", - constraints: { - InclusiveMinimum: 0 - }, - type: { - name: "Number" - } - }, - totalBytes: { - readOnly: true, - serializedName: "totalBytes", - constraints: { - InclusiveMinimum: 0 - }, + azureFileShare: { + serializedName: "azureFileShare", type: { - name: "Number" + name: "String" } } } } }; -export const ServerEndpointSyncStatus: msRest.CompositeMapper = { - serializedName: "ServerEndpointSyncStatus", +export const PostBackupResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServerEndpointSyncStatus", + className: "PostBackupResponse", modelProperties: { - downloadHealth: { + cloudEndpointName: { + serializedName: "backupMetadata.cloudEndpointName", readOnly: true, - serializedName: "downloadHealth", type: { name: "String" } - }, - uploadHealth: { - readOnly: true, - serializedName: "uploadHealth", + } + } + } +}; + +export const PreRestoreRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PreRestoreRequest", + modelProperties: { + partition: { + serializedName: "partition", type: { name: "String" } }, - combinedHealth: { - readOnly: true, - serializedName: "combinedHealth", + replicaGroup: { + serializedName: "replicaGroup", type: { name: "String" } }, - syncActivity: { - readOnly: true, - serializedName: "syncActivity", + requestId: { + serializedName: "requestId", type: { name: "String" } }, - totalPersistentFilesNotSyncingCount: { - readOnly: true, - serializedName: "totalPersistentFilesNotSyncingCount", - constraints: { - InclusiveMinimum: 0 - }, + azureFileShareUri: { + serializedName: "azureFileShareUri", type: { - name: "Number" + name: "String" } }, - lastUpdatedTimestamp: { - readOnly: true, - serializedName: "lastUpdatedTimestamp", + status: { + serializedName: "status", type: { - name: "DateTime" + name: "String" } }, - uploadStatus: { - readOnly: true, - serializedName: "uploadStatus", + sourceAzureFileShareUri: { + serializedName: "sourceAzureFileShareUri", type: { - name: "Composite", - className: "ServerEndpointSyncSessionStatus" + name: "String" } }, - downloadStatus: { - readOnly: true, - serializedName: "downloadStatus", + backupMetadataPropertyBag: { + serializedName: "backupMetadataPropertyBag", type: { - name: "Composite", - className: "ServerEndpointSyncSessionStatus" + name: "String" } }, - uploadActivity: { - readOnly: true, - serializedName: "uploadActivity", + restoreFileSpec: { + serializedName: "restoreFileSpec", type: { - name: "Composite", - className: "ServerEndpointSyncActivityStatus" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RestoreFileSpec" + } + } } }, - downloadActivity: { - readOnly: true, - serializedName: "downloadActivity", + pauseWaitForSyncDrainTimePeriodInSeconds: { + serializedName: "pauseWaitForSyncDrainTimePeriodInSeconds", type: { - name: "Composite", - className: "ServerEndpointSyncActivityStatus" + name: "Number" } - }, - offlineDataTransferStatus: { - readOnly: true, - serializedName: "offlineDataTransferStatus", + } + } + } +}; + +export const RestoreFileSpec: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestoreFileSpec", + modelProperties: { + path: { + serializedName: "path", type: { name: "String" } + }, + isdir: { + serializedName: "isdir", + type: { + name: "Boolean" + } } } } }; -export const ServerEndpointCloudTieringStatus: msRest.CompositeMapper = { - serializedName: "ServerEndpointCloudTieringStatus", +export const PostRestoreRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServerEndpointCloudTieringStatus", + className: "PostRestoreRequest", modelProperties: { - health: { - readOnly: true, - serializedName: "health", + partition: { + serializedName: "partition", type: { name: "String" } }, - lastUpdatedTimestamp: { - readOnly: true, - serializedName: "lastUpdatedTimestamp", + replicaGroup: { + serializedName: "replicaGroup", type: { - name: "DateTime" + name: "String" } }, - lastCloudTieringResult: { - readOnly: true, - serializedName: "lastCloudTieringResult", + requestId: { + serializedName: "requestId", type: { - name: "Number" + name: "String" } }, - lastSuccessTimestamp: { - readOnly: true, - serializedName: "lastSuccessTimestamp", + azureFileShareUri: { + serializedName: "azureFileShareUri", type: { - name: "DateTime" + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + sourceAzureFileShareUri: { + serializedName: "sourceAzureFileShareUri", + type: { + name: "String" + } + }, + failedFileList: { + serializedName: "failedFileList", + type: { + name: "String" + } + }, + restoreFileSpec: { + serializedName: "restoreFileSpec", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RestoreFileSpec" + } + } } } } } }; -export const ServerEndpointRecallError: msRest.CompositeMapper = { - serializedName: "ServerEndpointRecallError", +export const TriggerChangeDetectionParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServerEndpointRecallError", + className: "TriggerChangeDetectionParameters", modelProperties: { - errorCode: { + directoryPath: { + serializedName: "directoryPath", + type: { + name: "String" + } + }, + changeDetectionMode: { + serializedName: "changeDetectionMode", + type: { + name: "String" + } + }, + paths: { + serializedName: "paths", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ServerEndpointSyncStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerEndpointSyncStatus", + modelProperties: { + downloadHealth: { + serializedName: "downloadHealth", readOnly: true, - serializedName: "errorCode", type: { - name: "Number" + name: "String" } }, - count: { + uploadHealth: { + serializedName: "uploadHealth", readOnly: true, - serializedName: "count", + type: { + name: "String" + } + }, + combinedHealth: { + serializedName: "combinedHealth", + readOnly: true, + type: { + name: "String" + } + }, + syncActivity: { + serializedName: "syncActivity", + readOnly: true, + type: { + name: "String" + } + }, + totalPersistentFilesNotSyncingCount: { constraints: { InclusiveMinimum: 0 }, + serializedName: "totalPersistentFilesNotSyncingCount", + readOnly: true, type: { name: "Number" } + }, + lastUpdatedTimestamp: { + serializedName: "lastUpdatedTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + uploadStatus: { + serializedName: "uploadStatus", + type: { + name: "Composite", + className: "ServerEndpointSyncSessionStatus" + } + }, + downloadStatus: { + serializedName: "downloadStatus", + type: { + name: "Composite", + className: "ServerEndpointSyncSessionStatus" + } + }, + uploadActivity: { + serializedName: "uploadActivity", + type: { + name: "Composite", + className: "ServerEndpointSyncActivityStatus" + } + }, + downloadActivity: { + serializedName: "downloadActivity", + type: { + name: "Composite", + className: "ServerEndpointSyncActivityStatus" + } + }, + offlineDataTransferStatus: { + serializedName: "offlineDataTransferStatus", + readOnly: true, + type: { + name: "String" + } + }, + backgroundDataDownloadActivity: { + serializedName: "backgroundDataDownloadActivity", + type: { + name: "Composite", + className: "ServerEndpointBackgroundDataDownloadActivity" + } } } } }; -export const ServerEndpointRecallStatus: msRest.CompositeMapper = { - serializedName: "ServerEndpointRecallStatus", +export const ServerEndpointSyncSessionStatus: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServerEndpointRecallStatus", + className: "ServerEndpointSyncSessionStatus", modelProperties: { - lastUpdatedTimestamp: { + lastSyncResult: { + serializedName: "lastSyncResult", + readOnly: true, + type: { + name: "Number" + } + }, + lastSyncTimestamp: { + serializedName: "lastSyncTimestamp", readOnly: true, - serializedName: "lastUpdatedTimestamp", type: { name: "DateTime" } }, - totalRecallErrorsCount: { + lastSyncSuccessTimestamp: { + serializedName: "lastSyncSuccessTimestamp", readOnly: true, - serializedName: "totalRecallErrorsCount", + type: { + name: "DateTime" + } + }, + lastSyncPerItemErrorCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "lastSyncPerItemErrorCount", + readOnly: true, + type: { + name: "Number" + } + }, + persistentFilesNotSyncingCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "persistentFilesNotSyncingCount", + readOnly: true, + type: { + name: "Number" + } + }, + transientFilesNotSyncingCount: { constraints: { InclusiveMinimum: 0 }, + serializedName: "transientFilesNotSyncingCount", + readOnly: true, + type: { + name: "Number" + } + }, + filesNotSyncingErrors: { + serializedName: "filesNotSyncingErrors", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServerEndpointFilesNotSyncingError" + } + } + } + }, + lastSyncMode: { + serializedName: "lastSyncMode", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ServerEndpointFilesNotSyncingError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerEndpointFilesNotSyncingError", + modelProperties: { + errorCode: { + serializedName: "errorCode", + readOnly: true, + type: { + name: "Number" + } + }, + persistentCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "persistentCount", + readOnly: true, + type: { + name: "Number" + } + }, + transientCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "transientCount", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ServerEndpointSyncActivityStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerEndpointSyncActivityStatus", + modelProperties: { + timestamp: { + serializedName: "timestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + perItemErrorCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "perItemErrorCount", + readOnly: true, + type: { + name: "Number" + } + }, + appliedItemCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "appliedItemCount", + readOnly: true, + type: { + name: "Number" + } + }, + totalItemCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "totalItemCount", + readOnly: true, + type: { + name: "Number" + } + }, + appliedBytes: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "appliedBytes", + readOnly: true, + type: { + name: "Number" + } + }, + totalBytes: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "totalBytes", + readOnly: true, + type: { + name: "Number" + } + }, + syncMode: { + serializedName: "syncMode", + readOnly: true, + type: { + name: "String" + } + }, + sessionMinutesRemaining: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "sessionMinutesRemaining", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ServerEndpointBackgroundDataDownloadActivity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerEndpointBackgroundDataDownloadActivity", + modelProperties: { + timestamp: { + serializedName: "timestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + startedTimestamp: { + serializedName: "startedTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + percentProgress: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + serializedName: "percentProgress", + readOnly: true, + type: { + name: "Number" + } + }, + downloadedBytes: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "downloadedBytes", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ServerEndpointCloudTieringStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerEndpointCloudTieringStatus", + modelProperties: { + lastUpdatedTimestamp: { + serializedName: "lastUpdatedTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + health: { + serializedName: "health", + readOnly: true, + type: { + name: "String" + } + }, + healthLastUpdatedTimestamp: { + serializedName: "healthLastUpdatedTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + lastCloudTieringResult: { + serializedName: "lastCloudTieringResult", + readOnly: true, + type: { + name: "Number" + } + }, + lastSuccessTimestamp: { + serializedName: "lastSuccessTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + spaceSavings: { + serializedName: "spaceSavings", + type: { + name: "Composite", + className: "CloudTieringSpaceSavings" + } + }, + cachePerformance: { + serializedName: "cachePerformance", + type: { + name: "Composite", + className: "CloudTieringCachePerformance" + } + }, + filesNotTiering: { + serializedName: "filesNotTiering", + type: { + name: "Composite", + className: "CloudTieringFilesNotTiering" + } + }, + volumeFreeSpacePolicyStatus: { + serializedName: "volumeFreeSpacePolicyStatus", + type: { + name: "Composite", + className: "CloudTieringVolumeFreeSpacePolicyStatus" + } + }, + datePolicyStatus: { + serializedName: "datePolicyStatus", + type: { + name: "Composite", + className: "CloudTieringDatePolicyStatus" + } + } + } + } +}; + +export const CloudTieringSpaceSavings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudTieringSpaceSavings", + modelProperties: { + lastUpdatedTimestamp: { + serializedName: "lastUpdatedTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + volumeSizeBytes: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "volumeSizeBytes", + readOnly: true, + type: { + name: "Number" + } + }, + totalSizeCloudBytes: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "totalSizeCloudBytes", + readOnly: true, + type: { + name: "Number" + } + }, + cachedSizeBytes: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "cachedSizeBytes", + readOnly: true, + type: { + name: "Number" + } + }, + spaceSavingsPercent: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + serializedName: "spaceSavingsPercent", + readOnly: true, + type: { + name: "Number" + } + }, + spaceSavingsBytes: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "spaceSavingsBytes", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const CloudTieringCachePerformance: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudTieringCachePerformance", + modelProperties: { + lastUpdatedTimestamp: { + serializedName: "lastUpdatedTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + cacheHitBytes: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "cacheHitBytes", + readOnly: true, + type: { + name: "Number" + } + }, + cacheMissBytes: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "cacheMissBytes", + readOnly: true, + type: { + name: "Number" + } + }, + cacheHitBytesPercent: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + serializedName: "cacheHitBytesPercent", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const CloudTieringFilesNotTiering: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudTieringFilesNotTiering", + modelProperties: { + lastUpdatedTimestamp: { + serializedName: "lastUpdatedTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + totalFileCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "totalFileCount", + readOnly: true, + type: { + name: "Number" + } + }, + errors: { + serializedName: "errors", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FilesNotTieringError" + } + } + } + } + } + } +}; + +export const FilesNotTieringError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FilesNotTieringError", + modelProperties: { + errorCode: { + serializedName: "errorCode", + readOnly: true, + type: { + name: "Number" + } + }, + fileCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "fileCount", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const CloudTieringVolumeFreeSpacePolicyStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudTieringVolumeFreeSpacePolicyStatus", + modelProperties: { + lastUpdatedTimestamp: { + serializedName: "lastUpdatedTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + effectiveVolumeFreeSpacePolicy: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + serializedName: "effectiveVolumeFreeSpacePolicy", + readOnly: true, + type: { + name: "Number" + } + }, + currentVolumeFreeSpacePercent: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + serializedName: "currentVolumeFreeSpacePercent", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const CloudTieringDatePolicyStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudTieringDatePolicyStatus", + modelProperties: { + lastUpdatedTimestamp: { + serializedName: "lastUpdatedTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + tieredFilesMostRecentAccessTimestamp: { + serializedName: "tieredFilesMostRecentAccessTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const ServerEndpointRecallStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerEndpointRecallStatus", + modelProperties: { + lastUpdatedTimestamp: { + serializedName: "lastUpdatedTimestamp", + readOnly: true, + type: { + name: "DateTime" + } + }, + totalRecallErrorsCount: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "totalRecallErrorsCount", + readOnly: true, + type: { + name: "Number" + } + }, + recallErrors: { + serializedName: "recallErrors", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServerEndpointRecallError" + } + } + } + } + } + } +}; + +export const ServerEndpointRecallError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerEndpointRecallError", + modelProperties: { + errorCode: { + serializedName: "errorCode", + readOnly: true, + type: { + name: "Number" + } + }, + count: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "count", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const ServerEndpointUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerEndpointUpdateParameters", + modelProperties: { + cloudTiering: { + serializedName: "properties.cloudTiering", + type: { + name: "String" + } + }, + volumeFreeSpacePercent: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + serializedName: "properties.volumeFreeSpacePercent", + type: { + name: "Number" + } + }, + tierFilesOlderThanDays: { + constraints: { + InclusiveMaximum: 2147483647, + InclusiveMinimum: 0 + }, + serializedName: "properties.tierFilesOlderThanDays", + type: { + name: "Number" + } + }, + offlineDataTransfer: { + serializedName: "properties.offlineDataTransfer", + type: { + name: "String" + } + }, + offlineDataTransferShareName: { + serializedName: "properties.offlineDataTransferShareName", + type: { + name: "String" + } + }, + localCacheMode: { + serializedName: "properties.localCacheMode", + type: { + name: "String" + } + } + } + } +}; + +export const ServerEndpointArray: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerEndpointArray", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ServerEndpoint" + } + } + } + } + } + } +}; + +export const RecallActionParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RecallActionParameters", + modelProperties: { + pattern: { + serializedName: "pattern", + type: { + name: "String" + } + }, + recallPath: { + serializedName: "recallPath", + type: { + name: "String" + } + } + } + } +}; + +export const RegisteredServerArray: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RegisteredServerArray", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RegisteredServer" + } + } + } + } + } + } +}; + +export const TriggerRolloverRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TriggerRolloverRequest", + modelProperties: { + serverCertificate: { + serializedName: "serverCertificate", + type: { + name: "String" + } + } + } + } +}; + +export const WorkflowArray: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkflowArray", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Workflow" + } + } + } + } + } + } +}; + +export const OperationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatus", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + endTime: { + serializedName: "endTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "StorageSyncApiError" + } + } + } + } +}; + +export const LocationOperationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocationOperationStatus", + 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: "DateTime" + } + }, + endTime: { + serializedName: "endTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "StorageSyncApiError" + } + }, + percentComplete: { + serializedName: "percentComplete", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const SubscriptionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionState", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String" + } + }, + istransitioning: { + serializedName: "istransitioning", + readOnly: true, + type: { + name: "Boolean" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const ResourcesMoveInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourcesMoveInfo", + modelProperties: { + targetResourceGroup: { + serializedName: "targetResourceGroup", + type: { + name: "String" + } + }, + resources: { + serializedName: "resources", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const OperationDisplayResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplayResource", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +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 TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: 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 ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const StorageSyncService: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSyncService", + modelProperties: { + ...TrackedResource.type.modelProperties, + incomingTrafficPolicy: { + serializedName: "properties.incomingTrafficPolicy", + type: { + name: "String" + } + }, + storageSyncServiceStatus: { + serializedName: "properties.storageSyncServiceStatus", + readOnly: true, + type: { + name: "Number" + } + }, + storageSyncServiceUid: { + serializedName: "properties.storageSyncServiceUid", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + lastWorkflowId: { + serializedName: "properties.lastWorkflowId", + readOnly: true, + type: { + name: "String" + } + }, + lastOperationName: { + serializedName: "properties.lastOperationName", + readOnly: true, + type: { + name: "String" + } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + } + } + } +}; + +export const SyncGroup: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SyncGroup", + modelProperties: { + ...ProxyResource.type.modelProperties, + uniqueId: { + serializedName: "properties.uniqueId", + readOnly: true, + type: { + name: "String" + } + }, + syncGroupStatus: { + serializedName: "properties.syncGroupStatus", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const SyncGroupCreateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SyncGroupCreateParameters", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const CloudEndpointCreateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudEndpointCreateParameters", + modelProperties: { + ...ProxyResource.type.modelProperties, + storageAccountResourceId: { + serializedName: "properties.storageAccountResourceId", + type: { + name: "String" + } + }, + azureFileShareName: { + serializedName: "properties.azureFileShareName", + type: { + name: "String" + } + }, + storageAccountTenantId: { + serializedName: "properties.storageAccountTenantId", + type: { + name: "String" + } + }, + friendlyName: { + serializedName: "properties.friendlyName", + type: { + name: "String" + } + } + } + } +}; + +export const CloudEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudEndpoint", + modelProperties: { + ...ProxyResource.type.modelProperties, + storageAccountResourceId: { + serializedName: "properties.storageAccountResourceId", + type: { + name: "String" + } + }, + azureFileShareName: { + serializedName: "properties.azureFileShareName", + type: { + name: "String" + } + }, + storageAccountTenantId: { + serializedName: "properties.storageAccountTenantId", + type: { + name: "String" + } + }, + partnershipId: { + serializedName: "properties.partnershipId", + type: { + name: "String" + } + }, + friendlyName: { + serializedName: "properties.friendlyName", + type: { + name: "String" + } + }, + backupEnabled: { + serializedName: "properties.backupEnabled", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + lastWorkflowId: { + serializedName: "properties.lastWorkflowId", + type: { + name: "String" + } + }, + lastOperationName: { + serializedName: "properties.lastOperationName", + type: { + name: "String" + } + }, + changeEnumerationStatus: { + serializedName: "properties.changeEnumerationStatus", + type: { + name: "Composite", + className: "CloudEndpointChangeEnumerationStatus" + } + } + } + } +}; + +export const ServerEndpointCreateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServerEndpointCreateParameters", + modelProperties: { + ...ProxyResource.type.modelProperties, + serverLocalPath: { + serializedName: "properties.serverLocalPath", + type: { + name: "String" + } + }, + cloudTiering: { + serializedName: "properties.cloudTiering", + type: { + name: "String" + } + }, + volumeFreeSpacePercent: { + defaultValue: 20, + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, + serializedName: "properties.volumeFreeSpacePercent", + type: { + name: "Number" + } + }, + tierFilesOlderThanDays: { + constraints: { + InclusiveMaximum: 2147483647, + InclusiveMinimum: 0 + }, + serializedName: "properties.tierFilesOlderThanDays", + type: { + name: "Number" + } + }, + friendlyName: { + serializedName: "properties.friendlyName", + type: { + name: "String" + } + }, + serverResourceId: { + serializedName: "properties.serverResourceId", + type: { + name: "String" + } + }, + offlineDataTransfer: { + serializedName: "properties.offlineDataTransfer", + type: { + name: "String" + } + }, + offlineDataTransferShareName: { + serializedName: "properties.offlineDataTransferShareName", + type: { + name: "String" + } + }, + initialDownloadPolicy: { + serializedName: "properties.initialDownloadPolicy", + type: { + name: "String" + } + }, + localCacheMode: { + serializedName: "properties.localCacheMode", type: { - name: "Number" + name: "String" } }, - recallErrors: { - readOnly: true, - serializedName: "recallErrors", + initialUploadPolicy: { + serializedName: "properties.initialUploadPolicy", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ServerEndpointRecallError" - } - } + name: "String" } } } } }; -export const ServerEndpoint: msRest.CompositeMapper = { - serializedName: "ServerEndpoint", +export const ServerEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServerEndpoint", @@ -1049,21 +2579,21 @@ export const ServerEndpoint: msRest.CompositeMapper = { } }, volumeFreeSpacePercent: { - serializedName: "properties.volumeFreeSpacePercent", constraints: { InclusiveMaximum: 100, InclusiveMinimum: 0 }, + serializedName: "properties.volumeFreeSpacePercent", type: { name: "Number" } }, tierFilesOlderThanDays: { - serializedName: "properties.tierFilesOlderThanDays", constraints: { InclusiveMaximum: 2147483647, InclusiveMinimum: 0 }, + serializedName: "properties.tierFilesOlderThanDays", type: { name: "Number" } @@ -1081,28 +2611,27 @@ export const ServerEndpoint: msRest.CompositeMapper = { } }, provisioningState: { - readOnly: true, serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } }, lastWorkflowId: { - readOnly: true, serializedName: "properties.lastWorkflowId", + readOnly: true, type: { name: "String" } }, lastOperationName: { - readOnly: true, serializedName: "properties.lastOperationName", + readOnly: true, type: { name: "String" } }, syncStatus: { - readOnly: true, serializedName: "properties.syncStatus", type: { name: "Composite", @@ -1116,15 +2645,16 @@ export const ServerEndpoint: msRest.CompositeMapper = { } }, offlineDataTransferStorageAccountResourceId: { + serializedName: + "properties.offlineDataTransferStorageAccountResourceId", readOnly: true, - serializedName: "properties.offlineDataTransferStorageAccountResourceId", type: { name: "String" } }, offlineDataTransferStorageAccountTenantId: { - readOnly: true, serializedName: "properties.offlineDataTransferStorageAccountTenantId", + readOnly: true, type: { name: "String" } @@ -1136,7 +2666,6 @@ export const ServerEndpoint: msRest.CompositeMapper = { } }, cloudTieringStatus: { - readOnly: true, serializedName: "properties.cloudTieringStatus", type: { name: "Composite", @@ -1144,19 +2673,42 @@ export const ServerEndpoint: msRest.CompositeMapper = { } }, recallStatus: { - readOnly: true, serializedName: "properties.recallStatus", type: { name: "Composite", className: "ServerEndpointRecallStatus" } + }, + initialDownloadPolicy: { + serializedName: "properties.initialDownloadPolicy", + type: { + name: "String" + } + }, + localCacheMode: { + serializedName: "properties.localCacheMode", + type: { + name: "String" + } + }, + initialUploadPolicy: { + serializedName: "properties.initialUploadPolicy", + type: { + name: "String" + } + }, + serverName: { + serializedName: "properties.serverName", + readOnly: true, + type: { + name: "String" + } } } } }; -export const RegisteredServer: msRest.CompositeMapper = { - serializedName: "RegisteredServer", +export const RegisteredServer: coreClient.CompositeMapper = { type: { name: "Composite", className: "RegisteredServer", @@ -1174,6 +2726,20 @@ export const RegisteredServer: msRest.CompositeMapper = { name: "String" } }, + agentVersionStatus: { + serializedName: "properties.agentVersionStatus", + readOnly: true, + type: { + name: "String" + } + }, + agentVersionExpirationDate: { + serializedName: "properties.agentVersionExpirationDate", + readOnly: true, + type: { + name: "DateTime" + } + }, serverOSVersion: { serializedName: "properties.serverOSVersion", type: { @@ -1267,237 +2833,24 @@ export const RegisteredServer: msRest.CompositeMapper = { managementEndpointUri: { serializedName: "properties.managementEndpointUri", type: { - name: "String" - } - }, - monitoringConfiguration: { - serializedName: "properties.monitoringConfiguration", - type: { - name: "String" - } - } - } - } -}; - -export const ResourcesMoveInfo: msRest.CompositeMapper = { - serializedName: "ResourcesMoveInfo", - type: { - name: "Composite", - className: "ResourcesMoveInfo", - modelProperties: { - targetResourceGroup: { - serializedName: "targetResourceGroup", - type: { - name: "String" - } - }, - resources: { - serializedName: "resources", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const Workflow: msRest.CompositeMapper = { - serializedName: "Workflow", - type: { - name: "Composite", - className: "Workflow", - modelProperties: { - ...ProxyResource.type.modelProperties, - lastStepName: { - serializedName: "properties.lastStepName", - type: { - name: "String" - } - }, - status: { - serializedName: "properties.status", - type: { - name: "String" - } - }, - operation: { - serializedName: "properties.operation", - type: { - name: "String" - } - }, - steps: { - serializedName: "properties.steps", - type: { - name: "String" - } - }, - lastOperationId: { - serializedName: "properties.lastOperationId", - type: { - name: "String" - } - } - } - } -}; - -export const OperationDisplayInfo: msRest.CompositeMapper = { - serializedName: "OperationDisplayInfo", - type: { - name: "Composite", - className: "OperationDisplayInfo", - modelProperties: { - description: { - serializedName: "description", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - type: { - name: "String" - } - }, - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - } - } - } -}; - -export const OperationEntity: msRest.CompositeMapper = { - serializedName: "OperationEntity", - type: { - name: "Composite", - className: "OperationEntity", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplayInfo" - } - }, - origin: { - serializedName: "origin", - type: { - name: "String" - } - } - } - } -}; - -export const OperationDisplayResource: msRest.CompositeMapper = { - serializedName: "OperationDisplayResource", - type: { - name: "Composite", - className: "OperationDisplayResource", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - type: { - name: "String" - } - }, - description: { - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; - -export const CheckNameAvailabilityParameters: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityParameters", - type: { - name: "Composite", - className: "CheckNameAvailabilityParameters", - modelProperties: { - name: { - required: true, - serializedName: "name", - type: { - name: "String" - } - }, - type: { - required: true, - isConstant: true, - serializedName: "type", - defaultValue: 'Microsoft.StorageSync/storageSyncServices', - type: { - name: "String" - } - } - } - } -}; - -export const CheckNameAvailabilityResult: msRest.CompositeMapper = { - serializedName: "CheckNameAvailabilityResult", - type: { - name: "Composite", - className: "CheckNameAvailabilityResult", - modelProperties: { - nameAvailable: { - readOnly: true, - serializedName: "nameAvailable", - type: { - name: "Boolean" + name: "String" } }, - reason: { - readOnly: true, - serializedName: "reason", + monitoringEndpointUri: { + serializedName: "properties.monitoringEndpointUri", type: { - name: "Enum", - allowedValues: [ - "Invalid", - "AlreadyExists" - ] + name: "String" } }, - message: { + monitoringConfiguration: { + serializedName: "properties.monitoringConfiguration", + type: { + name: "String" + } + }, + serverName: { + serializedName: "properties.serverName", readOnly: true, - serializedName: "message", type: { name: "String" } @@ -1506,170 +2859,144 @@ export const CheckNameAvailabilityResult: msRest.CompositeMapper = { } }; -export const RestoreFileSpec: msRest.CompositeMapper = { - serializedName: "RestoreFileSpec", +export const RegisteredServerCreateParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestoreFileSpec", + className: "RegisteredServerCreateParameters", modelProperties: { - path: { - serializedName: "path", + ...ProxyResource.type.modelProperties, + serverCertificate: { + serializedName: "properties.serverCertificate", type: { name: "String" } }, - isdir: { - serializedName: "isdir", - type: { - name: "Boolean" - } - } - } - } -}; - -export const PostRestoreRequest: msRest.CompositeMapper = { - serializedName: "PostRestoreRequest", - type: { - name: "Composite", - className: "PostRestoreRequest", - modelProperties: { - partition: { - serializedName: "partition", + agentVersion: { + serializedName: "properties.agentVersion", type: { name: "String" } }, - replicaGroup: { - serializedName: "replicaGroup", + serverOSVersion: { + serializedName: "properties.serverOSVersion", type: { name: "String" } }, - requestId: { - serializedName: "requestId", + lastHeartBeat: { + serializedName: "properties.lastHeartBeat", type: { name: "String" } }, - azureFileShareUri: { - serializedName: "azureFileShareUri", + serverRole: { + serializedName: "properties.serverRole", type: { name: "String" } }, - status: { - serializedName: "status", + clusterId: { + serializedName: "properties.clusterId", type: { name: "String" } }, - sourceAzureFileShareUri: { - serializedName: "sourceAzureFileShareUri", + clusterName: { + serializedName: "properties.clusterName", type: { name: "String" } }, - failedFileList: { - serializedName: "failedFileList", + serverId: { + serializedName: "properties.serverId", type: { name: "String" } }, - restoreFileSpec: { - serializedName: "restoreFileSpec", + friendlyName: { + serializedName: "properties.friendlyName", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestoreFileSpec" - } - } + name: "String" } } } } }; -export const PreRestoreRequest: msRest.CompositeMapper = { - serializedName: "PreRestoreRequest", +export const Workflow: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PreRestoreRequest", + className: "Workflow", modelProperties: { - partition: { - serializedName: "partition", - type: { - name: "String" - } - }, - replicaGroup: { - serializedName: "replicaGroup", + ...ProxyResource.type.modelProperties, + lastStepName: { + serializedName: "properties.lastStepName", type: { name: "String" } }, - requestId: { - serializedName: "requestId", + status: { + serializedName: "properties.status", type: { name: "String" } }, - azureFileShareUri: { - serializedName: "azureFileShareUri", + operation: { + serializedName: "properties.operation", type: { name: "String" } }, - status: { - serializedName: "status", + steps: { + serializedName: "properties.steps", type: { name: "String" } }, - sourceAzureFileShareUri: { - serializedName: "sourceAzureFileShareUri", + lastOperationId: { + serializedName: "properties.lastOperationId", type: { name: "String" } }, - backupMetadataPropertyBag: { - serializedName: "backupMetadataPropertyBag", + commandName: { + serializedName: "properties.commandName", + readOnly: true, type: { name: "String" } }, - restoreFileSpec: { - serializedName: "restoreFileSpec", + createdTimestamp: { + serializedName: "properties.createdTimestamp", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestoreFileSpec" - } - } + name: "DateTime" } }, - pauseWaitForSyncDrainTimePeriodInSeconds: { - serializedName: "pauseWaitForSyncDrainTimePeriodInSeconds", + lastStatusTimestamp: { + serializedName: "properties.lastStatusTimestamp", + readOnly: true, type: { - name: "Number" + name: "DateTime" } } } } }; -export const BackupRequest: msRest.CompositeMapper = { - serializedName: "BackupRequest", +export const OperationsListHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BackupRequest", + className: "OperationsListHeaders", modelProperties: { - azureFileShare: { - serializedName: "azureFileShare", + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + xMsCorrelationRequestId: { + serializedName: "x-ms-correlation-request-id", type: { name: "String" } @@ -1678,15 +3005,19 @@ export const BackupRequest: msRest.CompositeMapper = { } }; -export const PostBackupResponse: msRest.CompositeMapper = { - serializedName: "PostBackupResponse", +export const OperationsListNextHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PostBackupResponse", + className: "OperationsListNextHeaders", modelProperties: { - cloudEndpointName: { - readOnly: true, - serializedName: "backupMetadata.cloudEndpointName", + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + xMsCorrelationRequestId: { + serializedName: "x-ms-correlation-request-id", type: { name: "String" } @@ -1695,89 +3026,100 @@ export const PostBackupResponse: msRest.CompositeMapper = { } }; -export const StorageSyncServiceUpdateParameters: msRest.CompositeMapper = { - serializedName: "StorageSyncServiceUpdateParameters", +export const StorageSyncServicesCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageSyncServiceUpdateParameters", + className: "StorageSyncServicesCreateHeaders", modelProperties: { - tags: { - serializedName: "tags", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "String" } }, - properties: { - serializedName: "properties", + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "String" + } + }, + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + xMsCorrelationRequestId: { + serializedName: "x-ms-correlation-request-id", type: { - name: "Object" + name: "String" } } } } }; -export const OperationStatus: msRest.CompositeMapper = { - serializedName: "OperationStatus", +export const StorageSyncServicesGetHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationStatus", + className: "StorageSyncServicesGetHeaders", modelProperties: { - name: { - readOnly: true, - serializedName: "name", + xMsRequestId: { + serializedName: "x-ms-request-id", type: { name: "String" } }, - status: { - readOnly: true, - serializedName: "status", + xMsCorrelationRequestId: { + serializedName: "x-ms-correlation-request-id", type: { name: "String" } - }, - startTime: { - readOnly: true, - serializedName: "startTime", - type: { - name: "DateTime" - } - }, - endTime: { - readOnly: true, - serializedName: "endTime", + } + } + } +}; + +export const StorageSyncServicesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "StorageSyncServicesUpdateHeaders", + modelProperties: { + xMsRequestId: { + serializedName: "x-ms-request-id", type: { - name: "DateTime" + name: "String" } }, - error: { - readOnly: true, - serializedName: "error", + xMsCorrelationRequestId: { + serializedName: "x-ms-correlation-request-id", type: { - name: "Composite", - className: "StorageSyncApiError" + name: "String" } } } } }; -export const AzureEntityResource: msRest.CompositeMapper = { - serializedName: "AzureEntityResource", +export const StorageSyncServicesDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AzureEntityResource", + className: "StorageSyncServicesDeleteHeaders", modelProperties: { - ...Resource.type.modelProperties, - etag: { - readOnly: true, - serializedName: "etag", + xMsRequestId: { + serializedName: "x-ms-request-id", + type: { + name: "String" + } + }, + xMsCorrelationRequestId: { + serializedName: "x-ms-correlation-request-id", type: { name: "String" } @@ -1786,11 +3128,10 @@ export const AzureEntityResource: msRest.CompositeMapper = { } }; -export const OperationsListHeaders: msRest.CompositeMapper = { - serializedName: "operations-list-headers", +export const StorageSyncServicesListByResourceGroupHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationsListHeaders", + className: "StorageSyncServicesListByResourceGroupHeaders", modelProperties: { xMsRequestId: { serializedName: "x-ms-request-id", @@ -1808,11 +3149,10 @@ export const OperationsListHeaders: msRest.CompositeMapper = { } }; -export const StorageSyncServicesGetHeaders: msRest.CompositeMapper = { - serializedName: "storagesyncservices-get-headers", +export const StorageSyncServicesListBySubscriptionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageSyncServicesGetHeaders", + className: "StorageSyncServicesListBySubscriptionHeaders", modelProperties: { xMsRequestId: { serializedName: "x-ms-request-id", @@ -1830,12 +3170,29 @@ export const StorageSyncServicesGetHeaders: msRest.CompositeMapper = { } }; -export const StorageSyncServicesUpdateHeaders: msRest.CompositeMapper = { - serializedName: "storagesyncservices-update-headers", +export const PrivateEndpointConnectionsCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageSyncServicesUpdateHeaders", + className: "PrivateEndpointConnectionsCreateHeaders", modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "String" + } + }, xMsRequestId: { serializedName: "x-ms-request-id", type: { @@ -1852,34 +3209,29 @@ export const StorageSyncServicesUpdateHeaders: msRest.CompositeMapper = { } }; -export const StorageSyncServicesDeleteHeaders: msRest.CompositeMapper = { - serializedName: "storagesyncservices-delete-headers", +export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageSyncServicesDeleteHeaders", + className: "PrivateEndpointConnectionsDeleteHeaders", modelProperties: { - xMsRequestId: { - serializedName: "x-ms-request-id", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { name: "String" } }, - xMsCorrelationRequestId: { - serializedName: "x-ms-correlation-request-id", + location: { + serializedName: "location", type: { name: "String" } - } - } - } -}; - -export const StorageSyncServicesListByResourceGroupHeaders: msRest.CompositeMapper = { - serializedName: "storagesyncservices-listbyresourcegroup-headers", - type: { - name: "Composite", - className: "StorageSyncServicesListByResourceGroupHeaders", - modelProperties: { + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "String" + } + }, xMsRequestId: { serializedName: "x-ms-request-id", type: { @@ -1896,11 +3248,10 @@ export const StorageSyncServicesListByResourceGroupHeaders: msRest.CompositeMapp } }; -export const StorageSyncServicesListBySubscriptionHeaders: msRest.CompositeMapper = { - serializedName: "storagesyncservices-listbysubscription-headers", +export const PrivateEndpointConnectionsListByStorageSyncServiceHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "StorageSyncServicesListBySubscriptionHeaders", + className: "PrivateEndpointConnectionsListByStorageSyncServiceHeaders", modelProperties: { xMsRequestId: { serializedName: "x-ms-request-id", @@ -1918,8 +3269,7 @@ export const StorageSyncServicesListBySubscriptionHeaders: msRest.CompositeMappe } }; -export const SyncGroupsListByStorageSyncServiceHeaders: msRest.CompositeMapper = { - serializedName: "syncgroups-listbystoragesyncservice-headers", +export const SyncGroupsListByStorageSyncServiceHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "SyncGroupsListByStorageSyncServiceHeaders", @@ -1940,8 +3290,7 @@ export const SyncGroupsListByStorageSyncServiceHeaders: msRest.CompositeMapper = } }; -export const SyncGroupsCreateHeaders: msRest.CompositeMapper = { - serializedName: "syncgroups-create-headers", +export const SyncGroupsCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "SyncGroupsCreateHeaders", @@ -1962,8 +3311,7 @@ export const SyncGroupsCreateHeaders: msRest.CompositeMapper = { } }; -export const SyncGroupsGetHeaders: msRest.CompositeMapper = { - serializedName: "syncgroups-get-headers", +export const SyncGroupsGetHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "SyncGroupsGetHeaders", @@ -1984,8 +3332,7 @@ export const SyncGroupsGetHeaders: msRest.CompositeMapper = { } }; -export const SyncGroupsDeleteHeaders: msRest.CompositeMapper = { - serializedName: "syncgroups-delete-headers", +export const SyncGroupsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "SyncGroupsDeleteHeaders", @@ -2006,8 +3353,7 @@ export const SyncGroupsDeleteHeaders: msRest.CompositeMapper = { } }; -export const CloudEndpointsCreateHeaders: msRest.CompositeMapper = { - serializedName: "cloudendpoints-create-headers", +export const CloudEndpointsCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CloudEndpointsCreateHeaders", @@ -2023,31 +3369,12 @@ export const CloudEndpointsCreateHeaders: msRest.CompositeMapper = { type: { name: "String" } - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "String" - } } } } }; -export const CloudEndpointsGetHeaders: msRest.CompositeMapper = { - serializedName: "cloudendpoints-get-headers", +export const CloudEndpointsGetHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CloudEndpointsGetHeaders", @@ -2068,8 +3395,7 @@ export const CloudEndpointsGetHeaders: msRest.CompositeMapper = { } }; -export const CloudEndpointsDeleteHeaders: msRest.CompositeMapper = { - serializedName: "cloudendpoints-delete-headers", +export const CloudEndpointsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CloudEndpointsDeleteHeaders", @@ -2085,31 +3411,12 @@ export const CloudEndpointsDeleteHeaders: msRest.CompositeMapper = { type: { name: "String" } - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "String" - } } } } }; -export const CloudEndpointsListBySyncGroupHeaders: msRest.CompositeMapper = { - serializedName: "cloudendpoints-listbysyncgroup-headers", +export const CloudEndpointsListBySyncGroupHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CloudEndpointsListBySyncGroupHeaders", @@ -2130,8 +3437,7 @@ export const CloudEndpointsListBySyncGroupHeaders: msRest.CompositeMapper = { } }; -export const CloudEndpointsPreBackupHeaders: msRest.CompositeMapper = { - serializedName: "cloudendpoints-prebackup-headers", +export const CloudEndpointsPreBackupHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CloudEndpointsPreBackupHeaders", @@ -2158,8 +3464,7 @@ export const CloudEndpointsPreBackupHeaders: msRest.CompositeMapper = { } }; -export const CloudEndpointsPostBackupHeaders: msRest.CompositeMapper = { - serializedName: "cloudendpoints-postbackup-headers", +export const CloudEndpointsPostBackupHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CloudEndpointsPostBackupHeaders", @@ -2186,8 +3491,7 @@ export const CloudEndpointsPostBackupHeaders: msRest.CompositeMapper = { } }; -export const CloudEndpointsPreRestoreHeaders: msRest.CompositeMapper = { - serializedName: "cloudendpoints-prerestore-headers", +export const CloudEndpointsPreRestoreHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CloudEndpointsPreRestoreHeaders", @@ -2214,8 +3518,7 @@ export const CloudEndpointsPreRestoreHeaders: msRest.CompositeMapper = { } }; -export const CloudEndpointsRestoreheartbeatHeaders: msRest.CompositeMapper = { - serializedName: "cloudendpoints-restoreheartbeat-headers", +export const CloudEndpointsRestoreheartbeatHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CloudEndpointsRestoreheartbeatHeaders", @@ -2236,8 +3539,7 @@ export const CloudEndpointsRestoreheartbeatHeaders: msRest.CompositeMapper = { } }; -export const CloudEndpointsPostRestoreHeaders: msRest.CompositeMapper = { - serializedName: "cloudendpoints-postrestore-headers", +export const CloudEndpointsPostRestoreHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CloudEndpointsPostRestoreHeaders", @@ -2264,8 +3566,7 @@ export const CloudEndpointsPostRestoreHeaders: msRest.CompositeMapper = { } }; -export const CloudEndpointsTriggerChangeDetectionHeaders: msRest.CompositeMapper = { - serializedName: "cloudendpoints-triggerchangedetection-headers", +export const CloudEndpointsTriggerChangeDetectionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "CloudEndpointsTriggerChangeDetectionHeaders", @@ -2292,8 +3593,7 @@ export const CloudEndpointsTriggerChangeDetectionHeaders: msRest.CompositeMapper } }; -export const ServerEndpointsCreateHeaders: msRest.CompositeMapper = { - serializedName: "serverendpoints-create-headers", +export const ServerEndpointsCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServerEndpointsCreateHeaders", @@ -2309,25 +3609,12 @@ export const ServerEndpointsCreateHeaders: msRest.CompositeMapper = { type: { name: "String" } - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } } } } }; -export const ServerEndpointsUpdateHeaders: msRest.CompositeMapper = { - serializedName: "serverendpoints-update-headers", +export const ServerEndpointsUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServerEndpointsUpdateHeaders", @@ -2343,25 +3630,12 @@ export const ServerEndpointsUpdateHeaders: msRest.CompositeMapper = { type: { name: "String" } - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } } } } }; -export const ServerEndpointsGetHeaders: msRest.CompositeMapper = { - serializedName: "serverendpoints-get-headers", +export const ServerEndpointsGetHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServerEndpointsGetHeaders", @@ -2382,8 +3656,7 @@ export const ServerEndpointsGetHeaders: msRest.CompositeMapper = { } }; -export const ServerEndpointsDeleteHeaders: msRest.CompositeMapper = { - serializedName: "serverendpoints-delete-headers", +export const ServerEndpointsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServerEndpointsDeleteHeaders", @@ -2399,19 +3672,12 @@ export const ServerEndpointsDeleteHeaders: msRest.CompositeMapper = { type: { name: "String" } - }, - location: { - serializedName: "location", - type: { - name: "String" - } } } } }; -export const ServerEndpointsListBySyncGroupHeaders: msRest.CompositeMapper = { - serializedName: "serverendpoints-listbysyncgroup-headers", +export const ServerEndpointsListBySyncGroupHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServerEndpointsListBySyncGroupHeaders", @@ -2438,8 +3704,7 @@ export const ServerEndpointsListBySyncGroupHeaders: msRest.CompositeMapper = { } }; -export const ServerEndpointsRecallActionHeaders: msRest.CompositeMapper = { - serializedName: "serverendpoints-recallaction-headers", +export const ServerEndpointsRecallActionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "ServerEndpointsRecallActionHeaders", @@ -2455,19 +3720,12 @@ export const ServerEndpointsRecallActionHeaders: msRest.CompositeMapper = { type: { name: "String" } - }, - location: { - serializedName: "location", - type: { - name: "String" - } } } } }; -export const RegisteredServersListByStorageSyncServiceHeaders: msRest.CompositeMapper = { - serializedName: "registeredservers-listbystoragesyncservice-headers", +export const RegisteredServersListByStorageSyncServiceHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RegisteredServersListByStorageSyncServiceHeaders", @@ -2488,8 +3746,7 @@ export const RegisteredServersListByStorageSyncServiceHeaders: msRest.CompositeM } }; -export const RegisteredServersGetHeaders: msRest.CompositeMapper = { - serializedName: "registeredservers-get-headers", +export const RegisteredServersGetHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RegisteredServersGetHeaders", @@ -2510,8 +3767,7 @@ export const RegisteredServersGetHeaders: msRest.CompositeMapper = { } }; -export const RegisteredServersCreateHeaders: msRest.CompositeMapper = { - serializedName: "registeredservers-create-headers", +export const RegisteredServersCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RegisteredServersCreateHeaders", @@ -2527,25 +3783,12 @@ export const RegisteredServersCreateHeaders: msRest.CompositeMapper = { type: { name: "String" } - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } } } } }; -export const RegisteredServersDeleteHeaders: msRest.CompositeMapper = { - serializedName: "registeredservers-delete-headers", +export const RegisteredServersDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RegisteredServersDeleteHeaders", @@ -2561,19 +3804,12 @@ export const RegisteredServersDeleteHeaders: msRest.CompositeMapper = { type: { name: "String" } - }, - location: { - serializedName: "location", - type: { - name: "String" - } } } } }; -export const RegisteredServersTriggerRolloverHeaders: msRest.CompositeMapper = { - serializedName: "registeredservers-triggerrollover-headers", +export const RegisteredServersTriggerRolloverHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "RegisteredServersTriggerRolloverHeaders", @@ -2589,19 +3825,12 @@ export const RegisteredServersTriggerRolloverHeaders: msRest.CompositeMapper = { type: { name: "String" } - }, - location: { - serializedName: "location", - type: { - name: "String" - } } } } }; -export const WorkflowsListByStorageSyncServiceHeaders: msRest.CompositeMapper = { - serializedName: "workflows-listbystoragesyncservice-headers", +export const WorkflowsListByStorageSyncServiceHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "WorkflowsListByStorageSyncServiceHeaders", @@ -2622,8 +3851,7 @@ export const WorkflowsListByStorageSyncServiceHeaders: msRest.CompositeMapper = } }; -export const WorkflowsGetHeaders: msRest.CompositeMapper = { - serializedName: "workflows-get-headers", +export const WorkflowsGetHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "WorkflowsGetHeaders", @@ -2644,8 +3872,7 @@ export const WorkflowsGetHeaders: msRest.CompositeMapper = { } }; -export const WorkflowsAbortHeaders: msRest.CompositeMapper = { - serializedName: "workflows-abort-headers", +export const WorkflowsAbortHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "WorkflowsAbortHeaders", @@ -2666,8 +3893,7 @@ export const WorkflowsAbortHeaders: msRest.CompositeMapper = { } }; -export const OperationStatusGetHeaders: msRest.CompositeMapper = { - serializedName: "operationstatus-get-headers", +export const OperationStatusGetHeaders: coreClient.CompositeMapper = { type: { name: "Composite", className: "OperationStatusGetHeaders", @@ -2688,160 +3914,21 @@ export const OperationStatusGetHeaders: msRest.CompositeMapper = { } }; -export const OperationEntityListResult: msRest.CompositeMapper = { - serializedName: "OperationEntityListResult", +export const MicrosoftStorageSyncLocationOperationStatusHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationEntityListResult", + className: "MicrosoftStorageSyncLocationOperationStatusHeaders", modelProperties: { - nextLink: { - serializedName: "nextLink", + xMsRequestId: { + serializedName: "x-ms-request-id", type: { name: "String" } }, - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationEntity" - } - } - } - } - } - } -}; - -export const StorageSyncServiceArray: msRest.CompositeMapper = { - serializedName: "StorageSyncServiceArray", - type: { - name: "Composite", - className: "StorageSyncServiceArray", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "StorageSyncService" - } - } - } - } - } - } -}; - -export const SyncGroupArray: msRest.CompositeMapper = { - serializedName: "SyncGroupArray", - type: { - name: "Composite", - className: "SyncGroupArray", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SyncGroup" - } - } - } - } - } - } -}; - -export const CloudEndpointArray: msRest.CompositeMapper = { - serializedName: "CloudEndpointArray", - type: { - name: "Composite", - className: "CloudEndpointArray", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CloudEndpoint" - } - } - } - } - } - } -}; - -export const ServerEndpointArray: msRest.CompositeMapper = { - serializedName: "ServerEndpointArray", - type: { - name: "Composite", - className: "ServerEndpointArray", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ServerEndpoint" - } - } - } - } - } - } -}; - -export const RegisteredServerArray: msRest.CompositeMapper = { - serializedName: "RegisteredServerArray", - type: { - name: "Composite", - className: "RegisteredServerArray", - modelProperties: { - value: { - serializedName: "", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RegisteredServer" - } - } - } - } - } - } -}; - -export const WorkflowArray: msRest.CompositeMapper = { - serializedName: "WorkflowArray", - type: { - name: "Composite", - className: "WorkflowArray", - modelProperties: { - value: { - serializedName: "", + xMsCorrelationRequestId: { + serializedName: "x-ms-correlation-request-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Workflow" - } - } + name: "String" } } } diff --git a/sdk/storagesync/arm-storagesync/src/models/operationStatusOperationsMappers.ts b/sdk/storagesync/arm-storagesync/src/models/operationStatusOperationsMappers.ts deleted file mode 100644 index 4de39529d32b..000000000000 --- a/sdk/storagesync/arm-storagesync/src/models/operationStatusOperationsMappers.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 { - OperationStatus, - OperationStatusGetHeaders, - StorageSyncApiError, - StorageSyncError, - StorageSyncErrorDetails -} from "../models/mappers"; diff --git a/sdk/storagesync/arm-storagesync/src/models/operationsMappers.ts b/sdk/storagesync/arm-storagesync/src/models/operationsMappers.ts deleted file mode 100644 index 0300c447523d..000000000000 --- a/sdk/storagesync/arm-storagesync/src/models/operationsMappers.ts +++ /dev/null @@ -1,17 +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 { - OperationDisplayInfo, - OperationEntity, - OperationEntityListResult, - OperationsListHeaders, - StorageSyncApiError, - StorageSyncError, - StorageSyncErrorDetails -} from "../models/mappers"; diff --git a/sdk/storagesync/arm-storagesync/src/models/parameters.ts b/sdk/storagesync/arm-storagesync/src/models/parameters.ts index 4f73078d7bbc..1a6b7e7c886b 100644 --- a/sdk/storagesync/arm-storagesync/src/models/parameters.ts +++ b/sdk/storagesync/arm-storagesync/src/models/parameters.ts @@ -1,152 +1,291 @@ /* - * 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 { + CheckNameAvailabilityParameters as CheckNameAvailabilityParametersMapper, + StorageSyncServiceCreateParameters as StorageSyncServiceCreateParametersMapper, + StorageSyncServiceUpdateParameters as StorageSyncServiceUpdateParametersMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + SyncGroupCreateParameters as SyncGroupCreateParametersMapper, + CloudEndpointCreateParameters as CloudEndpointCreateParametersMapper, + BackupRequest as BackupRequestMapper, + PreRestoreRequest as PreRestoreRequestMapper, + PostRestoreRequest as PostRestoreRequestMapper, + TriggerChangeDetectionParameters as TriggerChangeDetectionParametersMapper, + ServerEndpointCreateParameters as ServerEndpointCreateParametersMapper, + ServerEndpointUpdateParameters as ServerEndpointUpdateParametersMapper, + RecallActionParameters as RecallActionParametersMapper, + RegisteredServerCreateParameters as RegisteredServerCreateParametersMapper, + TriggerRolloverRequest as TriggerRolloverRequestMapper +} 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: "2020-09-01", + isConstant: true, serializedName: "api-version", - constraints: { - MinLength: 1 - }, type: { name: "String" } } }; -export const cloudEndpointName: msRest.OperationURLParameter = { - parameterPath: "cloudEndpointName", + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", mapper: { + serializedName: "nextLink", required: true, - serializedName: "cloudEndpointName", type: { name: "String" } - } + }, + skipEncoding: true }; -export const locationName: msRest.OperationURLParameter = { - parameterPath: "locationName", + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - required: true, - serializedName: "locationName", + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -export const nextPageLink: msRest.OperationURLParameter = { - parameterPath: "nextPageLink", + +export const parameters: OperationParameter = { + parameterPath: "parameters", + mapper: CheckNameAvailabilityParametersMapper +}; + +export const locationName: OperationURLParameter = { + parameterPath: "locationName", mapper: { + serializedName: "locationName", required: true, - serializedName: "nextLink", type: { name: "String" } - }, - skipEncoding: true + } }; -export const operationId: msRest.OperationURLParameter = { - parameterPath: "operationId", + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "subscriptionId", required: true, - serializedName: "operationId", type: { name: "String" } } }; -export const resourceGroupName: msRest.OperationURLParameter = { + +export const parameters1: OperationParameter = { + parameterPath: "parameters", + mapper: StorageSyncServiceCreateParametersMapper +}; + +export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { - required: true, - serializedName: "resourceGroupName", constraints: { MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, + serializedName: "resourceGroupName", + required: true, type: { name: "String" } } }; -export const serverEndpointName: msRest.OperationURLParameter = { - parameterPath: "serverEndpointName", + +export const storageSyncServiceName: OperationURLParameter = { + parameterPath: "storageSyncServiceName", mapper: { + serializedName: "storageSyncServiceName", required: true, - serializedName: "serverEndpointName", type: { name: "String" } } }; -export const serverId: msRest.OperationURLParameter = { - parameterPath: "serverId", + +export const parameters2: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: StorageSyncServiceUpdateParametersMapper +}; + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", mapper: { + serializedName: "privateEndpointConnectionName", required: true, - serializedName: "serverId", type: { name: "String" } } }; -export const storageSyncServiceName: msRest.OperationURLParameter = { - parameterPath: "storageSyncServiceName", + +export const properties: OperationParameter = { + parameterPath: "properties", + mapper: PrivateEndpointConnectionMapper +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: SyncGroupCreateParametersMapper +}; + +export const syncGroupName: OperationURLParameter = { + parameterPath: "syncGroupName", mapper: { + serializedName: "syncGroupName", required: true, - serializedName: "storageSyncServiceName", type: { name: "String" } } }; -export const subscriptionId: msRest.OperationURLParameter = { - parameterPath: "subscriptionId", + +export const parameters4: OperationParameter = { + parameterPath: "parameters", + mapper: CloudEndpointCreateParametersMapper +}; + +export const cloudEndpointName: OperationURLParameter = { + parameterPath: "cloudEndpointName", mapper: { + serializedName: "cloudEndpointName", required: true, - serializedName: "subscriptionId", - constraints: { - MinLength: 1 - }, type: { name: "String" } } }; -export const syncGroupName: msRest.OperationURLParameter = { - parameterPath: "syncGroupName", + +export const parameters5: OperationParameter = { + parameterPath: "parameters", + mapper: BackupRequestMapper +}; + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: PreRestoreRequestMapper +}; + +export const parameters7: OperationParameter = { + parameterPath: "parameters", + mapper: PostRestoreRequestMapper +}; + +export const parameters8: OperationParameter = { + parameterPath: "parameters", + mapper: TriggerChangeDetectionParametersMapper +}; + +export const parameters9: OperationParameter = { + parameterPath: "parameters", + mapper: ServerEndpointCreateParametersMapper +}; + +export const serverEndpointName: OperationURLParameter = { + parameterPath: "serverEndpointName", mapper: { + serializedName: "serverEndpointName", required: true, - serializedName: "syncGroupName", type: { name: "String" } } }; -export const workflowId: msRest.OperationURLParameter = { - parameterPath: "workflowId", + +export const parameters10: OperationParameter = { + parameterPath: ["options", "parameters"], + mapper: ServerEndpointUpdateParametersMapper +}; + +export const parameters11: OperationParameter = { + parameterPath: "parameters", + mapper: RecallActionParametersMapper +}; + +export const serverId: OperationURLParameter = { + parameterPath: "serverId", mapper: { + serializedName: "serverId", required: true, + type: { + name: "String" + } + } +}; + +export const parameters12: OperationParameter = { + parameterPath: "parameters", + mapper: RegisteredServerCreateParametersMapper +}; + +export const parameters13: OperationParameter = { + parameterPath: "parameters", + mapper: TriggerRolloverRequestMapper +}; + +export const workflowId: OperationURLParameter = { + parameterPath: "workflowId", + mapper: { serializedName: "workflowId", + required: true, + type: { + name: "String" + } + } +}; + +export const operationId: OperationURLParameter = { + parameterPath: "operationId", + mapper: { + serializedName: "operationId", + required: true, type: { name: "String" } diff --git a/sdk/storagesync/arm-storagesync/src/models/registeredServersMappers.ts b/sdk/storagesync/arm-storagesync/src/models/registeredServersMappers.ts deleted file mode 100644 index 558aecd968b0..000000000000 --- a/sdk/storagesync/arm-storagesync/src/models/registeredServersMappers.ts +++ /dev/null @@ -1,42 +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, - CloudEndpoint, - CloudEndpointCreateParameters, - ProxyResource, - RegisteredServer, - RegisteredServerArray, - RegisteredServerCreateParameters, - RegisteredServersCreateHeaders, - RegisteredServersDeleteHeaders, - RegisteredServersGetHeaders, - RegisteredServersListByStorageSyncServiceHeaders, - RegisteredServersTriggerRolloverHeaders, - Resource, - ServerEndpoint, - ServerEndpointCloudTieringStatus, - ServerEndpointCreateParameters, - ServerEndpointFilesNotSyncingError, - ServerEndpointRecallError, - ServerEndpointRecallStatus, - ServerEndpointSyncActivityStatus, - ServerEndpointSyncSessionStatus, - ServerEndpointSyncStatus, - StorageSyncApiError, - StorageSyncError, - StorageSyncErrorDetails, - StorageSyncService, - SyncGroup, - SyncGroupCreateParameters, - TrackedResource, - TriggerRolloverRequest, - Workflow -} from "../models/mappers"; diff --git a/sdk/storagesync/arm-storagesync/src/models/serverEndpointsMappers.ts b/sdk/storagesync/arm-storagesync/src/models/serverEndpointsMappers.ts deleted file mode 100644 index d2cf597bac5b..000000000000 --- a/sdk/storagesync/arm-storagesync/src/models/serverEndpointsMappers.ts +++ /dev/null @@ -1,44 +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, - CloudEndpoint, - CloudEndpointCreateParameters, - ProxyResource, - RecallActionParameters, - RegisteredServer, - RegisteredServerCreateParameters, - Resource, - ServerEndpoint, - ServerEndpointArray, - ServerEndpointCloudTieringStatus, - ServerEndpointCreateParameters, - ServerEndpointFilesNotSyncingError, - ServerEndpointRecallError, - ServerEndpointRecallStatus, - ServerEndpointsCreateHeaders, - ServerEndpointsDeleteHeaders, - ServerEndpointsGetHeaders, - ServerEndpointsListBySyncGroupHeaders, - ServerEndpointsRecallActionHeaders, - ServerEndpointsUpdateHeaders, - ServerEndpointSyncActivityStatus, - ServerEndpointSyncSessionStatus, - ServerEndpointSyncStatus, - ServerEndpointUpdateParameters, - StorageSyncApiError, - StorageSyncError, - StorageSyncErrorDetails, - StorageSyncService, - SyncGroup, - SyncGroupCreateParameters, - TrackedResource, - Workflow -} from "../models/mappers"; diff --git a/sdk/storagesync/arm-storagesync/src/models/storageSyncServicesMappers.ts b/sdk/storagesync/arm-storagesync/src/models/storageSyncServicesMappers.ts deleted file mode 100644 index 2bc4aa2c18e0..000000000000 --- a/sdk/storagesync/arm-storagesync/src/models/storageSyncServicesMappers.ts +++ /dev/null @@ -1,46 +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, - CheckNameAvailabilityResult, - CloudEndpoint, - CloudEndpointCreateParameters, - CloudError, - ProxyResource, - RegisteredServer, - RegisteredServerCreateParameters, - Resource, - ServerEndpoint, - ServerEndpointCloudTieringStatus, - ServerEndpointCreateParameters, - ServerEndpointFilesNotSyncingError, - ServerEndpointRecallError, - ServerEndpointRecallStatus, - ServerEndpointSyncActivityStatus, - ServerEndpointSyncSessionStatus, - ServerEndpointSyncStatus, - StorageSyncApiError, - StorageSyncError, - StorageSyncErrorDetails, - StorageSyncService, - StorageSyncServiceArray, - StorageSyncServiceCreateParameters, - StorageSyncServicesDeleteHeaders, - StorageSyncServicesGetHeaders, - StorageSyncServicesListByResourceGroupHeaders, - StorageSyncServicesListBySubscriptionHeaders, - StorageSyncServicesUpdateHeaders, - StorageSyncServiceUpdateParameters, - SyncGroup, - SyncGroupCreateParameters, - TrackedResource, - Workflow -} from "../models/mappers"; diff --git a/sdk/storagesync/arm-storagesync/src/models/syncGroupsMappers.ts b/sdk/storagesync/arm-storagesync/src/models/syncGroupsMappers.ts deleted file mode 100644 index f7e5c093c068..000000000000 --- a/sdk/storagesync/arm-storagesync/src/models/syncGroupsMappers.ts +++ /dev/null @@ -1,40 +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, - CloudEndpoint, - CloudEndpointCreateParameters, - ProxyResource, - RegisteredServer, - RegisteredServerCreateParameters, - Resource, - ServerEndpoint, - ServerEndpointCloudTieringStatus, - ServerEndpointCreateParameters, - ServerEndpointFilesNotSyncingError, - ServerEndpointRecallError, - ServerEndpointRecallStatus, - ServerEndpointSyncActivityStatus, - ServerEndpointSyncSessionStatus, - ServerEndpointSyncStatus, - StorageSyncApiError, - StorageSyncError, - StorageSyncErrorDetails, - StorageSyncService, - SyncGroup, - SyncGroupArray, - SyncGroupCreateParameters, - SyncGroupsCreateHeaders, - SyncGroupsDeleteHeaders, - SyncGroupsGetHeaders, - SyncGroupsListByStorageSyncServiceHeaders, - TrackedResource, - Workflow -} from "../models/mappers"; diff --git a/sdk/storagesync/arm-storagesync/src/models/workflowsMappers.ts b/sdk/storagesync/arm-storagesync/src/models/workflowsMappers.ts deleted file mode 100644 index cc6031cb217c..000000000000 --- a/sdk/storagesync/arm-storagesync/src/models/workflowsMappers.ts +++ /dev/null @@ -1,39 +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, - CloudEndpoint, - CloudEndpointCreateParameters, - ProxyResource, - RegisteredServer, - RegisteredServerCreateParameters, - Resource, - ServerEndpoint, - ServerEndpointCloudTieringStatus, - ServerEndpointCreateParameters, - ServerEndpointFilesNotSyncingError, - ServerEndpointRecallError, - ServerEndpointRecallStatus, - ServerEndpointSyncActivityStatus, - ServerEndpointSyncSessionStatus, - ServerEndpointSyncStatus, - StorageSyncApiError, - StorageSyncError, - StorageSyncErrorDetails, - StorageSyncService, - SyncGroup, - SyncGroupCreateParameters, - TrackedResource, - Workflow, - WorkflowArray, - WorkflowsAbortHeaders, - WorkflowsGetHeaders, - WorkflowsListByStorageSyncServiceHeaders -} from "../models/mappers"; diff --git a/sdk/storagesync/arm-storagesync/src/operations/cloudEndpoints.ts b/sdk/storagesync/arm-storagesync/src/operations/cloudEndpoints.ts index 0885608e307a..3b5bbe1b6c33 100644 --- a/sdk/storagesync/arm-storagesync/src/operations/cloudEndpoints.ts +++ b/sdk/storagesync/arm-storagesync/src/operations/cloudEndpoints.ts @@ -1,75 +1,248 @@ /* - * 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/cloudEndpointsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { CloudEndpoints } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageSyncManagementClientContext } from "../storageSyncManagementClientContext"; +import { MicrosoftStorageSync } from "../microsoftStorageSync"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + CloudEndpoint, + CloudEndpointsListBySyncGroupOptionalParams, + CloudEndpointCreateParameters, + CloudEndpointsCreateOptionalParams, + CloudEndpointsCreateResponse, + CloudEndpointsGetOptionalParams, + CloudEndpointsGetResponse, + CloudEndpointsDeleteOptionalParams, + CloudEndpointsDeleteResponse, + CloudEndpointsListBySyncGroupResponse, + BackupRequest, + CloudEndpointsPreBackupOptionalParams, + CloudEndpointsPreBackupResponse, + CloudEndpointsPostBackupOptionalParams, + CloudEndpointsPostBackupResponse, + PreRestoreRequest, + CloudEndpointsPreRestoreOptionalParams, + CloudEndpointsRestoreheartbeatOptionalParams, + CloudEndpointsRestoreheartbeatResponse, + PostRestoreRequest, + CloudEndpointsPostRestoreOptionalParams, + TriggerChangeDetectionParameters, + CloudEndpointsTriggerChangeDetectionOptionalParams +} from "../models"; -/** Class representing a CloudEndpoints. */ -export class CloudEndpoints { - private readonly client: StorageSyncManagementClientContext; +/// +/** Class containing CloudEndpoints operations. */ +export class CloudEndpointsImpl implements CloudEndpoints { + private readonly client: MicrosoftStorageSync; /** - * Create a CloudEndpoints. - * @param {StorageSyncManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class CloudEndpoints class. + * @param client Reference to the service client */ - constructor(client: StorageSyncManagementClientContext) { + constructor(client: MicrosoftStorageSync) { this.client = client; } /** - * Create a new CloudEndpoint. + * Get a CloudEndpoint List. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. - * @param cloudEndpointName Name of Cloud Endpoint object. - * @param parameters Body of Cloud Endpoint resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.CloudEndpointCreateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(resourceGroupName,storageSyncServiceName,syncGroupName,cloudEndpointName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + public listBySyncGroup( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: CloudEndpointsListBySyncGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySyncGroupPagingAll( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySyncGroupPagingPage( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + options + ); + } + }; + } + + private async *listBySyncGroupPagingPage( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: CloudEndpointsListBySyncGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySyncGroup( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + options + ); + yield result.value || []; + } + + private async *listBySyncGroupPagingAll( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: CloudEndpointsListBySyncGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySyncGroupPagingPage( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + options + )) { + yield* page; + } } /** - * Get a given CloudEndpoint. + * Create a new CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Body of Cloud Endpoint resource. + * @param options The options parameters. */ - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options?: msRest.RequestOptionsBase): Promise; + async beginCreate( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: CloudEndpointCreateParameters, + options?: CloudEndpointsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CloudEndpointsCreateResponse + > + > { + 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, + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + options + }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Create a new CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param callback The callback + * @param parameters Body of Cloud Endpoint resource. + * @param options The options parameters. */ - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, callback: msRest.ServiceCallback): void; + async beginCreateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: CloudEndpointCreateParameters, + options?: CloudEndpointsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** + * Get a given CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + options?: CloudEndpointsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -78,8 +251,8 @@ export class CloudEndpoints { cloudEndpointName, options }, - getOperationSpec, - callback) as Promise; + getOperationSpec + ); } /** @@ -88,178 +261,392 @@ export class CloudEndpoints { * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,storageSyncServiceName,syncGroupName,cloudEndpointName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } + async beginDelete( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + options?: CloudEndpointsDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CloudEndpointsDeleteResponse + > + > { + 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 a CloudEndpoint List. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param [options] The optional parameters - * @returns Promise - */ - listBySyncGroup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param callback The callback - */ - listBySyncGroup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param options The optional parameters - * @param callback The callback - */ - listBySyncGroup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySyncGroup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + const lro = new LroImpl( + sendOperation, { resourceGroupName, storageSyncServiceName, syncGroupName, + cloudEndpointName, options }, - listBySyncGroupOperationSpec, - callback) as Promise; + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Pre Backup a given CloudEndpoint. + * Delete a given CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param parameters Body of Backup request. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - preBackup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.BackupRequest, options?: msRest.RequestOptionsBase): Promise { - return this.beginPreBackup(resourceGroupName,storageSyncServiceName,syncGroupName,cloudEndpointName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginDeleteAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + options?: CloudEndpointsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + options + ); + return poller.pollUntilDone(); } /** - * Post Backup a given CloudEndpoint. + * Get a CloudEndpoint List. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. - * @param cloudEndpointName Name of Cloud Endpoint object. - * @param parameters Body of Backup request. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - postBackup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.BackupRequest, options?: msRest.RequestOptionsBase): Promise { - return this.beginPostBackup(resourceGroupName,storageSyncServiceName,syncGroupName,cloudEndpointName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + private _listBySyncGroup( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: CloudEndpointsListBySyncGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, storageSyncServiceName, syncGroupName, options }, + listBySyncGroupOperationSpec + ); } /** - * Pre Restore a given CloudEndpoint. + * Pre Backup a given CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param parameters Body of Cloud Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Body of Backup request. + * @param options The options parameters. */ - preRestore(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.PreRestoreRequest, options?: msRest.RequestOptionsBase): Promise { - return this.beginPreRestore(resourceGroupName,storageSyncServiceName,syncGroupName,cloudEndpointName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginPreBackup( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: BackupRequest, + options?: CloudEndpointsPreBackupOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CloudEndpointsPreBackupResponse + > + > { + 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, + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + options + }, + preBackupOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Restore Heartbeat a given CloudEndpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param cloudEndpointName Name of Cloud Endpoint object. - * @param [options] The optional parameters - * @returns Promise - */ - restoreheartbeat(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options?: msRest.RequestOptionsBase): Promise; - /** + * Pre Backup a given CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param callback The callback + * @param parameters Body of Backup request. + * @param options The options parameters. */ - restoreheartbeat(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, callback: msRest.ServiceCallback): void; + async beginPreBackupAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: BackupRequest, + options?: CloudEndpointsPreBackupOptionalParams + ): Promise { + const poller = await this.beginPreBackup( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** + * Post Backup a given CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param options The optional parameters - * @param callback The callback + * @param parameters Body of Backup request. + * @param options The options parameters. */ - restoreheartbeat(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - restoreheartbeat(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginPostBackup( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: BackupRequest, + options?: CloudEndpointsPostBackupOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CloudEndpointsPostBackupResponse + > + > { + 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, storageSyncServiceName, syncGroupName, cloudEndpointName, + parameters, options }, - restoreheartbeatOperationSpec, - callback) as Promise; + postBackupOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Post Restore a given CloudEndpoint. + * Post Backup a given CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param parameters Body of Cloud Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Body of Backup request. + * @param options The options parameters. */ - postRestore(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.PostRestoreRequest, options?: msRest.RequestOptionsBase): Promise { - return this.beginPostRestore(resourceGroupName,storageSyncServiceName,syncGroupName,cloudEndpointName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginPostBackupAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: BackupRequest, + options?: CloudEndpointsPostBackupOptionalParams + ): Promise { + const poller = await this.beginPostBackup( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Triggers detection of changes performed on Azure File share connected to the specified Azure - * File Sync Cloud Endpoint. + * Pre Restore a given CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param parameters Trigger Change Detection Action parameters. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Body of Cloud Endpoint object. + * @param options The options parameters. */ - triggerChangeDetection(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.TriggerChangeDetectionParameters, options?: msRest.RequestOptionsBase): Promise { - return this.beginTriggerChangeDetection(resourceGroupName,storageSyncServiceName,syncGroupName,cloudEndpointName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } + async beginPreRestore( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: PreRestoreRequest, + options?: CloudEndpointsPreRestoreOptionalParams + ): 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() + } + }; + }; - /** - * Create a new CloudEndpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param cloudEndpointName Name of Cloud Endpoint object. - * @param parameters Body of Cloud Endpoint resource. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreate(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.CloudEndpointCreateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + const lro = new LroImpl( + sendOperation, { resourceGroupName, storageSyncServiceName, @@ -268,68 +655,127 @@ export class CloudEndpoints { parameters, options }, - beginCreateOperationSpec, - options); + preRestoreOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Delete a given CloudEndpoint. + * Pre Restore a given CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Body of Cloud Endpoint object. + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - storageSyncServiceName, - syncGroupName, - cloudEndpointName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginPreRestoreAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: PreRestoreRequest, + options?: CloudEndpointsPreRestoreOptionalParams + ): Promise { + const poller = await this.beginPreRestore( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Pre Backup a given CloudEndpoint. + * Restore Heartbeat a given CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param parameters Body of Backup request. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginPreBackup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.BackupRequest, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + restoreheartbeat( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + options?: CloudEndpointsRestoreheartbeatOptionalParams + ): Promise { + return this.client.sendOperationRequest( { resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, - parameters, options }, - beginPreBackupOperationSpec, - options); + restoreheartbeatOperationSpec + ); } /** - * Post Backup a given CloudEndpoint. + * Post Restore a given CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param parameters Body of Backup request. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Body of Cloud Endpoint object. + * @param options The options parameters. */ - beginPostBackup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.BackupRequest, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginPostRestore( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: PostRestoreRequest, + options?: CloudEndpointsPostRestoreOptionalParams + ): 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, storageSyncServiceName, @@ -338,46 +784,101 @@ export class CloudEndpoints { parameters, options }, - beginPostBackupOperationSpec, - options); + postRestoreOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Pre Restore a given CloudEndpoint. + * Post Restore a given CloudEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. * @param parameters Body of Cloud Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginPreRestore(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.PreRestoreRequest, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - storageSyncServiceName, - syncGroupName, - cloudEndpointName, - parameters, - options - }, - beginPreRestoreOperationSpec, - options); + async beginPostRestoreAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: PostRestoreRequest, + options?: CloudEndpointsPostRestoreOptionalParams + ): Promise { + const poller = await this.beginPostRestore( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Post Restore a given CloudEndpoint. + * Triggers detection of changes performed on Azure File share connected to the specified Azure File + * Sync Cloud Endpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. - * @param parameters Body of Cloud Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Trigger Change Detection Action parameters. + * @param options The options parameters. */ - beginPostRestore(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.PostRestoreRequest, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginTriggerChangeDetection( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: TriggerChangeDetectionParameters, + options?: CloudEndpointsTriggerChangeDetectionOptionalParams + ): 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, storageSyncServiceName, @@ -386,54 +887,89 @@ export class CloudEndpoints { parameters, options }, - beginPostRestoreOperationSpec, - options); + triggerChangeDetectionOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Triggers detection of changes performed on Azure File share connected to the specified Azure - * File Sync Cloud Endpoint. + * Triggers detection of changes performed on Azure File share connected to the specified Azure File + * Sync Cloud Endpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param cloudEndpointName Name of Cloud Endpoint object. * @param parameters Trigger Change Detection Action parameters. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginTriggerChangeDetection(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, cloudEndpointName: string, parameters: Models.TriggerChangeDetectionParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - storageSyncServiceName, - syncGroupName, - cloudEndpointName, - parameters, - options - }, - beginTriggerChangeDetectionOperationSpec, - options); + async beginTriggerChangeDetectionAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: TriggerChangeDetectionParameters, + options?: CloudEndpointsTriggerChangeDetectionOptionalParams + ): Promise { + const poller = await this.beginTriggerChangeDetection( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}", +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CloudEndpoint, + headersMapper: Mappers.CloudEndpointsCreateHeaders + }, + 201: { + bodyMapper: Mappers.CloudEndpoint, + headersMapper: Mappers.CloudEndpointsCreateHeaders + }, + 202: { + bodyMapper: Mappers.CloudEndpoint, + headersMapper: Mappers.CloudEndpointsCreateHeaders + }, + 204: { + bodyMapper: Mappers.CloudEndpoint, + headersMapper: Mappers.CloudEndpointsCreateHeaders + }, + default: { + bodyMapper: Mappers.StorageSyncError + } + }, + requestBody: Parameters.parameters4, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName, Parameters.cloudEndpointName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.CloudEndpoint, @@ -443,316 +979,251 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const listBySyncGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, - Parameters.syncGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.syncGroupName, + Parameters.cloudEndpointName ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}", + httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.CloudEndpointArray, - headersMapper: Mappers.CloudEndpointsListBySyncGroupHeaders + headersMapper: Mappers.CloudEndpointsDeleteHeaders + }, + 201: { + headersMapper: Mappers.CloudEndpointsDeleteHeaders + }, + 202: { + headersMapper: Mappers.CloudEndpointsDeleteHeaders + }, + 204: { + headersMapper: Mappers.CloudEndpointsDeleteHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const restoreheartbeatOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName, Parameters.cloudEndpointName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySyncGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints", + httpMethod: "GET", responses: { 200: { - headersMapper: Mappers.CloudEndpointsRestoreheartbeatHeaders + bodyMapper: Mappers.CloudEndpointArray, + headersMapper: Mappers.CloudEndpointsListBySyncGroupHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, - Parameters.syncGroupName, - Parameters.cloudEndpointName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.syncGroupName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.CloudEndpointCreateParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const preBackupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.CloudEndpoint, - headersMapper: Mappers.CloudEndpointsCreateHeaders + headersMapper: Mappers.CloudEndpointsPreBackupHeaders + }, + 201: { + headersMapper: Mappers.CloudEndpointsPreBackupHeaders }, 202: { - headersMapper: Mappers.CloudEndpointsCreateHeaders + headersMapper: Mappers.CloudEndpointsPreBackupHeaders + }, + 204: { + headersMapper: Mappers.CloudEndpointsPreBackupHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}", + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName, Parameters.cloudEndpointName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const postBackupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup", + httpMethod: "POST", responses: { 200: { - headersMapper: Mappers.CloudEndpointsDeleteHeaders + bodyMapper: Mappers.PostBackupResponse, + headersMapper: Mappers.CloudEndpointsPostBackupHeaders + }, + 201: { + bodyMapper: Mappers.PostBackupResponse, + headersMapper: Mappers.CloudEndpointsPostBackupHeaders }, 202: { - headersMapper: Mappers.CloudEndpointsDeleteHeaders + bodyMapper: Mappers.PostBackupResponse, + headersMapper: Mappers.CloudEndpointsPostBackupHeaders }, 204: { - headersMapper: Mappers.CloudEndpointsDeleteHeaders + bodyMapper: Mappers.PostBackupResponse, + headersMapper: Mappers.CloudEndpointsPostBackupHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginPreBackupOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prebackup", + requestBody: Parameters.parameters5, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName, Parameters.cloudEndpointName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.BackupRequest, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const preRestoreOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore", + httpMethod: "POST", responses: { - 200: { - headersMapper: Mappers.CloudEndpointsPreBackupHeaders - }, - 202: { - headersMapper: Mappers.CloudEndpointsPreBackupHeaders - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginPostBackupOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postbackup", + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName, Parameters.cloudEndpointName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.BackupRequest, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const restoreheartbeatOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/restoreheartbeat", + httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.PostBackupResponse, - headersMapper: Mappers.CloudEndpointsPostBackupHeaders - }, - 202: { - headersMapper: Mappers.CloudEndpointsPostBackupHeaders + headersMapper: Mappers.CloudEndpointsRestoreheartbeatHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginPreRestoreOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/prerestore", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName, Parameters.cloudEndpointName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.PreRestoreRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const postRestoreOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore", + httpMethod: "POST", responses: { - 200: { - headersMapper: Mappers.CloudEndpointsPreRestoreHeaders - }, - 202: { - headersMapper: Mappers.CloudEndpointsPreRestoreHeaders - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginPostRestoreOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/postrestore", + requestBody: Parameters.parameters7, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName, Parameters.cloudEndpointName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.PostRestoreRequest, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const triggerChangeDetectionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/triggerChangeDetection", + httpMethod: "POST", responses: { - 200: { - headersMapper: Mappers.CloudEndpointsPostRestoreHeaders - }, - 202: { - headersMapper: Mappers.CloudEndpointsPostRestoreHeaders - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginTriggerChangeDetectionOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/triggerChangeDetection", + requestBody: Parameters.parameters8, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName, Parameters.cloudEndpointName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.TriggerChangeDetectionParameters, - required: true - } - }, - responses: { - 200: { - headersMapper: Mappers.CloudEndpointsTriggerChangeDetectionHeaders - }, - 202: { - headersMapper: Mappers.CloudEndpointsTriggerChangeDetectionHeaders - }, - default: { - bodyMapper: Mappers.StorageSyncError - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/storagesync/arm-storagesync/src/operations/index.ts b/sdk/storagesync/arm-storagesync/src/operations/index.ts index d6e1eee242fe..d191ca1962b7 100644 --- a/sdk/storagesync/arm-storagesync/src/operations/index.ts +++ b/sdk/storagesync/arm-storagesync/src/operations/index.ts @@ -1,15 +1,15 @@ /* - * 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 "./operations"; export * from "./storageSyncServices"; +export * from "./privateLinkResources"; +export * from "./privateEndpointConnections"; export * from "./syncGroups"; export * from "./cloudEndpoints"; export * from "./serverEndpoints"; diff --git a/sdk/storagesync/arm-storagesync/src/operations/operationStatusOperations.ts b/sdk/storagesync/arm-storagesync/src/operations/operationStatusOperations.ts index 5e94dc133c06..caa62a2e93ab 100644 --- a/sdk/storagesync/arm-storagesync/src/operations/operationStatusOperations.ts +++ b/sdk/storagesync/arm-storagesync/src/operations/operationStatusOperations.ts @@ -1,28 +1,31 @@ /* - * 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/operationStatusOperationsMappers"; +import { OperationStatusOperations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageSyncManagementClientContext } from "../storageSyncManagementClientContext"; +import { MicrosoftStorageSync } from "../microsoftStorageSync"; +import { + OperationStatusGetOptionalParams, + OperationStatusGetResponse +} from "../models"; -/** Class representing a OperationStatusOperations. */ -export class OperationStatusOperations { - private readonly client: StorageSyncManagementClientContext; +/** Class containing OperationStatusOperations operations. */ +export class OperationStatusOperationsImpl + implements OperationStatusOperations { + private readonly client: MicrosoftStorageSync; /** - * Create a OperationStatusOperations. - * @param {StorageSyncManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class OperationStatusOperations class. + * @param client Reference to the service client */ - constructor(client: StorageSyncManagementClientContext) { + constructor(client: MicrosoftStorageSync) { this.client = client; } @@ -32,59 +35,28 @@ export class OperationStatusOperations { * @param locationName The desired region to obtain information from. * @param workflowId workflow Id * @param operationId operation Id - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, locationName: string, workflowId: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param locationName The desired region to obtain information from. - * @param workflowId workflow Id - * @param operationId operation Id - * @param callback The callback - */ - get(resourceGroupName: string, locationName: string, workflowId: string, operationId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param locationName The desired region to obtain information from. - * @param workflowId workflow Id - * @param operationId operation Id - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, locationName: string, workflowId: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, locationName: string, workflowId: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + locationName: string, + workflowId: string, + operationId: string, + options?: OperationStatusGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - locationName, - workflowId, - operationId, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, locationName, workflowId, operationId, 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/locations/{locationName}/workflows/{workflowId}/operations/{operationId}", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/locations/{locationName}/workflows/{workflowId}/operations/{operationId}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.locationName, - Parameters.workflowId, - Parameters.operationId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationStatus, @@ -94,5 +66,15 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.locationName, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.workflowId, + Parameters.operationId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storagesync/arm-storagesync/src/operations/operations.ts b/sdk/storagesync/arm-storagesync/src/operations/operations.ts index 5e526f5a7e9c..43f0ff5c5fba 100644 --- a/sdk/storagesync/arm-storagesync/src/operations/operations.ts +++ b/sdk/storagesync/arm-storagesync/src/operations/operations.ts @@ -1,95 +1,111 @@ /* - * 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 { StorageSyncManagementClientContext } from "../storageSyncManagementClientContext"; +import { MicrosoftStorageSync } from "../microsoftStorageSync"; +import { + OperationEntity, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse +} from "../models"; -/** Class representing a Operations. */ -export class Operations { - private readonly client: StorageSyncManagementClientContext; +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: MicrosoftStorageSync; /** - * Create a Operations. - * @param {StorageSyncManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client */ - constructor(client: StorageSyncManagementClientContext) { + constructor(client: MicrosoftStorageSync) { this.client = client; } /** * Lists all of the available Storage Sync Rest API operations. - * @param [options] The optional parameters - * @returns Promise + * @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 Storage Sync Rest API operations. - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param callback The callback - */ - 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.StorageSync/operations", httpMethod: "GET", - path: "providers/Microsoft.StorageSync/operations", - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.OperationEntityListResult, @@ -99,27 +115,25 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, + 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.OperationEntityListResult, - headersMapper: Mappers.OperationsListHeaders + headersMapper: Mappers.OperationsListNextHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storagesync/arm-storagesync/src/operations/privateEndpointConnections.ts b/sdk/storagesync/arm-storagesync/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..b5bac3d3a11f --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operations/privateEndpointConnections.ts @@ -0,0 +1,451 @@ +/* + * 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 { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftStorageSync } from "../microsoftStorageSync"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByStorageSyncServiceOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsCreateResponse, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsListByStorageSyncServiceResponse +} from "../models"; + +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: MicrosoftStorageSync; + + /** + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftStorageSync) { + this.client = client; + } + + /** + * Get a PrivateEndpointConnection List. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param options The options parameters. + */ + public listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: PrivateEndpointConnectionsListByStorageSyncServiceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByStorageSyncServicePagingAll( + resourceGroupName, + storageSyncServiceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByStorageSyncServicePagingPage( + resourceGroupName, + storageSyncServiceName, + options + ); + } + }; + } + + private async *listByStorageSyncServicePagingPage( + resourceGroupName: string, + storageSyncServiceName: string, + options?: PrivateEndpointConnectionsListByStorageSyncServiceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByStorageSyncService( + resourceGroupName, + storageSyncServiceName, + options + ); + yield result.value || []; + } + + private async *listByStorageSyncServicePagingAll( + resourceGroupName: string, + storageSyncServiceName: string, + options?: PrivateEndpointConnectionsListByStorageSyncServiceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByStorageSyncServicePagingPage( + resourceGroupName, + storageSyncServiceName, + options + )) { + yield* page; + } + } + + /** + * Gets the specified private endpoint connection associated with the storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + storageSyncServiceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + storageSyncServiceName, + privateEndpointConnectionName, + options + }, + getOperationSpec + ); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @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. + */ + async beginCreate( + resourceGroupName: string, + storageSyncServiceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsCreateResponse + > + > { + 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, + storageSyncServiceName, + privateEndpointConnectionName, + properties, + options + }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @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. + */ + async beginCreateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + storageSyncServiceName, + privateEndpointConnectionName, + properties, + options + ); + return poller.pollUntilDone(); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + storageSyncServiceName: 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() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + storageSyncServiceName, + privateEndpointConnectionName, + options + }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + storageSyncServiceName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get a PrivateEndpointConnection List. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param options The options parameters. + */ + private _listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: PrivateEndpointConnectionsListByStorageSyncServiceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, storageSyncServiceName, options }, + listByStorageSyncServiceOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.StorageSyncError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSyncServiceName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.StorageSyncError + } + }, + requestBody: Parameters.properties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSyncServiceName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.StorageSyncError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSyncServiceName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByStorageSyncServiceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult, + headersMapper: + Mappers.PrivateEndpointConnectionsListByStorageSyncServiceHeaders + }, + default: { + bodyMapper: Mappers.StorageSyncError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSyncServiceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/storagesync/arm-storagesync/src/operations/privateLinkResources.ts b/sdk/storagesync/arm-storagesync/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..26892559b3ef --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operations/privateLinkResources.ts @@ -0,0 +1,70 @@ +/* + * 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 { PrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { MicrosoftStorageSync } from "../microsoftStorageSync"; +import { + PrivateLinkResourcesListByStorageSyncServiceOptionalParams, + PrivateLinkResourcesListByStorageSyncServiceResponse +} from "../models"; + +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: MicrosoftStorageSync; + + /** + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client + */ + constructor(client: MicrosoftStorageSync) { + this.client = client; + } + + /** + * Gets the private link resources that need to be created for a storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @param options The options parameters. + */ + listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: PrivateLinkResourcesListByStorageSyncServiceOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, storageSyncServiceName, options }, + listByStorageSyncServiceOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByStorageSyncServiceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/privateLinkResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSyncServiceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/storagesync/arm-storagesync/src/operations/registeredServers.ts b/sdk/storagesync/arm-storagesync/src/operations/registeredServers.ts index a82543597dcd..0b3ef1b06107 100644 --- a/sdk/storagesync/arm-storagesync/src/operations/registeredServers.ts +++ b/sdk/storagesync/arm-storagesync/src/operations/registeredServers.ts @@ -1,29 +1,45 @@ /* - * 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/registeredServersMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { RegisteredServers } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageSyncManagementClientContext } from "../storageSyncManagementClientContext"; +import { MicrosoftStorageSync } from "../microsoftStorageSync"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + RegisteredServer, + RegisteredServersListByStorageSyncServiceOptionalParams, + RegisteredServersListByStorageSyncServiceResponse, + RegisteredServersGetOptionalParams, + RegisteredServersGetResponse, + RegisteredServerCreateParameters, + RegisteredServersCreateOptionalParams, + RegisteredServersCreateResponse, + RegisteredServersDeleteOptionalParams, + RegisteredServersDeleteResponse, + TriggerRolloverRequest, + RegisteredServersTriggerRolloverOptionalParams, + RegisteredServersTriggerRolloverResponse +} from "../models"; -/** Class representing a RegisteredServers. */ -export class RegisteredServers { - private readonly client: StorageSyncManagementClientContext; +/// +/** Class containing RegisteredServers operations. */ +export class RegisteredServersImpl implements RegisteredServers { + private readonly client: MicrosoftStorageSync; /** - * Create a RegisteredServers. - * @param {StorageSyncManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class RegisteredServers class. + * @param client Reference to the service client */ - constructor(client: StorageSyncManagementClientContext) { + constructor(client: MicrosoftStorageSync) { this.client = client; } @@ -31,32 +47,77 @@ export class RegisteredServers { * Get a given registered server list. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param callback The callback - */ - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, callback: msRest.ServiceCallback): void; + public listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: RegisteredServersListByStorageSyncServiceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByStorageSyncServicePagingAll( + resourceGroupName, + storageSyncServiceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByStorageSyncServicePagingPage( + resourceGroupName, + storageSyncServiceName, + options + ); + } + }; + } + + private async *listByStorageSyncServicePagingPage( + resourceGroupName: string, + storageSyncServiceName: string, + options?: RegisteredServersListByStorageSyncServiceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByStorageSyncService( + resourceGroupName, + storageSyncServiceName, + options + ); + yield result.value || []; + } + + private async *listByStorageSyncServicePagingAll( + resourceGroupName: string, + storageSyncServiceName: string, + options?: RegisteredServersListByStorageSyncServiceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByStorageSyncServicePagingPage( + resourceGroupName, + storageSyncServiceName, + options + )) { + yield* page; + } + } + /** + * Get a given registered server list. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: RegisteredServersListByStorageSyncServiceOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - storageSyncServiceName, - options - }, - listByStorageSyncServiceOperationSpec, - callback) as Promise; + { resourceGroupName, storageSyncServiceName, options }, + listByStorageSyncServiceOperationSpec + ); } /** @@ -64,35 +125,94 @@ export class RegisteredServers { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param serverId GUID identifying the on-premises server. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, storageSyncServiceName: string, serverId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param serverId GUID identifying the on-premises server. - * @param callback The callback - */ - get(resourceGroupName: string, storageSyncServiceName: string, serverId: string, callback: msRest.ServiceCallback): void; + get( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + options?: RegisteredServersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, storageSyncServiceName, serverId, options }, + getOperationSpec + ); + } + /** + * Add a new registered server. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param serverId GUID identifying the on-premises server. - * @param options The optional parameters - * @param callback The callback + * @param parameters Body of Registered Server object. + * @param options The options parameters. */ - get(resourceGroupName: string, storageSyncServiceName: string, serverId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, storageSyncServiceName: string, serverId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreate( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + parameters: RegisteredServerCreateParameters, + options?: RegisteredServersCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RegisteredServersCreateResponse + > + > { + 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, storageSyncServiceName, serverId, + parameters, options }, - getOperationSpec, - callback) as Promise; + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -101,12 +221,23 @@ export class RegisteredServers { * @param storageSyncServiceName Name of Storage Sync Service resource. * @param serverId GUID identifying the on-premises server. * @param parameters Body of Registered Server object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: Models.RegisteredServerCreateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(resourceGroupName,storageSyncServiceName,serverId,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + parameters: RegisteredServerCreateParameters, + options?: RegisteredServersCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + storageSyncServiceName, + serverId, + parameters, + options + ); + return poller.pollUntilDone(); } /** @@ -114,68 +245,165 @@ export class RegisteredServers { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param serverId GUID identifying the on-premises server. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, storageSyncServiceName: string, serverId: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,storageSyncServiceName,serverId,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; - } + async beginDelete( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + options?: RegisteredServersDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RegisteredServersDeleteResponse + > + > { + 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() + } + }; + }; - /** - * Triggers Server certificate rollover. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param serverId Server Id - * @param parameters Body of Trigger Rollover request. - * @param [options] The optional parameters - * @returns Promise - */ - triggerRollover(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: Models.TriggerRolloverRequest, options?: msRest.RequestOptionsBase): Promise { - return this.beginTriggerRollover(resourceGroupName,storageSyncServiceName,serverId,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + const lro = new LroImpl( + sendOperation, + { resourceGroupName, storageSyncServiceName, serverId, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Add a new registered server. + * Delete the given registered server. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param serverId GUID identifying the on-premises server. - * @param parameters Body of Registered Server object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreate(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: Models.RegisteredServerCreateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - storageSyncServiceName, - serverId, - parameters, - options - }, - beginCreateOperationSpec, - options); + async beginDeleteAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + options?: RegisteredServersDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + storageSyncServiceName, + serverId, + options + ); + return poller.pollUntilDone(); } /** - * Delete the given registered server. + * Triggers Server certificate rollover. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param serverId GUID identifying the on-premises server. - * @param [options] The optional parameters - * @returns Promise + * @param serverId Server Id + * @param parameters Body of Trigger Rollover request. + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, storageSyncServiceName: string, serverId: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginTriggerRollover( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + parameters: TriggerRolloverRequest, + options?: RegisteredServersTriggerRolloverOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RegisteredServersTriggerRolloverResponse + > + > { + 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, storageSyncServiceName, serverId, + parameters, options }, - beginDeleteMethodOperationSpec, - options); + triggerRolloverOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -184,39 +412,32 @@ export class RegisteredServers { * @param storageSyncServiceName Name of Storage Sync Service resource. * @param serverId Server Id * @param parameters Body of Trigger Rollover request. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginTriggerRollover(resourceGroupName: string, storageSyncServiceName: string, serverId: string, parameters: Models.TriggerRolloverRequest, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - storageSyncServiceName, - serverId, - parameters, - options - }, - beginTriggerRolloverOperationSpec, - options); + async beginTriggerRolloverAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + parameters: TriggerRolloverRequest, + options?: RegisteredServersTriggerRolloverOptionalParams + ): Promise { + const poller = await this.beginTriggerRollover( + resourceGroupName, + storageSyncServiceName, + serverId, + parameters, + options + ); + return poller.pollUntilDone(); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByStorageSyncServiceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByStorageSyncServiceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.storageSyncServiceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.RegisteredServerArray, @@ -226,24 +447,20 @@ const listByStorageSyncServiceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.storageSyncServiceName, - Parameters.serverId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.storageSyncServiceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.RegisteredServer, @@ -253,65 +470,66 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.serverId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RegisteredServerCreateParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.RegisteredServer, headersMapper: Mappers.RegisteredServersCreateHeaders }, + 201: { + bodyMapper: Mappers.RegisteredServer, + headersMapper: Mappers.RegisteredServersCreateHeaders + }, 202: { + bodyMapper: Mappers.RegisteredServer, + headersMapper: Mappers.RegisteredServersCreateHeaders + }, + 204: { + bodyMapper: Mappers.RegisteredServer, headersMapper: Mappers.RegisteredServersCreateHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}", + requestBody: Parameters.parameters12, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.serverId ], - 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.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}", + httpMethod: "DELETE", responses: { 200: { headersMapper: Mappers.RegisteredServersDeleteHeaders }, + 201: { + headersMapper: Mappers.RegisteredServersDeleteHeaders + }, 202: { headersMapper: Mappers.RegisteredServersDeleteHeaders }, @@ -322,41 +540,48 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginTriggerRolloverOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.serverId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.TriggerRolloverRequest, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const triggerRolloverOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover", + httpMethod: "POST", responses: { 200: { headersMapper: Mappers.RegisteredServersTriggerRolloverHeaders }, + 201: { + headersMapper: Mappers.RegisteredServersTriggerRolloverHeaders + }, 202: { headersMapper: Mappers.RegisteredServersTriggerRolloverHeaders }, + 204: { + headersMapper: Mappers.RegisteredServersTriggerRolloverHeaders + }, default: { bodyMapper: Mappers.StorageSyncError } }, + requestBody: Parameters.parameters13, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSyncServiceName, + Parameters.serverId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/storagesync/arm-storagesync/src/operations/serverEndpoints.ts b/sdk/storagesync/arm-storagesync/src/operations/serverEndpoints.ts index e4ebf1aa217e..5f1f461ad3f5 100644 --- a/sdk/storagesync/arm-storagesync/src/operations/serverEndpoints.ts +++ b/sdk/storagesync/arm-storagesync/src/operations/serverEndpoints.ts @@ -1,201 +1,414 @@ /* - * 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/serverEndpointsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ServerEndpoints } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageSyncManagementClientContext } from "../storageSyncManagementClientContext"; +import { MicrosoftStorageSync } from "../microsoftStorageSync"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + ServerEndpoint, + ServerEndpointsListBySyncGroupOptionalParams, + ServerEndpointCreateParameters, + ServerEndpointsCreateOptionalParams, + ServerEndpointsCreateResponse, + ServerEndpointsUpdateOptionalParams, + ServerEndpointsUpdateResponse, + ServerEndpointsGetOptionalParams, + ServerEndpointsGetResponse, + ServerEndpointsDeleteOptionalParams, + ServerEndpointsDeleteResponse, + ServerEndpointsListBySyncGroupResponse, + RecallActionParameters, + ServerEndpointsRecallActionOptionalParams, + ServerEndpointsRecallActionResponse +} from "../models"; -/** Class representing a ServerEndpoints. */ -export class ServerEndpoints { - private readonly client: StorageSyncManagementClientContext; +/// +/** Class containing ServerEndpoints operations. */ +export class ServerEndpointsImpl implements ServerEndpoints { + private readonly client: MicrosoftStorageSync; /** - * Create a ServerEndpoints. - * @param {StorageSyncManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class ServerEndpoints class. + * @param client Reference to the service client */ - constructor(client: StorageSyncManagementClientContext) { + constructor(client: MicrosoftStorageSync) { this.client = client; } /** - * Create a new ServerEndpoint. + * Get a ServerEndpoint list. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. - * @param serverEndpointName Name of Server Endpoint object. - * @param parameters Body of Server Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, parameters: Models.ServerEndpointCreateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.beginCreate(resourceGroupName,storageSyncServiceName,syncGroupName,serverEndpointName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + public listBySyncGroup( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: ServerEndpointsListBySyncGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySyncGroupPagingAll( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySyncGroupPagingPage( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + options + ); + } + }; } - /** - * Patch a given ServerEndpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param serverEndpointName Name of Server Endpoint object. - * @param [options] The optional parameters - * @returns Promise - */ - update(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options?: Models.ServerEndpointsUpdateOptionalParams): Promise { - return this.beginUpdate(resourceGroupName,storageSyncServiceName,syncGroupName,serverEndpointName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + private async *listBySyncGroupPagingPage( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: ServerEndpointsListBySyncGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySyncGroup( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + options + ); + yield result.value || []; + } + + private async *listBySyncGroupPagingAll( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: ServerEndpointsListBySyncGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySyncGroupPagingPage( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + options + )) { + yield* page; + } } /** - * Get a ServerEndpoint. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param serverEndpointName Name of Server Endpoint object. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param serverEndpointName Name of Server Endpoint object. - * @param callback The callback - */ - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, callback: msRest.ServiceCallback): void; - /** + * Create a new ServerEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param serverEndpointName Name of Server Endpoint object. - * @param options The optional parameters - * @param callback The callback + * @param parameters Body of Server Endpoint object. + * @param options The options parameters. */ - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginCreate( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + parameters: ServerEndpointCreateParameters, + options?: ServerEndpointsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServerEndpointsCreateResponse + > + > { + 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, storageSyncServiceName, syncGroupName, serverEndpointName, + parameters, options }, - getOperationSpec, - callback) as Promise; + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Delete a given ServerEndpoint. + * Create a new ServerEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param serverEndpointName Name of Server Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param parameters Body of Server Endpoint object. + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options?: msRest.RequestOptionsBase): Promise { - return this.beginDeleteMethod(resourceGroupName,storageSyncServiceName,syncGroupName,serverEndpointName,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginCreateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + parameters: ServerEndpointCreateParameters, + options?: ServerEndpointsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + serverEndpointName, + parameters, + options + ); + return poller.pollUntilDone(); } /** - * Get a ServerEndpoint list. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param [options] The optional parameters - * @returns Promise - */ - listBySyncGroup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param callback The callback - */ - listBySyncGroup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, callback: msRest.ServiceCallback): void; - /** + * Patch a given ServerEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. - * @param options The optional parameters - * @param callback The callback + * @param serverEndpointName Name of Server Endpoint object. + * @param options The options parameters. */ - listBySyncGroup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySyncGroup(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + async beginUpdate( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + options?: ServerEndpointsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServerEndpointsUpdateResponse + > + > { + 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, storageSyncServiceName, syncGroupName, + serverEndpointName, options }, - listBySyncGroupOperationSpec, - callback) as Promise; + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** - * Recall a server endpoint. + * Patch a given ServerEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param serverEndpointName Name of Server Endpoint object. - * @param parameters Body of Recall Action object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - recallAction(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, parameters: Models.RecallActionParameters, options?: msRest.RequestOptionsBase): Promise { - return this.beginRecallAction(resourceGroupName,storageSyncServiceName,syncGroupName,serverEndpointName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + async beginUpdateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + options?: ServerEndpointsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + serverEndpointName, + options + ); + return poller.pollUntilDone(); } /** - * Create a new ServerEndpoint. + * Get a ServerEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param serverEndpointName Name of Server Endpoint object. - * @param parameters Body of Server Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginCreate(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, parameters: Models.ServerEndpointCreateParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + get( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + options?: ServerEndpointsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( { resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, - parameters, options }, - beginCreateOperationSpec, - options); + getOperationSpec + ); } /** - * Patch a given ServerEndpoint. + * Delete a given ServerEndpoint. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param serverEndpointName Name of Server Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginUpdate(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options?: Models.ServerEndpointsBeginUpdateOptionalParams): Promise { - return this.client.sendLRORequest( + async beginDelete( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + options?: ServerEndpointsDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServerEndpointsDeleteResponse + > + > { + 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, storageSyncServiceName, @@ -203,8 +416,12 @@ export class ServerEndpoints { serverEndpointName, options }, - beginUpdateOperationSpec, - options); + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } /** @@ -213,20 +430,42 @@ export class ServerEndpoints { * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param serverEndpointName Name of Server Endpoint object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginDeleteMethod(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - storageSyncServiceName, - syncGroupName, - serverEndpointName, - options - }, - beginDeleteMethodOperationSpec, - options); + async beginDeleteAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + options?: ServerEndpointsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + serverEndpointName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Get a ServerEndpoint list. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param options The options parameters. + */ + private _listBySyncGroup( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: ServerEndpointsListBySyncGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, storageSyncServiceName, syncGroupName, options }, + listBySyncGroupOperationSpec + ); } /** @@ -236,11 +475,62 @@ export class ServerEndpoints { * @param syncGroupName Name of Sync Group resource. * @param serverEndpointName Name of Server Endpoint object. * @param parameters Body of Recall Action object. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - beginRecallAction(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, serverEndpointName: string, parameters: Models.RecallActionParameters, options?: msRest.RequestOptionsBase): Promise { - return this.client.sendLRORequest( + async beginRecallAction( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + parameters: RecallActionParameters, + options?: ServerEndpointsRecallActionOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServerEndpointsRecallActionResponse + > + > { + 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, storageSyncServiceName, @@ -249,207 +539,237 @@ export class ServerEndpoints { parameters, options }, - beginRecallActionOperationSpec, - options); + recallActionOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); } -} + /** + * Recall a server endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @param options The options parameters. + */ + async beginRecallActionAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + parameters: RecallActionParameters, + options?: ServerEndpointsRecallActionOptionalParams + ): Promise { + const poller = await this.beginRecallAction( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + serverEndpointName, + parameters, + options + ); + return poller.pollUntilDone(); + } +} // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.storageSyncServiceName, - Parameters.syncGroupName, - Parameters.serverEndpointName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.ServerEndpoint, - headersMapper: Mappers.ServerEndpointsGetHeaders + headersMapper: Mappers.ServerEndpointsCreateHeaders + }, + 201: { + bodyMapper: Mappers.ServerEndpoint, + headersMapper: Mappers.ServerEndpointsCreateHeaders + }, + 202: { + bodyMapper: Mappers.ServerEndpoint, + headersMapper: Mappers.ServerEndpointsCreateHeaders + }, + 204: { + bodyMapper: Mappers.ServerEndpoint, + headersMapper: Mappers.ServerEndpointsCreateHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const listBySyncGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints", + requestBody: Parameters.parameters9, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, - Parameters.syncGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.syncGroupName, + Parameters.serverEndpointName ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.ServerEndpointArray, - headersMapper: Mappers.ServerEndpointsListBySyncGroupHeaders + bodyMapper: Mappers.ServerEndpoint, + headersMapper: Mappers.ServerEndpointsUpdateHeaders + }, + 201: { + bodyMapper: Mappers.ServerEndpoint, + headersMapper: Mappers.ServerEndpointsUpdateHeaders + }, + 202: { + bodyMapper: Mappers.ServerEndpoint, + headersMapper: Mappers.ServerEndpointsUpdateHeaders + }, + 204: { + bodyMapper: Mappers.ServerEndpoint, + headersMapper: Mappers.ServerEndpointsUpdateHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", + requestBody: Parameters.parameters10, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName, Parameters.serverEndpointName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.ServerEndpointCreateParameters, - required: true - } - }, + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.ServerEndpoint, - headersMapper: Mappers.ServerEndpointsCreateHeaders - }, - 202: { - headersMapper: Mappers.ServerEndpointsCreateHeaders + headersMapper: Mappers.ServerEndpointsGetHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginUpdateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName, Parameters.serverEndpointName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: [ - "options", - "parameters" - ], - mapper: Mappers.ServerEndpointUpdateParameters - }, + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", + httpMethod: "DELETE", responses: { 200: { - bodyMapper: Mappers.ServerEndpoint, - headersMapper: Mappers.ServerEndpointsUpdateHeaders + headersMapper: Mappers.ServerEndpointsDeleteHeaders + }, + 201: { + headersMapper: Mappers.ServerEndpointsDeleteHeaders }, 202: { - headersMapper: Mappers.ServerEndpointsUpdateHeaders + headersMapper: Mappers.ServerEndpointsDeleteHeaders + }, + 204: { + headersMapper: Mappers.ServerEndpointsDeleteHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginDeleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName, Parameters.serverEndpointName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySyncGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints", + httpMethod: "GET", responses: { 200: { - headersMapper: Mappers.ServerEndpointsDeleteHeaders - }, - 202: { - headersMapper: Mappers.ServerEndpointsDeleteHeaders + bodyMapper: Mappers.ServerEndpointArray, + headersMapper: Mappers.ServerEndpointsListBySyncGroupHeaders }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const beginRecallActionOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, - Parameters.syncGroupName, - Parameters.serverEndpointName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.syncGroupName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.RecallActionParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const recallActionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints/{serverEndpointName}/recallAction", + httpMethod: "POST", responses: { 200: { headersMapper: Mappers.ServerEndpointsRecallActionHeaders }, + 201: { + headersMapper: Mappers.ServerEndpointsRecallActionHeaders + }, 202: { headersMapper: Mappers.ServerEndpointsRecallActionHeaders }, + 204: { + headersMapper: Mappers.ServerEndpointsRecallActionHeaders + }, default: { bodyMapper: Mappers.StorageSyncError } }, + requestBody: Parameters.parameters11, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSyncServiceName, + Parameters.syncGroupName, + Parameters.serverEndpointName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; diff --git a/sdk/storagesync/arm-storagesync/src/operations/storageSyncServices.ts b/sdk/storagesync/arm-storagesync/src/operations/storageSyncServices.ts index 4b38dbe1496f..e16acca4d1bc 100644 --- a/sdk/storagesync/arm-storagesync/src/operations/storageSyncServices.ts +++ b/sdk/storagesync/arm-storagesync/src/operations/storageSyncServices.ts @@ -1,61 +1,146 @@ /* - * 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/storageSyncServicesMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { StorageSyncServices } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageSyncManagementClientContext } from "../storageSyncManagementClientContext"; +import { MicrosoftStorageSync } from "../microsoftStorageSync"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + StorageSyncService, + StorageSyncServicesListByResourceGroupOptionalParams, + StorageSyncServicesListBySubscriptionOptionalParams, + CheckNameAvailabilityParameters, + StorageSyncServicesCheckNameAvailabilityOptionalParams, + StorageSyncServicesCheckNameAvailabilityResponse, + StorageSyncServiceCreateParameters, + StorageSyncServicesCreateOptionalParams, + StorageSyncServicesCreateResponse, + StorageSyncServicesGetOptionalParams, + StorageSyncServicesGetResponse, + StorageSyncServicesUpdateOptionalParams, + StorageSyncServicesUpdateResponse, + StorageSyncServicesDeleteOptionalParams, + StorageSyncServicesDeleteResponse, + StorageSyncServicesListByResourceGroupResponse, + StorageSyncServicesListBySubscriptionResponse +} from "../models"; -/** Class representing a StorageSyncServices. */ -export class StorageSyncServices { - private readonly client: StorageSyncManagementClientContext; +/// +/** Class containing StorageSyncServices operations. */ +export class StorageSyncServicesImpl implements StorageSyncServices { + private readonly client: MicrosoftStorageSync; /** - * Create a StorageSyncServices. - * @param {StorageSyncManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class StorageSyncServices class. + * @param client Reference to the service client */ - constructor(client: StorageSyncManagementClientContext) { + constructor(client: MicrosoftStorageSync) { this.client = client; } /** - * Check the give namespace name availability. - * @param locationName The desired region for the name check. - * @param parameters Parameters to check availability of the given namespace name - * @param [options] The optional parameters - * @returns Promise + * Get a StorageSyncService list by Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. */ - checkNameAvailability(locationName: string, parameters: Models.CheckNameAvailabilityParameters, options?: msRest.RequestOptionsBase): Promise; + public listByResourceGroup( + resourceGroupName: string, + options?: StorageSyncServicesListByResourceGroupOptionalParams + ): 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?: StorageSyncServicesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: StorageSyncServicesListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + /** - * @param locationName The desired region for the name check. - * @param parameters Parameters to check availability of the given namespace name - * @param callback The callback + * Get a StorageSyncService list by subscription. + * @param options The options parameters. */ - checkNameAvailability(locationName: string, parameters: Models.CheckNameAvailabilityParameters, callback: msRest.ServiceCallback): void; + public listBySubscription( + options?: StorageSyncServicesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: StorageSyncServicesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + } + + private async *listBySubscriptionPagingAll( + options?: StorageSyncServicesListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + /** + * Check the give namespace name availability. * @param locationName The desired region for the name check. * @param parameters Parameters to check availability of the given namespace name - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - checkNameAvailability(locationName: string, parameters: Models.CheckNameAvailabilityParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(locationName: string, parameters: Models.CheckNameAvailabilityParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + checkNameAvailability( + locationName: string, + parameters: CheckNameAvailabilityParameters, + options?: StorageSyncServicesCheckNameAvailabilityOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - locationName, - parameters, - options - }, - checkNameAvailabilityOperationSpec, - callback) as Promise; + { locationName, parameters, options }, + checkNameAvailabilityOperationSpec + ); } /** @@ -63,265 +148,366 @@ export class StorageSyncServices { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param parameters Storage Sync Service resource name. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - create(resourceGroupName: string, storageSyncServiceName: string, parameters: Models.StorageSyncServiceCreateParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param parameters Storage Sync Service resource name. - * @param callback The callback - */ - create(resourceGroupName: string, storageSyncServiceName: string, parameters: Models.StorageSyncServiceCreateParameters, callback: msRest.ServiceCallback): void; + async beginCreate( + resourceGroupName: string, + storageSyncServiceName: string, + parameters: StorageSyncServiceCreateParameters, + options?: StorageSyncServicesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageSyncServicesCreateResponse + > + > { + 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, storageSyncServiceName, parameters, options }, + createOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Create a new StorageSyncService. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param parameters Storage Sync Service resource name. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - create(resourceGroupName: string, storageSyncServiceName: string, parameters: Models.StorageSyncServiceCreateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - create(resourceGroupName: string, storageSyncServiceName: string, parameters: Models.StorageSyncServiceCreateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - storageSyncServiceName, - parameters, - options - }, - createOperationSpec, - callback) as Promise; + async beginCreateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + parameters: StorageSyncServiceCreateParameters, + options?: StorageSyncServicesCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + storageSyncServiceName, + parameters, + options + ); + return poller.pollUntilDone(); } /** * Get a given StorageSyncService. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, storageSyncServiceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param callback The callback - */ - get(resourceGroupName: string, storageSyncServiceName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, storageSyncServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, storageSyncServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + storageSyncServiceName: string, + options?: StorageSyncServicesGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - storageSyncServiceName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, storageSyncServiceName, options }, + getOperationSpec + ); } /** * Patch a given StorageSyncService. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - update(resourceGroupName: string, storageSyncServiceName: string, options?: Models.StorageSyncServicesUpdateOptionalParams): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param callback The callback - */ - update(resourceGroupName: string, storageSyncServiceName: string, callback: msRest.ServiceCallback): void; + async beginUpdate( + resourceGroupName: string, + storageSyncServiceName: string, + options?: StorageSyncServicesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageSyncServicesUpdateResponse + > + > { + 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, storageSyncServiceName, options }, + updateOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Patch a given StorageSyncService. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - update(resourceGroupName: string, storageSyncServiceName: string, options: Models.StorageSyncServicesUpdateOptionalParams, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, storageSyncServiceName: string, options?: Models.StorageSyncServicesUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - storageSyncServiceName, - options - }, - updateOperationSpec, - callback) as Promise; + async beginUpdateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + options?: StorageSyncServicesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + storageSyncServiceName, + options + ); + return poller.pollUntilDone(); } /** * Delete a given StorageSyncService. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, storageSyncServiceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, storageSyncServiceName: string, callback: msRest.ServiceCallback): void; + async beginDelete( + resourceGroupName: string, + storageSyncServiceName: string, + options?: StorageSyncServicesDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageSyncServicesDeleteResponse + > + > { + 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, storageSyncServiceName, options }, + deleteOperationSpec + ); + return new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + } + /** + * Delete a given StorageSyncService. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, storageSyncServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, storageSyncServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - storageSyncServiceName, - options - }, - deleteMethodOperationSpec, - callback) as Promise; + async beginDeleteAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + options?: StorageSyncServicesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + storageSyncServiceName, + options + ); + return poller.pollUntilDone(); } /** * Get a StorageSyncService list by Resource group name. * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param [options] The optional parameters - * @returns Promise - */ - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param callback The callback + * @param options The options parameters. */ - listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The optional parameters - * @param callback The callback - */ - listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByResourceGroup( + resourceGroupName: string, + options?: StorageSyncServicesListByResourceGroupOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - options - }, - listByResourceGroupOperationSpec, - callback) as Promise; + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); } /** * Get a StorageSyncService list by subscription. - * @param [options] The optional parameters - * @returns Promise - */ - listBySubscription(options?: msRest.RequestOptionsBase): Promise; - /** - * @param callback The callback - */ - listBySubscription(callback: msRest.ServiceCallback): void; - /** - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listBySubscription( + options?: StorageSyncServicesListBySubscriptionOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - options - }, - listBySubscriptionOperationSpec, - callback) as Promise; + { options }, + listBySubscriptionOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability", httpMethod: "POST", - path: "subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/checkNameAvailability", - urlParameters: [ - Parameters.locationName, - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.CheckNameAvailabilityParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.CheckNameAvailabilityResult - }, - default: { - bodyMapper: Mappers.CloudError } }, + requestBody: Parameters.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.locationName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", serializer }; - -const createOperationSpec: msRest.OperationSpec = { +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}", httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.storageSyncServiceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.StorageSyncServiceCreateParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.StorageSyncService }, + 201: { + bodyMapper: Mappers.StorageSyncService + }, + 202: { + bodyMapper: Mappers.StorageSyncService + }, + 204: { + bodyMapper: Mappers.StorageSyncService + }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}", + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.StorageSyncService, @@ -331,60 +517,67 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - requestBody: { - parameterPath: [ - "options", - "parameters" - ], - mapper: Mappers.StorageSyncServiceUpdateParameters - }, + headerParameters: [Parameters.accept], + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}", + httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.StorageSyncService, headersMapper: Mappers.StorageSyncServicesUpdateHeaders }, + 201: { + bodyMapper: Mappers.StorageSyncService, + headersMapper: Mappers.StorageSyncServicesUpdateHeaders + }, + 202: { + bodyMapper: Mappers.StorageSyncService, + headersMapper: Mappers.StorageSyncServicesUpdateHeaders + }, + 204: { + bodyMapper: Mappers.StorageSyncService, + headersMapper: Mappers.StorageSyncServicesUpdateHeaders + }, default: { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}", + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName ], - 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.StorageSync/storageSyncServices/{storageSyncServiceName}", + httpMethod: "DELETE", responses: { 200: { headersMapper: Mappers.StorageSyncServicesDeleteHeaders }, + 201: { + headersMapper: Mappers.StorageSyncServicesDeleteHeaders + }, + 202: { + headersMapper: Mappers.StorageSyncServicesDeleteHeaders + }, 204: { headersMapper: Mappers.StorageSyncServicesDeleteHeaders }, @@ -392,22 +585,20 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const listByResourceGroupOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.resourceGroupName, + Parameters.storageSyncServiceName ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.StorageSyncServiceArray, @@ -417,21 +608,19 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], serializer }; - -const listBySubscriptionOperationSpec: msRest.OperationSpec = { +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.StorageSyncServiceArray, @@ -441,5 +630,8 @@ const listBySubscriptionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storagesync/arm-storagesync/src/operations/syncGroups.ts b/sdk/storagesync/arm-storagesync/src/operations/syncGroups.ts index b8af33870b65..b620204682f4 100644 --- a/sdk/storagesync/arm-storagesync/src/operations/syncGroups.ts +++ b/sdk/storagesync/arm-storagesync/src/operations/syncGroups.ts @@ -1,28 +1,40 @@ /* - * 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/syncGroupsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SyncGroups } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageSyncManagementClientContext } from "../storageSyncManagementClientContext"; +import { MicrosoftStorageSync } from "../microsoftStorageSync"; +import { + SyncGroup, + SyncGroupsListByStorageSyncServiceOptionalParams, + SyncGroupsListByStorageSyncServiceResponse, + SyncGroupCreateParameters, + SyncGroupsCreateOptionalParams, + SyncGroupsCreateResponse, + SyncGroupsGetOptionalParams, + SyncGroupsGetResponse, + SyncGroupsDeleteOptionalParams, + SyncGroupsDeleteResponse +} from "../models"; -/** Class representing a SyncGroups. */ -export class SyncGroups { - private readonly client: StorageSyncManagementClientContext; +/// +/** Class containing SyncGroups operations. */ +export class SyncGroupsImpl implements SyncGroups { + private readonly client: MicrosoftStorageSync; /** - * Create a SyncGroups. - * @param {StorageSyncManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class SyncGroups class. + * @param client Reference to the service client */ - constructor(client: StorageSyncManagementClientContext) { + constructor(client: MicrosoftStorageSync) { this.client = client; } @@ -30,32 +42,77 @@ export class SyncGroups { * Get a SyncGroup List. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param callback The callback - */ - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, callback: msRest.ServiceCallback): void; + public listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: SyncGroupsListByStorageSyncServiceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByStorageSyncServicePagingAll( + resourceGroupName, + storageSyncServiceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByStorageSyncServicePagingPage( + resourceGroupName, + storageSyncServiceName, + options + ); + } + }; + } + + private async *listByStorageSyncServicePagingPage( + resourceGroupName: string, + storageSyncServiceName: string, + options?: SyncGroupsListByStorageSyncServiceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByStorageSyncService( + resourceGroupName, + storageSyncServiceName, + options + ); + yield result.value || []; + } + + private async *listByStorageSyncServicePagingAll( + resourceGroupName: string, + storageSyncServiceName: string, + options?: SyncGroupsListByStorageSyncServiceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByStorageSyncServicePagingPage( + resourceGroupName, + storageSyncServiceName, + options + )) { + yield* page; + } + } + /** + * Get a SyncGroup List. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: SyncGroupsListByStorageSyncServiceOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - storageSyncServiceName, - options - }, - listByStorageSyncServiceOperationSpec, - callback) as Promise; + { resourceGroupName, storageSyncServiceName, options }, + listByStorageSyncServiceOperationSpec + ); } /** @@ -64,28 +121,15 @@ export class SyncGroups { * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. * @param parameters Sync Group Body - * @param [options] The optional parameters - * @returns Promise - */ - create(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, parameters: Models.SyncGroupCreateParameters, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param parameters Sync Group Body - * @param callback The callback - */ - create(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, parameters: Models.SyncGroupCreateParameters, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param parameters Sync Group Body - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - create(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, parameters: Models.SyncGroupCreateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - create(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, parameters: Models.SyncGroupCreateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + create( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + parameters: SyncGroupCreateParameters, + options?: SyncGroupsCreateOptionalParams + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -94,8 +138,8 @@ export class SyncGroups { parameters, options }, - createOperationSpec, - callback) as Promise; + createOperationSpec + ); } /** @@ -103,35 +147,18 @@ export class SyncGroups { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. - * @param [options] The optional parameters - * @returns Promise - */ - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param callback The callback + * @param options The options parameters. */ - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: SyncGroupsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - storageSyncServiceName, - syncGroupName, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, storageSyncServiceName, syncGroupName, options }, + getOperationSpec + ); } /** @@ -139,54 +166,27 @@ export class SyncGroups { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param syncGroupName Name of Sync Group resource. - * @param [options] The optional parameters - * @returns Promise - */ - deleteMethod(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param callback The callback - */ - deleteMethod(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param syncGroupName Name of Sync Group resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - deleteMethod(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, storageSyncServiceName: string, syncGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + delete( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: SyncGroupsDeleteOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - storageSyncServiceName, - syncGroupName, - options - }, - deleteMethodOperationSpec, - callback) as Promise; + { resourceGroupName, storageSyncServiceName, syncGroupName, options }, + deleteOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByStorageSyncServiceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByStorageSyncServiceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.storageSyncServiceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.SyncGroupArray, @@ -196,31 +196,20 @@ const listByStorageSyncServiceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const createOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.storageSyncServiceName, - Parameters.syncGroupName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.storageSyncServiceName ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.SyncGroupCreateParameters, - required: true - } - }, + headerParameters: [Parameters.accept], + serializer +}; +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.SyncGroup, @@ -230,24 +219,23 @@ const createOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}", + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.SyncGroup, @@ -257,34 +245,38 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const deleteMethodOperationSpec: msRest.OperationSpec = { - httpMethod: "DELETE", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.syncGroupName ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}", + httpMethod: "DELETE", responses: { 200: { headersMapper: Mappers.SyncGroupsDeleteHeaders }, - 204: { - headersMapper: Mappers.SyncGroupsDeleteHeaders - }, + 204: {}, default: { bodyMapper: Mappers.StorageSyncError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSyncServiceName, + Parameters.syncGroupName + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storagesync/arm-storagesync/src/operations/workflows.ts b/sdk/storagesync/arm-storagesync/src/operations/workflows.ts index a2b8c6bbfe2d..deccf111042e 100644 --- a/sdk/storagesync/arm-storagesync/src/operations/workflows.ts +++ b/sdk/storagesync/arm-storagesync/src/operations/workflows.ts @@ -1,28 +1,37 @@ /* - * 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/workflowsMappers"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Workflows } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageSyncManagementClientContext } from "../storageSyncManagementClientContext"; +import { MicrosoftStorageSync } from "../microsoftStorageSync"; +import { + Workflow, + WorkflowsListByStorageSyncServiceOptionalParams, + WorkflowsListByStorageSyncServiceResponse, + WorkflowsGetOptionalParams, + WorkflowsGetResponse, + WorkflowsAbortOptionalParams, + WorkflowsAbortResponse +} from "../models"; -/** Class representing a Workflows. */ -export class Workflows { - private readonly client: StorageSyncManagementClientContext; +/// +/** Class containing Workflows operations. */ +export class WorkflowsImpl implements Workflows { + private readonly client: MicrosoftStorageSync; /** - * Create a Workflows. - * @param {StorageSyncManagementClientContext} client Reference to the service client. + * Initialize a new instance of the class Workflows class. + * @param client Reference to the service client */ - constructor(client: StorageSyncManagementClientContext) { + constructor(client: MicrosoftStorageSync) { this.client = client; } @@ -30,32 +39,77 @@ export class Workflows { * Get a Workflow List * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param callback The callback - */ - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, callback: msRest.ServiceCallback): void; + public listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: WorkflowsListByStorageSyncServiceOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByStorageSyncServicePagingAll( + resourceGroupName, + storageSyncServiceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByStorageSyncServicePagingPage( + resourceGroupName, + storageSyncServiceName, + options + ); + } + }; + } + + private async *listByStorageSyncServicePagingPage( + resourceGroupName: string, + storageSyncServiceName: string, + options?: WorkflowsListByStorageSyncServiceOptionalParams + ): AsyncIterableIterator { + let result = await this._listByStorageSyncService( + resourceGroupName, + storageSyncServiceName, + options + ); + yield result.value || []; + } + + private async *listByStorageSyncServicePagingAll( + resourceGroupName: string, + storageSyncServiceName: string, + options?: WorkflowsListByStorageSyncServiceOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByStorageSyncServicePagingPage( + resourceGroupName, + storageSyncServiceName, + options + )) { + yield* page; + } + } + /** + * Get a Workflow List * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param options The optional parameters - * @param callback The callback + * @param options The options parameters. */ - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByStorageSyncService(resourceGroupName: string, storageSyncServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + private _listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: WorkflowsListByStorageSyncServiceOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - storageSyncServiceName, - options - }, - listByStorageSyncServiceOperationSpec, - callback) as Promise; + { resourceGroupName, storageSyncServiceName, options }, + listByStorageSyncServiceOperationSpec + ); } /** @@ -63,35 +117,18 @@ export class Workflows { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param workflowId workflow Id - * @param [options] The optional parameters - * @returns Promise + * @param options The options parameters. */ - get(resourceGroupName: string, storageSyncServiceName: string, workflowId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param workflowId workflow Id - * @param callback The callback - */ - get(resourceGroupName: string, storageSyncServiceName: string, workflowId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param workflowId workflow Id - * @param options The optional parameters - * @param callback The callback - */ - get(resourceGroupName: string, storageSyncServiceName: string, workflowId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, storageSyncServiceName: string, workflowId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get( + resourceGroupName: string, + storageSyncServiceName: string, + workflowId: string, + options?: WorkflowsGetOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - storageSyncServiceName, - workflowId, - options - }, - getOperationSpec, - callback) as Promise; + { resourceGroupName, storageSyncServiceName, workflowId, options }, + getOperationSpec + ); } /** @@ -99,54 +136,27 @@ export class Workflows { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageSyncServiceName Name of Storage Sync Service resource. * @param workflowId workflow Id - * @param [options] The optional parameters - * @returns Promise - */ - abort(resourceGroupName: string, storageSyncServiceName: string, workflowId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param workflowId workflow Id - * @param callback The callback + * @param options The options parameters. */ - abort(resourceGroupName: string, storageSyncServiceName: string, workflowId: string, callback: msRest.ServiceCallback): void; - /** - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param storageSyncServiceName Name of Storage Sync Service resource. - * @param workflowId workflow Id - * @param options The optional parameters - * @param callback The callback - */ - abort(resourceGroupName: string, storageSyncServiceName: string, workflowId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - abort(resourceGroupName: string, storageSyncServiceName: string, workflowId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + abort( + resourceGroupName: string, + storageSyncServiceName: string, + workflowId: string, + options?: WorkflowsAbortOptionalParams + ): Promise { return this.client.sendOperationRequest( - { - resourceGroupName, - storageSyncServiceName, - workflowId, - options - }, - abortOperationSpec, - callback) as Promise; + { resourceGroupName, storageSyncServiceName, workflowId, options }, + abortOperationSpec + ); } } - // Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const listByStorageSyncServiceOperationSpec: msRest.OperationSpec = { +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByStorageSyncServiceOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows", httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows", - urlParameters: [ - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.storageSyncServiceName - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], responses: { 200: { bodyMapper: Mappers.WorkflowArray, @@ -156,24 +166,20 @@ const listByStorageSyncServiceOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.storageSyncServiceName, - Parameters.workflowId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage + Parameters.storageSyncServiceName ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.Workflow, @@ -183,24 +189,21 @@ const getOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, - serializer -}; - -const abortOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort", + queryParameters: [Parameters.apiVersion], urlParameters: [ + Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.storageSyncServiceName, Parameters.workflowId ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], + headerParameters: [Parameters.accept], + serializer +}; +const abortOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort", + httpMethod: "POST", responses: { 200: { headersMapper: Mappers.WorkflowsAbortHeaders @@ -209,5 +212,14 @@ const abortOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StorageSyncError } }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.storageSyncServiceName, + Parameters.workflowId + ], + headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/storagesync/arm-storagesync/src/operationsInterfaces/cloudEndpoints.ts b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/cloudEndpoints.ts new file mode 100644 index 000000000000..aee04df08ce5 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/cloudEndpoints.ts @@ -0,0 +1,338 @@ +/* + * 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 { + CloudEndpoint, + CloudEndpointsListBySyncGroupOptionalParams, + CloudEndpointCreateParameters, + CloudEndpointsCreateOptionalParams, + CloudEndpointsCreateResponse, + CloudEndpointsGetOptionalParams, + CloudEndpointsGetResponse, + CloudEndpointsDeleteOptionalParams, + CloudEndpointsDeleteResponse, + BackupRequest, + CloudEndpointsPreBackupOptionalParams, + CloudEndpointsPreBackupResponse, + CloudEndpointsPostBackupOptionalParams, + CloudEndpointsPostBackupResponse, + PreRestoreRequest, + CloudEndpointsPreRestoreOptionalParams, + CloudEndpointsRestoreheartbeatOptionalParams, + CloudEndpointsRestoreheartbeatResponse, + PostRestoreRequest, + CloudEndpointsPostRestoreOptionalParams, + TriggerChangeDetectionParameters, + CloudEndpointsTriggerChangeDetectionOptionalParams +} from "../models"; + +/// +/** Interface representing a CloudEndpoints. */ +export interface CloudEndpoints { + /** + * Get a CloudEndpoint List. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param options The options parameters. + */ + listBySyncGroup( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: CloudEndpointsListBySyncGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a new CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: CloudEndpointCreateParameters, + options?: CloudEndpointsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CloudEndpointsCreateResponse + > + >; + /** + * Create a new CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: CloudEndpointCreateParameters, + options?: CloudEndpointsCreateOptionalParams + ): Promise; + /** + * Get a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + options?: CloudEndpointsGetOptionalParams + ): Promise; + /** + * Delete a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + options?: CloudEndpointsDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CloudEndpointsDeleteResponse + > + >; + /** + * Delete a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + options?: CloudEndpointsDeleteOptionalParams + ): Promise; + /** + * Pre Backup a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param options The options parameters. + */ + beginPreBackup( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: BackupRequest, + options?: CloudEndpointsPreBackupOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CloudEndpointsPreBackupResponse + > + >; + /** + * Pre Backup a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param options The options parameters. + */ + beginPreBackupAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: BackupRequest, + options?: CloudEndpointsPreBackupOptionalParams + ): Promise; + /** + * Post Backup a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param options The options parameters. + */ + beginPostBackup( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: BackupRequest, + options?: CloudEndpointsPostBackupOptionalParams + ): Promise< + PollerLike< + PollOperationState, + CloudEndpointsPostBackupResponse + > + >; + /** + * Post Backup a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param options The options parameters. + */ + beginPostBackupAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: BackupRequest, + options?: CloudEndpointsPostBackupOptionalParams + ): Promise; + /** + * Pre Restore a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param options The options parameters. + */ + beginPreRestore( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: PreRestoreRequest, + options?: CloudEndpointsPreRestoreOptionalParams + ): Promise, void>>; + /** + * Pre Restore a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param options The options parameters. + */ + beginPreRestoreAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: PreRestoreRequest, + options?: CloudEndpointsPreRestoreOptionalParams + ): Promise; + /** + * Restore Heartbeat a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param options The options parameters. + */ + restoreheartbeat( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + options?: CloudEndpointsRestoreheartbeatOptionalParams + ): Promise; + /** + * Post Restore a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param options The options parameters. + */ + beginPostRestore( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: PostRestoreRequest, + options?: CloudEndpointsPostRestoreOptionalParams + ): Promise, void>>; + /** + * Post Restore a given CloudEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param options The options parameters. + */ + beginPostRestoreAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: PostRestoreRequest, + options?: CloudEndpointsPostRestoreOptionalParams + ): Promise; + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File + * Sync Cloud Endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @param options The options parameters. + */ + beginTriggerChangeDetection( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: TriggerChangeDetectionParameters, + options?: CloudEndpointsTriggerChangeDetectionOptionalParams + ): Promise, void>>; + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File + * Sync Cloud Endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @param options The options parameters. + */ + beginTriggerChangeDetectionAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + cloudEndpointName: string, + parameters: TriggerChangeDetectionParameters, + options?: CloudEndpointsTriggerChangeDetectionOptionalParams + ): Promise; +} diff --git a/sdk/storagesync/arm-storagesync/src/operationsInterfaces/index.ts b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..d191ca1962b7 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./storageSyncServices"; +export * from "./privateLinkResources"; +export * from "./privateEndpointConnections"; +export * from "./syncGroups"; +export * from "./cloudEndpoints"; +export * from "./serverEndpoints"; +export * from "./registeredServers"; +export * from "./workflows"; +export * from "./operationStatusOperations"; diff --git a/sdk/storagesync/arm-storagesync/src/operationsInterfaces/operationStatusOperations.ts b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/operationStatusOperations.ts new file mode 100644 index 000000000000..8dafd3536529 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/operationStatusOperations.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 { + OperationStatusGetOptionalParams, + OperationStatusGetResponse +} from "../models"; + +/** Interface representing a OperationStatusOperations. */ +export interface OperationStatusOperations { + /** + * Get Operation status + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param locationName The desired region to obtain information from. + * @param workflowId workflow Id + * @param operationId operation Id + * @param options The options parameters. + */ + get( + resourceGroupName: string, + locationName: string, + workflowId: string, + operationId: string, + options?: OperationStatusGetOptionalParams + ): Promise; +} diff --git a/sdk/storagesync/arm-storagesync/src/operationsInterfaces/operations.ts b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..144c7342d245 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/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 { OperationEntity, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * Lists all of the available Storage Sync Rest API operations. + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/storagesync/arm-storagesync/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..d2e446e0aa5a --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,119 @@ +/* + * 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 { + PrivateEndpointConnection, + PrivateEndpointConnectionsListByStorageSyncServiceOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsCreateResponse, + PrivateEndpointConnectionsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * Get a PrivateEndpointConnection List. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param options The options parameters. + */ + listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: PrivateEndpointConnectionsListByStorageSyncServiceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets the specified private endpoint connection associated with the storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + get( + resourceGroupName: string, + storageSyncServiceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @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. + */ + beginCreate( + resourceGroupName: string, + storageSyncServiceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionsCreateResponse + > + >; + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @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. + */ + beginCreateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams + ): Promise; + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + storageSyncServiceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storagesync/arm-storagesync/src/operationsInterfaces/privateLinkResources.ts b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..00dc1b04bfb1 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,28 @@ +/* + * 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 { + PrivateLinkResourcesListByStorageSyncServiceOptionalParams, + PrivateLinkResourcesListByStorageSyncServiceResponse +} from "../models"; + +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a storage sync service. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified + * resource group. + * @param options The options parameters. + */ + listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: PrivateLinkResourcesListByStorageSyncServiceOptionalParams + ): Promise; +} diff --git a/sdk/storagesync/arm-storagesync/src/operationsInterfaces/registeredServers.ts b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/registeredServers.ts new file mode 100644 index 000000000000..f3d622f64b65 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/registeredServers.ts @@ -0,0 +1,154 @@ +/* + * 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 { + RegisteredServer, + RegisteredServersListByStorageSyncServiceOptionalParams, + RegisteredServersGetOptionalParams, + RegisteredServersGetResponse, + RegisteredServerCreateParameters, + RegisteredServersCreateOptionalParams, + RegisteredServersCreateResponse, + RegisteredServersDeleteOptionalParams, + RegisteredServersDeleteResponse, + TriggerRolloverRequest, + RegisteredServersTriggerRolloverOptionalParams, + RegisteredServersTriggerRolloverResponse +} from "../models"; + +/// +/** Interface representing a RegisteredServers. */ +export interface RegisteredServers { + /** + * Get a given registered server list. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param options The options parameters. + */ + listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: RegisteredServersListByStorageSyncServiceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a given registered server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + options?: RegisteredServersGetOptionalParams + ): Promise; + /** + * Add a new registered server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + parameters: RegisteredServerCreateParameters, + options?: RegisteredServersCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RegisteredServersCreateResponse + > + >; + /** + * Add a new registered server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + parameters: RegisteredServerCreateParameters, + options?: RegisteredServersCreateOptionalParams + ): Promise; + /** + * Delete the given registered server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + options?: RegisteredServersDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RegisteredServersDeleteResponse + > + >; + /** + * Delete the given registered server. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + options?: RegisteredServersDeleteOptionalParams + ): Promise; + /** + * Triggers Server certificate rollover. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @param parameters Body of Trigger Rollover request. + * @param options The options parameters. + */ + beginTriggerRollover( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + parameters: TriggerRolloverRequest, + options?: RegisteredServersTriggerRolloverOptionalParams + ): Promise< + PollerLike< + PollOperationState, + RegisteredServersTriggerRolloverResponse + > + >; + /** + * Triggers Server certificate rollover. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id + * @param parameters Body of Trigger Rollover request. + * @param options The options parameters. + */ + beginTriggerRolloverAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + serverId: string, + parameters: TriggerRolloverRequest, + options?: RegisteredServersTriggerRolloverOptionalParams + ): Promise; +} diff --git a/sdk/storagesync/arm-storagesync/src/operationsInterfaces/serverEndpoints.ts b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/serverEndpoints.ts new file mode 100644 index 000000000000..10ce98ffc813 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/serverEndpoints.ts @@ -0,0 +1,207 @@ +/* + * 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 { + ServerEndpoint, + ServerEndpointsListBySyncGroupOptionalParams, + ServerEndpointCreateParameters, + ServerEndpointsCreateOptionalParams, + ServerEndpointsCreateResponse, + ServerEndpointsUpdateOptionalParams, + ServerEndpointsUpdateResponse, + ServerEndpointsGetOptionalParams, + ServerEndpointsGetResponse, + ServerEndpointsDeleteOptionalParams, + ServerEndpointsDeleteResponse, + RecallActionParameters, + ServerEndpointsRecallActionOptionalParams, + ServerEndpointsRecallActionResponse +} from "../models"; + +/// +/** Interface representing a ServerEndpoints. */ +export interface ServerEndpoints { + /** + * Get a ServerEndpoint list. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param options The options parameters. + */ + listBySyncGroup( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: ServerEndpointsListBySyncGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a new ServerEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + parameters: ServerEndpointCreateParameters, + options?: ServerEndpointsCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServerEndpointsCreateResponse + > + >; + /** + * Create a new ServerEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + parameters: ServerEndpointCreateParameters, + options?: ServerEndpointsCreateOptionalParams + ): Promise; + /** + * Patch a given ServerEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + options?: ServerEndpointsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServerEndpointsUpdateResponse + > + >; + /** + * Patch a given ServerEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + options?: ServerEndpointsUpdateOptionalParams + ): Promise; + /** + * Get a ServerEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + options?: ServerEndpointsGetOptionalParams + ): Promise; + /** + * Delete a given ServerEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + options?: ServerEndpointsDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServerEndpointsDeleteResponse + > + >; + /** + * Delete a given ServerEndpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + options?: ServerEndpointsDeleteOptionalParams + ): Promise; + /** + * Recall a server endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @param options The options parameters. + */ + beginRecallAction( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + parameters: RecallActionParameters, + options?: ServerEndpointsRecallActionOptionalParams + ): Promise< + PollerLike< + PollOperationState, + ServerEndpointsRecallActionResponse + > + >; + /** + * Recall a server endpoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @param options The options parameters. + */ + beginRecallActionAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + serverEndpointName: string, + parameters: RecallActionParameters, + options?: ServerEndpointsRecallActionOptionalParams + ): Promise; +} diff --git a/sdk/storagesync/arm-storagesync/src/operationsInterfaces/storageSyncServices.ts b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/storageSyncServices.ts new file mode 100644 index 000000000000..5c34dd282e78 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/storageSyncServices.ts @@ -0,0 +1,155 @@ +/* + * 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 { + StorageSyncService, + StorageSyncServicesListByResourceGroupOptionalParams, + StorageSyncServicesListBySubscriptionOptionalParams, + CheckNameAvailabilityParameters, + StorageSyncServicesCheckNameAvailabilityOptionalParams, + StorageSyncServicesCheckNameAvailabilityResponse, + StorageSyncServiceCreateParameters, + StorageSyncServicesCreateOptionalParams, + StorageSyncServicesCreateResponse, + StorageSyncServicesGetOptionalParams, + StorageSyncServicesGetResponse, + StorageSyncServicesUpdateOptionalParams, + StorageSyncServicesUpdateResponse, + StorageSyncServicesDeleteOptionalParams, + StorageSyncServicesDeleteResponse +} from "../models"; + +/// +/** Interface representing a StorageSyncServices. */ +export interface StorageSyncServices { + /** + * Get a StorageSyncService list by Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: StorageSyncServicesListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a StorageSyncService list by subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: StorageSyncServicesListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Check the give namespace name availability. + * @param locationName The desired region for the name check. + * @param parameters Parameters to check availability of the given namespace name + * @param options The options parameters. + */ + checkNameAvailability( + locationName: string, + parameters: CheckNameAvailabilityParameters, + options?: StorageSyncServicesCheckNameAvailabilityOptionalParams + ): Promise; + /** + * Create a new StorageSyncService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + storageSyncServiceName: string, + parameters: StorageSyncServiceCreateParameters, + options?: StorageSyncServicesCreateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageSyncServicesCreateResponse + > + >; + /** + * Create a new StorageSyncService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + parameters: StorageSyncServiceCreateParameters, + options?: StorageSyncServicesCreateOptionalParams + ): Promise; + /** + * Get a given StorageSyncService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + storageSyncServiceName: string, + options?: StorageSyncServicesGetOptionalParams + ): Promise; + /** + * Patch a given StorageSyncService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + storageSyncServiceName: string, + options?: StorageSyncServicesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageSyncServicesUpdateResponse + > + >; + /** + * Patch a given StorageSyncService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + options?: StorageSyncServicesUpdateOptionalParams + ): Promise; + /** + * Delete a given StorageSyncService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + storageSyncServiceName: string, + options?: StorageSyncServicesDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + StorageSyncServicesDeleteResponse + > + >; + /** + * Delete a given StorageSyncService. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + storageSyncServiceName: string, + options?: StorageSyncServicesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storagesync/arm-storagesync/src/operationsInterfaces/syncGroups.ts b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/syncGroups.ts new file mode 100644 index 000000000000..b4af1f412728 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/syncGroups.ts @@ -0,0 +1,77 @@ +/* + * 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 { + SyncGroup, + SyncGroupsListByStorageSyncServiceOptionalParams, + SyncGroupCreateParameters, + SyncGroupsCreateOptionalParams, + SyncGroupsCreateResponse, + SyncGroupsGetOptionalParams, + SyncGroupsGetResponse, + SyncGroupsDeleteOptionalParams, + SyncGroupsDeleteResponse +} from "../models"; + +/// +/** Interface representing a SyncGroups. */ +export interface SyncGroups { + /** + * Get a SyncGroup List. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param options The options parameters. + */ + listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: SyncGroupsListByStorageSyncServiceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Create a new SyncGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param parameters Sync Group Body + * @param options The options parameters. + */ + create( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + parameters: SyncGroupCreateParameters, + options?: SyncGroupsCreateOptionalParams + ): Promise; + /** + * Get a given SyncGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: SyncGroupsGetOptionalParams + ): Promise; + /** + * Delete a given SyncGroup. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + storageSyncServiceName: string, + syncGroupName: string, + options?: SyncGroupsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/storagesync/arm-storagesync/src/operationsInterfaces/workflows.ts b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/workflows.ts new file mode 100644 index 000000000000..b9e2b7d0fe88 --- /dev/null +++ b/sdk/storagesync/arm-storagesync/src/operationsInterfaces/workflows.ts @@ -0,0 +1,59 @@ +/* + * 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 { + Workflow, + WorkflowsListByStorageSyncServiceOptionalParams, + WorkflowsGetOptionalParams, + WorkflowsGetResponse, + WorkflowsAbortOptionalParams, + WorkflowsAbortResponse +} from "../models"; + +/// +/** Interface representing a Workflows. */ +export interface Workflows { + /** + * Get a Workflow List + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param options The options parameters. + */ + listByStorageSyncService( + resourceGroupName: string, + storageSyncServiceName: string, + options?: WorkflowsListByStorageSyncServiceOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get Workflows resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @param options The options parameters. + */ + get( + resourceGroupName: string, + storageSyncServiceName: string, + workflowId: string, + options?: WorkflowsGetOptionalParams + ): Promise; + /** + * Abort the given workflow. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id + * @param options The options parameters. + */ + abort( + resourceGroupName: string, + storageSyncServiceName: string, + workflowId: string, + options?: WorkflowsAbortOptionalParams + ): Promise; +} diff --git a/sdk/storagesync/arm-storagesync/src/storageSyncManagementClient.ts b/sdk/storagesync/arm-storagesync/src/storageSyncManagementClient.ts deleted file mode 100644 index e8507d474340..000000000000 --- a/sdk/storagesync/arm-storagesync/src/storageSyncManagementClient.ts +++ /dev/null @@ -1,56 +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 msRest from "@azure/ms-rest-js"; -import * as Models from "./models"; -import * as Mappers from "./models/mappers"; -import * as operations from "./operations"; -import { StorageSyncManagementClientContext } from "./storageSyncManagementClientContext"; - - -class StorageSyncManagementClient extends StorageSyncManagementClientContext { - // Operation groups - operations: operations.Operations; - storageSyncServices: operations.StorageSyncServices; - syncGroups: operations.SyncGroups; - cloudEndpoints: operations.CloudEndpoints; - serverEndpoints: operations.ServerEndpoints; - registeredServers: operations.RegisteredServers; - workflows: operations.Workflows; - operationStatus: operations.OperationStatusOperations; - - /** - * Initializes a new instance of the StorageSyncManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The ID of the target subscription. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.StorageSyncManagementClientOptions) { - super(credentials, subscriptionId, options); - this.operations = new operations.Operations(this); - this.storageSyncServices = new operations.StorageSyncServices(this); - this.syncGroups = new operations.SyncGroups(this); - this.cloudEndpoints = new operations.CloudEndpoints(this); - this.serverEndpoints = new operations.ServerEndpoints(this); - this.registeredServers = new operations.RegisteredServers(this); - this.workflows = new operations.Workflows(this); - this.operationStatus = new operations.OperationStatusOperations(this); - } -} - -// Operation Specifications - -export { - StorageSyncManagementClient, - StorageSyncManagementClientContext, - Models as StorageSyncManagementModels, - Mappers as StorageSyncManagementMappers -}; -export * from "./operations"; diff --git a/sdk/storagesync/arm-storagesync/src/storageSyncManagementClientContext.ts b/sdk/storagesync/arm-storagesync/src/storageSyncManagementClientContext.ts deleted file mode 100644 index ef8da155c09f..000000000000 --- a/sdk/storagesync/arm-storagesync/src/storageSyncManagementClientContext.ts +++ /dev/null @@ -1,62 +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 * as msRestAzure from "@azure/ms-rest-azure-js"; - -const packageName = "@azure/arm-storagesync"; -const packageVersion = "8.0.0"; - -export class StorageSyncManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; - apiVersion?: string; - subscriptionId: string; - - /** - * Initializes a new instance of the StorageSyncManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId The ID of the target subscription. - * @param [options] The parameter options - */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.StorageSyncManagementClientOptions) { - 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 = '2019-06-01'; - 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/storagesync/arm-storagesync/test/sampleTest.ts b/sdk/storagesync/arm-storagesync/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/storagesync/arm-storagesync/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/storagesync/arm-storagesync/tsconfig.json b/sdk/storagesync/arm-storagesync/tsconfig.json index 422b584abd5e..6e3251194117 100644 --- a/sdk/storagesync/arm-storagesync/tsconfig.json +++ b/sdk/storagesync/arm-storagesync/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/storagesync/ci.yml b/sdk/storagesync/ci.yml new file mode 100644 index 000000000000..b072a914adf2 --- /dev/null +++ b/sdk/storagesync/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/storagesync/ + +pr: + branches: + include: + - main + - release/* + - hotfix/* + paths: + include: + - sdk/storagesync/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: storagesync + Artifacts: + - name: azure-arm-storagesync + safeName: azurearmstoragesync + \ No newline at end of file