diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7e1753ee59b7..793ffb0948d5 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3007,7 +3007,7 @@ packages: dev: false /array-flatten/1.1.1: - resolution: {integrity: sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=} + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} dev: false /array-includes/3.1.5: @@ -3262,7 +3262,7 @@ packages: dev: false /buffer-equal-constant-time/1.0.1: - resolution: {integrity: sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=} + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} dev: false /buffer-from/1.1.2: @@ -3412,7 +3412,7 @@ packages: dev: false /charenc/0.0.2: - resolution: {integrity: sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=} + resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} dev: false /check-error/1.0.2: @@ -3546,7 +3546,7 @@ packages: dev: false /concat-map/0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: false /concurrently/6.5.1: @@ -3609,7 +3609,7 @@ packages: dev: false /cookie-signature/1.0.6: - resolution: {integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=} + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} dev: false /cookie/0.4.2: @@ -3711,7 +3711,7 @@ packages: dev: false /crypt/0.0.2: - resolution: {integrity: sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=} + resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} dev: false /csv-parse/5.3.0: @@ -3965,7 +3965,7 @@ packages: dependencies: semver: 7.3.7 shelljs: 0.8.5 - typescript: 4.9.0-dev.20220908 + typescript: 4.9.0-dev.20220911 dev: false /ecdsa-sig-formatter/1.0.11: @@ -3975,11 +3975,11 @@ packages: dev: false /edge-launcher/1.2.2: - resolution: {integrity: sha1-60Cq+9Bnpup27/+rBke81VCbN7I=} + resolution: {integrity: sha512-JcD5WBi3BHZXXVSSeEhl6sYO8g5cuynk/hifBzds2Bp4JdzCGLNMHgMCKu5DvrO1yatMgF0goFsxXRGus0yh1g==} dev: false /ee-first/1.1.1: - resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: false /electron-to-chromium/1.4.243: @@ -4863,7 +4863,7 @@ packages: dev: false /fresh/0.5.2: - resolution: {integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=} + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} dev: false @@ -5003,7 +5003,7 @@ packages: dev: false /github-from-package/0.0.0: - resolution: {integrity: sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=} + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} dev: false /glob-parent/5.1.2: @@ -6396,7 +6396,7 @@ packages: dev: false /media-typer/0.3.0: - resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=} + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} dev: false @@ -6406,7 +6406,7 @@ packages: dev: false /merge-descriptors/1.0.1: - resolution: {integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=} + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} dev: false /merge-source-map/1.1.0: @@ -6827,7 +6827,7 @@ packages: dev: false /noms/0.0.0: - resolution: {integrity: sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=} + resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==} dependencies: inherits: 2.0.4 readable-stream: 1.0.34 @@ -8893,8 +8893,8 @@ packages: hasBin: true dev: false - /typescript/4.9.0-dev.20220908: - resolution: {integrity: sha512-Z9NXScMcNmiTv94f0G5PzGn4/Hk31hZySa87XP05BQpYYD5NlaDzQh4POK+z5/5GhNtT56Z+JKbqK9DJxZuA+g==} + /typescript/4.9.0-dev.20220911: + resolution: {integrity: sha512-hKvd93pD0Ooz3zvSnXw7ub0a60MF1+ROJe70UchUlTMfFPB80awNJr+Vq1Jkv3Y2jgwjbgOdtXQjn23Sr5Dy4A==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -9017,7 +9017,7 @@ packages: dev: false /utils-merge/1.0.1: - resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=} + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} dev: false @@ -9672,18 +9672,18 @@ packages: dev: false file:projects/ai-language-conversations.tgz: - resolution: {integrity: sha512-tSn2rgmr/xcqw7jnSZbSWSF+1SNXmfKqDWr0sqCXx5W7WPASEX2lEwTRtf8j2DJUufZePBY8uLssWHeQuFeIyg==, tarball: file:projects/ai-language-conversations.tgz} + resolution: {integrity: sha512-060vIpSA1oWfoWH37LVC/Xxf/SV76wcra1q7mXaVezsJpIDJUJa9D1dV5oHABF5dF775YtmxS2DJMzGuZ3P7WQ==, tarball: file:projects/ai-language-conversations.tgz} name: '@rush-temp/ai-language-conversations' version: 0.0.0 dependencies: '@azure/core-tracing': 1.0.0 '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.1.0_rollup@2.77.2 - '@rollup/plugin-json': 4.1.0_rollup@2.77.2 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.77.2 - '@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.2 - '@types/chai': 4.3.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.0 + '@rollup/plugin-json': 4.1.0_rollup@2.79.0 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.0 + '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.0 + '@types/chai': 4.3.3 '@types/chai-as-promised': 7.1.5 '@types/mocha': 7.0.2 '@types/node': 12.20.55 @@ -9692,7 +9692,7 @@ packages: chai-as-promised: 7.1.1_chai@4.3.6 cross-env: 7.0.3 dotenv: 8.6.0 - eslint: 8.20.0 + eslint: 8.23.0 karma: 6.4.0 karma-chrome-launcher: 3.1.1 karma-coverage: 2.2.0 @@ -9711,14 +9711,14 @@ packages: nyc: 15.1.0 prettier: 2.7.1 rimraf: 3.0.2 - rollup: 2.77.2 - rollup-plugin-sourcemaps: 0.6.3_33537704779d09e8a7b3ae8d1134dd59 + rollup: 2.79.0 + rollup-plugin-sourcemaps: 0.6.3_7b3c4ab1624c114eb4563c11d2337405 sinon: 9.2.4 source-map-support: 0.5.21 ts-node: 10.9.1_8a48dd0e78344f824d84cc558db9572d tslib: 2.4.0 typescript: 4.2.4 - uglify-js: 3.16.3 + uglify-js: 3.17.0 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -13957,7 +13957,7 @@ packages: dev: false file:projects/arm-reservations.tgz: - resolution: {integrity: sha512-gO8IGPuDOcvlIn4pnKYfl0nbINAcCQCRNqP6OTF9JQzaAEX34mF6IJvYkRr5N4t0olQvoFyvG7ffCk4bHtLQ4A==, tarball: file:projects/arm-reservations.tgz} + resolution: {integrity: sha512-L3+xcc33bW33SsUXWzu5c2uKSm9T5CcOk2ZRW1KwjXB056utODwMucwtdTt74sZoeQJHe/CO9my8eEpAbcQGLA==, tarball: file:projects/arm-reservations.tgz} name: '@rush-temp/arm-reservations' version: 0.0.0 dependencies: @@ -13968,6 +13968,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.0 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.0 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.0 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -13979,7 +13981,6 @@ packages: uglify-js: 3.17.0 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false @@ -15543,7 +15544,7 @@ packages: dev: false file:projects/communication-phone-numbers.tgz: - resolution: {integrity: sha512-osnZl91uMMWayN1XrwdWls3VZh3hSU9fgqFAbIFOWEZkJEjezplNl4u5doYFiDm8IzV9Alb0vBc471YgYvSFLQ==, tarball: file:projects/communication-phone-numbers.tgz} + resolution: {integrity: sha512-nMmCk5M62xzqtm8VvCRk8RbT9XOtajridf8FXmLu1ZNU41R0BRfKHgqr5eekE5/Iz02Tm5nSuAGhHHr1rmqMWA==, tarball: file:projects/communication-phone-numbers.tgz} name: '@rush-temp/communication-phone-numbers' version: 0.0.0 dependencies: @@ -15584,7 +15585,6 @@ packages: transitivePeerDependencies: - bufferutil - debug - - encoding - supports-color - utf-8-validate dev: false @@ -15803,7 +15803,7 @@ packages: dev: false file:projects/core-amqp.tgz: - resolution: {integrity: sha512-Onvt6vPrPaZEf90OHVyaCxFzQSohcwkz58OoqG8Rcpb4pLkZwls7qdJQyAO61+jCJkZeY8iaYHpdoTxnj+Hshg==, tarball: file:projects/core-amqp.tgz} + resolution: {integrity: sha512-hQ7a/W0DQbiJ93BlBeEY+Z6G1nYYHhKk/cZ6feHwSvKOdzM7Z8l2+/9PeDQBMlprQwvW1vXkERfBbWMHDHliHw==, tarball: file:projects/core-amqp.tgz} name: '@rush-temp/core-amqp' version: 0.0.0 dependencies: @@ -15987,7 +15987,7 @@ packages: dev: false file:projects/core-http.tgz: - resolution: {integrity: sha512-n1MOXXGJ5ZJfkShfEAqkkkVTWCbRzcOn+MGzyOGzZ8wqDw3hsyL3w9sqDyqymIA1DmtMXCBJxJ/spOxENVBBew==, tarball: file:projects/core-http.tgz} + resolution: {integrity: sha512-N01s8G0U7FDaKX51dr+TKxoqjN/sW/9yvfa1WPb+krcdlYj/HTvhfmWzSf0IymbgYWqbBkorNyHqRanOMySLBA==, tarball: file:projects/core-http.tgz} name: '@rush-temp/core-http' version: 0.0.0 dependencies: @@ -16218,7 +16218,7 @@ packages: dev: false file:projects/core-util.tgz: - resolution: {integrity: sha512-hL2vBQoDHtG9XCEdlCpW2qoOVMXqjFypJzzjBvQj76z337AOC3CvEea/xQZfSpAW2VgphZ5U1s4XPiCKZVFJ0w==, tarball: file:projects/core-util.tgz} + resolution: {integrity: sha512-RKM0GDesu6KF9ayCTbGSyTDl2ZwGPCw9AVd1y8oJNiyaBMFTicuF4El4sA3IYnJm1hPibOiM8iOcHCoB8jROBw==, tarball: file:projects/core-util.tgz} name: '@rush-temp/core-util' version: 0.0.0 dependencies: @@ -17497,7 +17497,7 @@ packages: dev: false file:projects/notification-hubs.tgz: - resolution: {integrity: sha512-pM3qNUPMTfbbBTiCRbNCyLQuv+fwXQUatA+7CjGcA+2R2V7Lj9rKUq4/Aln35/KWR5mVSl42ImeTI0p/VLR4QA==, tarball: file:projects/notification-hubs.tgz} + resolution: {integrity: sha512-IHSdEsxUG9Gqd5maRhWOJfwMI+8q4w6VYRT0pyLFoHo1rMEWHAJsfyI6v4SmKeHkg9m3HdYalufH5DcQmvFEOA==, tarball: file:projects/notification-hubs.tgz} name: '@rush-temp/notification-hubs' version: 0.0.0 dependencies: @@ -18394,7 +18394,7 @@ packages: dev: false file:projects/service-bus.tgz: - resolution: {integrity: sha512-U7DwKgY1xyAPPDh/QIPh9c6CcBHKD0m627nJXFJPgIHQYHCPY2IDCAi0RVopcuiXi66bo7byyLMyf3H4F4E2Bw==, tarball: file:projects/service-bus.tgz} + resolution: {integrity: sha512-5VgwoUB3AmYKIodvL03LdVoXrd2KdciBVAoY166XP8fr8VIDjbFQcAgNNrmTZ2cZgOq/ec1EXCLL8eFOKENMYg==, tarball: file:projects/service-bus.tgz} name: '@rush-temp/service-bus' version: 0.0.0 dependencies: diff --git a/sdk/reservations/arm-reservations/CHANGELOG.md b/sdk/reservations/arm-reservations/CHANGELOG.md index 2a51a2bc5d8f..c6e643412b56 100644 --- a/sdk/reservations/arm-reservations/CHANGELOG.md +++ b/sdk/reservations/arm-reservations/CHANGELOG.md @@ -1,5 +1,37 @@ # Release History +## 7.2.0 (2022-09-12) + +**Features** + + - Added operation group CalculateRefund + - Added operation group Return + - Added operation Reservation.archive + - Added operation Reservation.unarchive + - Added Interface CalculateRefundPostOptionalParams + - Added Interface CalculateRefundRequest + - Added Interface CalculateRefundRequestProperties + - Added Interface CalculateRefundResponse + - Added Interface RefundBillingInformation + - Added Interface RefundPolicyError + - Added Interface RefundPolicyResult + - Added Interface RefundPolicyResultProperty + - Added Interface RefundRequest + - Added Interface RefundRequestProperties + - Added Interface RefundResponse + - Added Interface RefundResponseProperties + - Added Interface ReservationArchiveOptionalParams + - Added Interface ReservationUnarchiveOptionalParams + - Added Interface ReturnPostHeaders + - Added Interface ReturnPostOptionalParams + - Added Type Alias CalculateRefundPostResponse + - Added Type Alias ReturnPostResponse + - Class AzureReservationAPI has a new parameter calculateRefund + - Class AzureReservationAPI has a new parameter return + - Enum KnownErrorResponseCode has a new value RefundLimitExceeded + - Enum KnownErrorResponseCode has a new value SelfServiceRefundNotSupported + + ## 7.1.0 (2022-04-20) **Features** diff --git a/sdk/reservations/arm-reservations/README.md b/sdk/reservations/arm-reservations/README.md index 82e8db5202f1..fbbc90c28a6b 100644 --- a/sdk/reservations/arm-reservations/README.md +++ b/sdk/reservations/arm-reservations/README.md @@ -1,6 +1,6 @@ -# Azure Service client library for JavaScript +# AzureReservationApi client library for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureReservationApi client. This API describe Azure Reservation @@ -24,7 +24,7 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP ### Install the `@azure/arm-reservations` package -Install the Azure Service client library for JavaScript with `npm`: +Install the AzureReservationApi client library for JavaScript with `npm`: ```bash npm install @azure/arm-reservations @@ -32,8 +32,8 @@ npm install @azure/arm-reservations ### Create and authenticate a `AzureReservationAPI` -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]. +To create a client object to access the AzureReservationApi API, you will need the `endpoint` of your AzureReservationApi resource and a `credential`. The AzureReservationApi client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your AzureReservationApi resource in the [Azure Portal][azure_portal]. You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). @@ -43,7 +43,7 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below npm install @azure/identity ``` -You will also need to **register a new AAD application and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +You will also need to **register a new AAD application and grant access to AzureReservationApi** 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). @@ -72,7 +72,7 @@ To use this client library in the browser, first you need to use a bundler. For ### AzureReservationAPI -`AzureReservationAPI` 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. +`AzureReservationAPI` is the primary interface for developers using the AzureReservationApi client library. Explore the methods on this client object to understand the different features of the AzureReservationApi service that you can access. ## Troubleshooting diff --git a/sdk/reservations/arm-reservations/_meta.json b/sdk/reservations/arm-reservations/_meta.json index 3bea59b8ddad..49a19d262b03 100644 --- a/sdk/reservations/arm-reservations/_meta.json +++ b/sdk/reservations/arm-reservations/_meta.json @@ -1,8 +1,8 @@ { - "commit": "8a9bd9c5b65e5c3e5a8536f3c5b2b15bf9920b5d", + "commit": "faed328d0f9c39355cfe8cc86346a68e6f4e7228", "readme": "specification/reservations/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\reservations\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/reservations/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", + "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/reservations/arm-reservations/package.json b/sdk/reservations/arm-reservations/package.json index e5093d043e32..52e0531f00cf 100644 --- a/sdk/reservations/arm-reservations/package.json +++ b/sdk/reservations/arm-reservations/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for AzureReservationAPI.", - "version": "7.1.0", + "version": "7.2.0", "engines": { "node": ">=12.0.0" }, @@ -40,9 +40,13 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/reservations/arm-reservations", "repository": { @@ -93,9 +97,8 @@ "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" + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -106,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-reservations?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/reservations/arm-reservations/review/arm-reservations.api.md b/sdk/reservations/arm-reservations/review/arm-reservations.api.md index 37c8ae5c2215..d150ae1cf7cf 100644 --- a/sdk/reservations/arm-reservations/review/arm-reservations.api.md +++ b/sdk/reservations/arm-reservations/review/arm-reservations.api.md @@ -54,6 +54,8 @@ export class AzureReservationAPI extends coreClient.ServiceClient { // (undocumented) calculateExchange: CalculateExchange; // (undocumented) + calculateRefund: CalculateRefund; + // (undocumented) exchange: Exchange; getAppliedReservationList(subscriptionId: string, options?: GetAppliedReservationListOptionalParams): Promise; getCatalog(subscriptionId: string, options?: GetCatalogOptionalParams): Promise; @@ -67,6 +69,8 @@ export class AzureReservationAPI extends coreClient.ServiceClient { reservation: Reservation; // (undocumented) reservationOrder: ReservationOrder; + // (undocumented) + return: Return; } // @public @@ -179,6 +183,38 @@ export interface CalculatePriceResponsePropertiesPricingCurrencyTotal { currencyCode?: string; } +// @public +export interface CalculateRefund { + post(reservationOrderId: string, body: CalculateRefundRequest, options?: CalculateRefundPostOptionalParams): Promise; +} + +// @public +export interface CalculateRefundPostOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CalculateRefundPostResponse = CalculateRefundResponse; + +// @public (undocumented) +export interface CalculateRefundRequest { + id?: string; + // (undocumented) + properties?: CalculateRefundRequestProperties; +} + +// @public (undocumented) +export interface CalculateRefundRequestProperties { + reservationToReturn?: ReservationToReturn; + scope?: string; +} + +// @public (undocumented) +export interface CalculateRefundResponse { + id?: string; + // (undocumented) + properties?: RefundResponseProperties; +} + // @public (undocumented) export interface Catalog { billingPlans?: { @@ -386,449 +422,265 @@ export type InstanceFlexibility = string; // @public export enum KnownAppliedScopeType { - // (undocumented) Shared = "Shared", - // (undocumented) Single = "Single" } // @public export enum KnownCalculateExchangeOperationResultStatus { - // (undocumented) Cancelled = "Cancelled", - // (undocumented) Failed = "Failed", - // (undocumented) Pending = "Pending", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownCreatedByType { - // (undocumented) Application = "Application", - // (undocumented) Key = "Key", - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) User = "User" } // @public export enum KnownDisplayProvisioningState { - // (undocumented) Cancelled = "Cancelled", - // (undocumented) Expired = "Expired", - // (undocumented) Expiring = "Expiring", - // (undocumented) Failed = "Failed", - // (undocumented) Pending = "Pending", - // (undocumented) Processing = "Processing", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownErrorResponseCode { - // (undocumented) ActivateQuoteFailed = "ActivateQuoteFailed", - // (undocumented) AppliedScopesNotAssociatedWithCommerceAccount = "AppliedScopesNotAssociatedWithCommerceAccount", - // (undocumented) AppliedScopesSameAsExisting = "AppliedScopesSameAsExisting", - // (undocumented) AuthorizationFailed = "AuthorizationFailed", - // (undocumented) BadRequest = "BadRequest", - // (undocumented) BillingCustomerInputError = "BillingCustomerInputError", - // (undocumented) BillingError = "BillingError", - // (undocumented) BillingPaymentInstrumentHardError = "BillingPaymentInstrumentHardError", - // (undocumented) BillingPaymentInstrumentSoftError = "BillingPaymentInstrumentSoftError", - // (undocumented) BillingScopeIdCannotBeChanged = "BillingScopeIdCannotBeChanged", - // (undocumented) BillingTransientError = "BillingTransientError", - // (undocumented) CalculatePriceFailed = "CalculatePriceFailed", - // (undocumented) CapacityUpdateScopesFailed = "CapacityUpdateScopesFailed", - // (undocumented) ClientCertificateThumbprintNotSet = "ClientCertificateThumbprintNotSet", - // (undocumented) CreateQuoteFailed = "CreateQuoteFailed", - // (undocumented) Forbidden = "Forbidden", - // (undocumented) FulfillmentConfigurationError = "FulfillmentConfigurationError", - // (undocumented) FulfillmentError = "FulfillmentError", - // (undocumented) FulfillmentOutOfStockError = "FulfillmentOutOfStockError", - // (undocumented) FulfillmentTransientError = "FulfillmentTransientError", - // (undocumented) HttpMethodNotSupported = "HttpMethodNotSupported", - // (undocumented) InternalServerError = "InternalServerError", - // (undocumented) InvalidAccessToken = "InvalidAccessToken", - // (undocumented) InvalidFulfillmentRequestParameters = "InvalidFulfillmentRequestParameters", - // (undocumented) InvalidHealthCheckType = "InvalidHealthCheckType", - // (undocumented) InvalidLocationId = "InvalidLocationId", - // (undocumented) InvalidRefundQuantity = "InvalidRefundQuantity", - // (undocumented) InvalidRequestContent = "InvalidRequestContent", - // (undocumented) InvalidRequestUri = "InvalidRequestUri", - // (undocumented) InvalidReservationId = "InvalidReservationId", - // (undocumented) InvalidReservationOrderId = "InvalidReservationOrderId", - // (undocumented) InvalidSingleAppliedScopesCount = "InvalidSingleAppliedScopesCount", - // (undocumented) InvalidSubscriptionId = "InvalidSubscriptionId", - // (undocumented) InvalidTenantId = "InvalidTenantId", - // (undocumented) MissingAppliedScopesForSingle = "MissingAppliedScopesForSingle", - // (undocumented) MissingTenantId = "MissingTenantId", - // (undocumented) NonsupportedAccountId = "NonsupportedAccountId", - // (undocumented) NotSpecified = "NotSpecified", - // (undocumented) NotSupportedCountry = "NotSupportedCountry", - // (undocumented) NoValidReservationsToReRate = "NoValidReservationsToReRate", - // (undocumented) OperationCannotBePerformedInCurrentState = "OperationCannotBePerformedInCurrentState", - // (undocumented) OperationFailed = "OperationFailed", - // (undocumented) PatchValuesSameAsExisting = "PatchValuesSameAsExisting", - // (undocumented) PaymentInstrumentNotFound = "PaymentInstrumentNotFound", - // (undocumented) PurchaseError = "PurchaseError", - // (undocumented) + RefundLimitExceeded = "RefundLimitExceeded", ReRateOnlyAllowedForEA = "ReRateOnlyAllowedForEA", - // (undocumented) ReservationIdNotInReservationOrder = "ReservationIdNotInReservationOrder", - // (undocumented) ReservationOrderCreationFailed = "ReservationOrderCreationFailed", - // (undocumented) ReservationOrderIdAlreadyExists = "ReservationOrderIdAlreadyExists", - // (undocumented) ReservationOrderNotEnabled = "ReservationOrderNotEnabled", - // (undocumented) ReservationOrderNotFound = "ReservationOrderNotFound", - // (undocumented) RiskCheckFailed = "RiskCheckFailed", - // (undocumented) RoleAssignmentCreationFailed = "RoleAssignmentCreationFailed", - // (undocumented) + SelfServiceRefundNotSupported = "SelfServiceRefundNotSupported", ServerTimeout = "ServerTimeout", - // (undocumented) UnauthenticatedRequestsThrottled = "UnauthenticatedRequestsThrottled", - // (undocumented) UnsupportedReservationTerm = "UnsupportedReservationTerm" } // @public export enum KnownExchangeOperationResultStatus { - // (undocumented) Cancelled = "Cancelled", - // (undocumented) Failed = "Failed", - // (undocumented) PendingPurchases = "PendingPurchases", - // (undocumented) PendingRefunds = "PendingRefunds", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownInstanceFlexibility { - // (undocumented) Off = "Off", - // (undocumented) On = "On" } // @public export enum KnownLocation { - // (undocumented) Australiaeast = "australiaeast", - // (undocumented) Australiasoutheast = "australiasoutheast", - // (undocumented) Brazilsouth = "brazilsouth", - // (undocumented) Canadacentral = "canadacentral", - // (undocumented) Canadaeast = "canadaeast", - // (undocumented) Centralindia = "centralindia", - // (undocumented) Centralus = "centralus", - // (undocumented) Eastasia = "eastasia", - // (undocumented) Eastus = "eastus", - // (undocumented) Eastus2 = "eastus2", - // (undocumented) Japaneast = "japaneast", - // (undocumented) Japanwest = "japanwest", - // (undocumented) Northcentralus = "northcentralus", - // (undocumented) Northeurope = "northeurope", - // (undocumented) Southcentralus = "southcentralus", - // (undocumented) Southeastasia = "southeastasia", - // (undocumented) Southindia = "southindia", - // (undocumented) Uksouth = "uksouth", - // (undocumented) Ukwest = "ukwest", - // (undocumented) Westcentralus = "westcentralus", - // (undocumented) Westeurope = "westeurope", - // (undocumented) Westindia = "westindia", - // (undocumented) Westus = "westus", - // (undocumented) Westus2 = "westus2" } // @public export enum KnownOperationStatus { - // (undocumented) Cancelled = "Cancelled", - // (undocumented) Failed = "Failed", - // (undocumented) Pending = "Pending", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownPaymentStatus { - // (undocumented) Cancelled = "Cancelled", - // (undocumented) Failed = "Failed", - // (undocumented) Scheduled = "Scheduled", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownProvisioningState { - // (undocumented) BillingFailed = "BillingFailed", - // (undocumented) Cancelled = "Cancelled", - // (undocumented) ConfirmedBilling = "ConfirmedBilling", - // (undocumented) ConfirmedResourceHold = "ConfirmedResourceHold", - // (undocumented) Created = "Created", - // (undocumented) Creating = "Creating", - // (undocumented) Expired = "Expired", - // (undocumented) Failed = "Failed", - // (undocumented) Merged = "Merged", - // (undocumented) PendingBilling = "PendingBilling", - // (undocumented) PendingResourceHold = "PendingResourceHold", - // (undocumented) Split = "Split", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownQuotaRequestState { - // (undocumented) Accepted = "Accepted", - // (undocumented) Failed = "Failed", - // (undocumented) InProgress = "InProgress", - // (undocumented) Invalid = "Invalid", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownReservationBillingPlan { - // (undocumented) Monthly = "Monthly", - // (undocumented) Upfront = "Upfront" } // @public export enum KnownReservationStatusCode { - // (undocumented) Active = "Active", - // (undocumented) Expired = "Expired", - // (undocumented) Merged = "Merged", - // (undocumented) None = "None", - // (undocumented) PaymentInstrumentError = "PaymentInstrumentError", - // (undocumented) Pending = "Pending", - // (undocumented) Processing = "Processing", - // (undocumented) PurchaseError = "PurchaseError", - // (undocumented) Split = "Split", - // (undocumented) Succeeded = "Succeeded" } // @public export enum KnownReservationTerm { - // (undocumented) P1Y = "P1Y", - // (undocumented) P3Y = "P3Y", - // (undocumented) P5Y = "P5Y" } // @public export enum KnownReservedResourceType { - // (undocumented) AppService = "AppService", - // (undocumented) AVS = "AVS", - // (undocumented) AzureDataExplorer = "AzureDataExplorer", - // (undocumented) AzureFiles = "AzureFiles", - // (undocumented) BlockBlob = "BlockBlob", - // (undocumented) CosmosDb = "CosmosDb", - // (undocumented) Databricks = "Databricks", - // (undocumented) DataFactory = "DataFactory", - // (undocumented) DedicatedHost = "DedicatedHost", - // (undocumented) ManagedDisk = "ManagedDisk", - // (undocumented) MariaDb = "MariaDb", - // (undocumented) MySql = "MySql", - // (undocumented) NetAppStorage = "NetAppStorage", - // (undocumented) PostgreSql = "PostgreSql", - // (undocumented) RedHat = "RedHat", - // (undocumented) RedHatOsa = "RedHatOsa", - // (undocumented) RedisCache = "RedisCache", - // (undocumented) SapHana = "SapHana", - // (undocumented) SqlAzureHybridBenefit = "SqlAzureHybridBenefit", - // (undocumented) SqlDatabases = "SqlDatabases", - // (undocumented) SqlDataWarehouse = "SqlDataWarehouse", - // (undocumented) SqlEdge = "SqlEdge", - // (undocumented) SuseLinux = "SuseLinux", - // (undocumented) VirtualMachines = "VirtualMachines", - // (undocumented) VirtualMachineSoftware = "VirtualMachineSoftware", - // (undocumented) VMwareCloudSimple = "VMwareCloudSimple" } // @public export enum KnownResourceType { - // (undocumented) Dedicated = "dedicated", - // (undocumented) LowPriority = "lowPriority", - // (undocumented) ServiceSpecific = "serviceSpecific", - // (undocumented) Shared = "shared", - // (undocumented) Standard = "standard" } // @public export enum KnownUserFriendlyAppliedScopeType { - // (undocumented) ManagementGroup = "ManagementGroup", - // (undocumented) None = "None", - // (undocumented) ResourceGroup = "ResourceGroup", - // (undocumented) Shared = "Shared", - // (undocumented) Single = "Single" } // @public export enum KnownUserFriendlyRenewState { - // (undocumented) NotApplicable = "NotApplicable", - // (undocumented) NotRenewed = "NotRenewed", - // (undocumented) Off = "Off", - // (undocumented) On = "On", - // (undocumented) Renewed = "Renewed" } @@ -1140,6 +992,74 @@ export interface QuotaUpdateOptionalParams extends coreClient.OperationOptions { // @public export type QuotaUpdateResponse = CurrentQuotaLimitBase; +// @public +export interface RefundBillingInformation { + // (undocumented) + billingCurrencyProratedAmount?: Price; + // (undocumented) + billingCurrencyRemainingCommitmentAmount?: Price; + // (undocumented) + billingCurrencyTotalPaidAmount?: Price; + billingPlan?: ReservationBillingPlan; + completedTransactions?: number; + totalTransactions?: number; +} + +// @public +export interface RefundPolicyError { + // (undocumented) + code?: ErrorResponseCode; + // (undocumented) + message?: string; +} + +// @public +export interface RefundPolicyResult { + properties?: RefundPolicyResultProperty; +} + +// @public +export interface RefundPolicyResultProperty { + // (undocumented) + consumedRefundsTotal?: Price; + // (undocumented) + maxRefundLimit?: Price; + policyErrors?: RefundPolicyError[]; +} + +// @public (undocumented) +export interface RefundRequest { + // (undocumented) + properties?: RefundRequestProperties; +} + +// @public (undocumented) +export interface RefundRequestProperties { + reservationToReturn?: ReservationToReturn; + returnReason?: string; + scope?: string; + sessionId?: string; +} + +// @public (undocumented) +export interface RefundResponse { + id?: string; + // (undocumented) + properties?: RefundResponseProperties; +} + +// @public (undocumented) +export interface RefundResponseProperties { + billingInformation?: RefundBillingInformation; + // (undocumented) + billingRefundAmount?: Price; + policyResult?: RefundPolicyResult; + // (undocumented) + pricingRefundAmount?: Price; + quantity?: number; + sessionId?: string; +} + // @public (undocumented) export interface RenewPropertiesResponse { billingCurrencyTotal?: RenewPropertiesResponseBillingCurrencyTotal; @@ -1164,6 +1084,7 @@ export interface RenewPropertiesResponsePricingCurrencyTotal { // @public export interface Reservation { + archive(reservationOrderId: string, reservationId: string, options?: ReservationArchiveOptionalParams): Promise; beginAvailableScopes(reservationOrderId: string, reservationId: string, body: AvailableScopeRequest, options?: ReservationAvailableScopesOptionalParams): Promise, ReservationAvailableScopesResponse>>; beginAvailableScopesAndWait(reservationOrderId: string, reservationId: string, body: AvailableScopeRequest, options?: ReservationAvailableScopesOptionalParams): Promise; beginMerge(reservationOrderId: string, body: MergeRequest, options?: ReservationMergeOptionalParams): Promise, ReservationMergeResponse>>; @@ -1176,6 +1097,11 @@ export interface Reservation { list(reservationOrderId: string, options?: ReservationListOptionalParams): PagedAsyncIterableIterator; listAll(options?: ReservationListAllOptionalParams): PagedAsyncIterableIterator; listRevisions(reservationId: string, reservationOrderId: string, options?: ReservationListRevisionsOptionalParams): PagedAsyncIterableIterator; + unarchive(reservationOrderId: string, reservationId: string, options?: ReservationUnarchiveOptionalParams): Promise; +} + +// @public +export interface ReservationArchiveOptionalParams extends coreClient.OperationOptions { } // @public @@ -1507,6 +1433,10 @@ export interface ReservationToReturnForExchange { status?: OperationStatus; } +// @public +export interface ReservationUnarchiveOptionalParams extends coreClient.OperationOptions { +} + // @public export interface ReservationUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -1536,6 +1466,24 @@ export interface ResourceName { // @public export type ResourceType = string; +// @public +export interface Return { + post(reservationOrderId: string, body: RefundRequest, options?: ReturnPostOptionalParams): Promise; +} + +// @public +export interface ReturnPostHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface ReturnPostOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ReturnPostResponse = ReturnPostHeaders & RefundResponse; + // @public (undocumented) export interface ScopeProperties { // (undocumented) diff --git a/sdk/reservations/arm-reservations/src/azureReservationAPI.ts b/sdk/reservations/arm-reservations/src/azureReservationAPI.ts index 06dd9cf4db92..2469a934e42a 100644 --- a/sdk/reservations/arm-reservations/src/azureReservationAPI.ts +++ b/sdk/reservations/arm-reservations/src/azureReservationAPI.ts @@ -13,6 +13,8 @@ import { ReservationImpl, ReservationOrderImpl, OperationImpl, + CalculateRefundImpl, + ReturnImpl, CalculateExchangeImpl, ExchangeImpl, QuotaImpl, @@ -22,6 +24,8 @@ import { Reservation, ReservationOrder, Operation, + CalculateRefund, + Return, CalculateExchange, Exchange, Quota, @@ -62,7 +66,7 @@ export class AzureReservationAPI extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-reservations/7.1.0`; + const packageDetails = `azsdk-js-arm-reservations/7.2.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -110,6 +114,8 @@ export class AzureReservationAPI extends coreClient.ServiceClient { this.reservation = new ReservationImpl(this); this.reservationOrder = new ReservationOrderImpl(this); this.operation = new OperationImpl(this); + this.calculateRefund = new CalculateRefundImpl(this); + this.return = new ReturnImpl(this); this.calculateExchange = new CalculateExchangeImpl(this); this.exchange = new ExchangeImpl(this); this.quota = new QuotaImpl(this); @@ -150,6 +156,8 @@ export class AzureReservationAPI extends coreClient.ServiceClient { reservation: Reservation; reservationOrder: ReservationOrder; operation: Operation; + calculateRefund: CalculateRefund; + return: Return; calculateExchange: CalculateExchange; exchange: Exchange; quota: Quota; diff --git a/sdk/reservations/arm-reservations/src/models/index.ts b/sdk/reservations/arm-reservations/src/models/index.ts index e8b08f3fba83..a4378a3bef8b 100644 --- a/sdk/reservations/arm-reservations/src/models/index.ts +++ b/sdk/reservations/arm-reservations/src/models/index.ts @@ -569,6 +569,100 @@ export interface OperationDisplay { description?: string; } +export interface CalculateRefundRequest { + /** Fully qualified identifier of the reservation order being returned */ + id?: string; + properties?: CalculateRefundRequestProperties; +} + +export interface CalculateRefundRequestProperties { + /** The scope of the refund, e.g. Reservation */ + scope?: string; + /** Reservation to return */ + reservationToReturn?: ReservationToReturn; +} + +/** Reservation to return */ +export interface ReservationToReturn { + /** Fully qualified identifier of the Reservation being returned */ + reservationId?: string; + /** Quantity to be returned. Must be greater than zero. */ + quantity?: number; +} + +export interface CalculateRefundResponse { + /** Fully qualified identifier of the reservation being returned */ + id?: string; + properties?: RefundResponseProperties; +} + +export interface RefundResponseProperties { + /** Refund session identifier */ + sessionId?: string; + /** Quantity to be returned */ + quantity?: number; + billingRefundAmount?: Price; + pricingRefundAmount?: Price; + /** Refund policy result */ + policyResult?: RefundPolicyResult; + /** billing information */ + billingInformation?: RefundBillingInformation; +} + +/** Refund policy result */ +export interface RefundPolicyResult { + /** Refund policy result property */ + properties?: RefundPolicyResultProperty; +} + +/** Refund policy result property */ +export interface RefundPolicyResultProperty { + consumedRefundsTotal?: Price; + maxRefundLimit?: Price; + /** Refund Policy errors */ + policyErrors?: RefundPolicyError[]; +} + +/** error details */ +export interface RefundPolicyError { + code?: ErrorResponseCode; + message?: string; +} + +/** billing information */ +export interface RefundBillingInformation { + /** Represent the billing plans. */ + billingPlan?: ReservationBillingPlan; + /** The number of completed transactions in this reservation's payment */ + completedTransactions?: number; + /** The number of total transactions in this reservation's payment */ + totalTransactions?: number; + billingCurrencyTotalPaidAmount?: Price; + billingCurrencyProratedAmount?: Price; + billingCurrencyRemainingCommitmentAmount?: Price; +} + +export interface RefundRequest { + properties?: RefundRequestProperties; +} + +export interface RefundRequestProperties { + /** SessionId that was returned by CalculateRefund API. */ + sessionId?: string; + /** The scope of the refund, e.g. Reservation */ + scope?: string; + /** Reservation to return */ + reservationToReturn?: ReservationToReturn; + /** The reason of returning the reservation */ + returnReason?: string; +} + +export interface RefundResponse { + /** Fully qualified identifier of the reservation being returned */ + id?: string; + properties?: RefundResponseProperties; +} + /** Calculate exchange request */ export interface CalculateExchangeRequest { /** Calculate exchange request properties */ @@ -583,14 +677,6 @@ export interface CalculateExchangeRequestProperties { reservationsToExchange?: ReservationToReturn[]; } -/** Reservation to return */ -export interface ReservationToReturn { - /** Fully qualified identifier of the Reservation being returned */ - reservationId?: string; - /** Quantity to be returned. Must be greater than zero. */ - quantity?: number; -} - /** CalculateExchange operation result */ export interface CalculateExchangeOperationResultResponse { /** It should match what is used to GET the operation result. */ @@ -1166,6 +1252,11 @@ export interface QuotaRequestSubmitResponse { readonly type?: string; } +/** Defines headers for Return_post operation. */ +export interface ReturnPostHeaders { + location?: string; +} + /** Defines headers for CalculateExchange_post operation. */ export interface CalculateExchangePostHeaders { /** URL for checking the ongoing status of the operation. */ @@ -1206,62 +1297,122 @@ export interface QuotaListNextHeaders { /** Known values of {@link ErrorResponseCode} that the service accepts. */ export enum KnownErrorResponseCode { + /** NotSpecified */ NotSpecified = "NotSpecified", + /** InternalServerError */ InternalServerError = "InternalServerError", + /** ServerTimeout */ ServerTimeout = "ServerTimeout", + /** AuthorizationFailed */ AuthorizationFailed = "AuthorizationFailed", + /** BadRequest */ BadRequest = "BadRequest", + /** ClientCertificateThumbprintNotSet */ ClientCertificateThumbprintNotSet = "ClientCertificateThumbprintNotSet", + /** InvalidRequestContent */ InvalidRequestContent = "InvalidRequestContent", + /** OperationFailed */ OperationFailed = "OperationFailed", + /** HttpMethodNotSupported */ HttpMethodNotSupported = "HttpMethodNotSupported", + /** InvalidRequestUri */ InvalidRequestUri = "InvalidRequestUri", + /** MissingTenantId */ MissingTenantId = "MissingTenantId", + /** InvalidTenantId */ InvalidTenantId = "InvalidTenantId", + /** InvalidReservationOrderId */ InvalidReservationOrderId = "InvalidReservationOrderId", + /** InvalidReservationId */ InvalidReservationId = "InvalidReservationId", + /** ReservationIdNotInReservationOrder */ ReservationIdNotInReservationOrder = "ReservationIdNotInReservationOrder", + /** ReservationOrderNotFound */ ReservationOrderNotFound = "ReservationOrderNotFound", + /** InvalidSubscriptionId */ InvalidSubscriptionId = "InvalidSubscriptionId", + /** InvalidAccessToken */ InvalidAccessToken = "InvalidAccessToken", + /** InvalidLocationId */ InvalidLocationId = "InvalidLocationId", + /** UnauthenticatedRequestsThrottled */ UnauthenticatedRequestsThrottled = "UnauthenticatedRequestsThrottled", + /** InvalidHealthCheckType */ InvalidHealthCheckType = "InvalidHealthCheckType", + /** Forbidden */ Forbidden = "Forbidden", + /** BillingScopeIdCannotBeChanged */ BillingScopeIdCannotBeChanged = "BillingScopeIdCannotBeChanged", + /** AppliedScopesNotAssociatedWithCommerceAccount */ AppliedScopesNotAssociatedWithCommerceAccount = "AppliedScopesNotAssociatedWithCommerceAccount", + /** PatchValuesSameAsExisting */ PatchValuesSameAsExisting = "PatchValuesSameAsExisting", + /** RoleAssignmentCreationFailed */ RoleAssignmentCreationFailed = "RoleAssignmentCreationFailed", + /** ReservationOrderCreationFailed */ ReservationOrderCreationFailed = "ReservationOrderCreationFailed", + /** ReservationOrderNotEnabled */ ReservationOrderNotEnabled = "ReservationOrderNotEnabled", + /** CapacityUpdateScopesFailed */ CapacityUpdateScopesFailed = "CapacityUpdateScopesFailed", + /** UnsupportedReservationTerm */ UnsupportedReservationTerm = "UnsupportedReservationTerm", + /** ReservationOrderIdAlreadyExists */ ReservationOrderIdAlreadyExists = "ReservationOrderIdAlreadyExists", + /** RiskCheckFailed */ RiskCheckFailed = "RiskCheckFailed", + /** CreateQuoteFailed */ CreateQuoteFailed = "CreateQuoteFailed", + /** ActivateQuoteFailed */ ActivateQuoteFailed = "ActivateQuoteFailed", + /** NonsupportedAccountId */ NonsupportedAccountId = "NonsupportedAccountId", + /** PaymentInstrumentNotFound */ PaymentInstrumentNotFound = "PaymentInstrumentNotFound", + /** MissingAppliedScopesForSingle */ MissingAppliedScopesForSingle = "MissingAppliedScopesForSingle", + /** NoValidReservationsToReRate */ NoValidReservationsToReRate = "NoValidReservationsToReRate", + /** ReRateOnlyAllowedForEA */ ReRateOnlyAllowedForEA = "ReRateOnlyAllowedForEA", + /** OperationCannotBePerformedInCurrentState */ OperationCannotBePerformedInCurrentState = "OperationCannotBePerformedInCurrentState", + /** InvalidSingleAppliedScopesCount */ InvalidSingleAppliedScopesCount = "InvalidSingleAppliedScopesCount", + /** InvalidFulfillmentRequestParameters */ InvalidFulfillmentRequestParameters = "InvalidFulfillmentRequestParameters", + /** NotSupportedCountry */ NotSupportedCountry = "NotSupportedCountry", + /** InvalidRefundQuantity */ InvalidRefundQuantity = "InvalidRefundQuantity", + /** PurchaseError */ PurchaseError = "PurchaseError", + /** BillingCustomerInputError */ BillingCustomerInputError = "BillingCustomerInputError", + /** BillingPaymentInstrumentSoftError */ BillingPaymentInstrumentSoftError = "BillingPaymentInstrumentSoftError", + /** BillingPaymentInstrumentHardError */ BillingPaymentInstrumentHardError = "BillingPaymentInstrumentHardError", + /** BillingTransientError */ BillingTransientError = "BillingTransientError", + /** BillingError */ BillingError = "BillingError", + /** FulfillmentConfigurationError */ FulfillmentConfigurationError = "FulfillmentConfigurationError", + /** FulfillmentOutOfStockError */ FulfillmentOutOfStockError = "FulfillmentOutOfStockError", + /** FulfillmentTransientError */ FulfillmentTransientError = "FulfillmentTransientError", + /** FulfillmentError */ FulfillmentError = "FulfillmentError", + /** CalculatePriceFailed */ CalculatePriceFailed = "CalculatePriceFailed", - AppliedScopesSameAsExisting = "AppliedScopesSameAsExisting" + /** AppliedScopesSameAsExisting */ + AppliedScopesSameAsExisting = "AppliedScopesSameAsExisting", + /** SelfServiceRefundNotSupported */ + SelfServiceRefundNotSupported = "SelfServiceRefundNotSupported", + /** RefundLimitExceeded */ + RefundLimitExceeded = "RefundLimitExceeded" } /** @@ -1324,13 +1475,17 @@ export enum KnownErrorResponseCode { * **FulfillmentTransientError** \ * **FulfillmentError** \ * **CalculatePriceFailed** \ - * **AppliedScopesSameAsExisting** + * **AppliedScopesSameAsExisting** \ + * **SelfServiceRefundNotSupported** \ + * **RefundLimitExceeded** */ export type ErrorResponseCode = string; /** Known values of {@link ReservationBillingPlan} that the service accepts. */ export enum KnownReservationBillingPlan { + /** Upfront */ Upfront = "Upfront", + /** Monthly */ Monthly = "Monthly" } @@ -1346,8 +1501,11 @@ export type ReservationBillingPlan = string; /** Known values of {@link ReservationTerm} that the service accepts. */ export enum KnownReservationTerm { + /** P1Y */ P1Y = "P1Y", + /** P3Y */ P3Y = "P3Y", + /** P5Y */ P5Y = "P5Y" } @@ -1364,31 +1522,57 @@ export type ReservationTerm = string; /** Known values of {@link ReservedResourceType} that the service accepts. */ export enum KnownReservedResourceType { + /** VirtualMachines */ VirtualMachines = "VirtualMachines", + /** SqlDatabases */ SqlDatabases = "SqlDatabases", + /** SuseLinux */ SuseLinux = "SuseLinux", + /** CosmosDb */ CosmosDb = "CosmosDb", + /** RedHat */ RedHat = "RedHat", + /** SqlDataWarehouse */ SqlDataWarehouse = "SqlDataWarehouse", + /** VMwareCloudSimple */ VMwareCloudSimple = "VMwareCloudSimple", + /** RedHatOsa */ RedHatOsa = "RedHatOsa", + /** Databricks */ Databricks = "Databricks", + /** AppService */ AppService = "AppService", + /** ManagedDisk */ ManagedDisk = "ManagedDisk", + /** BlockBlob */ BlockBlob = "BlockBlob", + /** RedisCache */ RedisCache = "RedisCache", + /** AzureDataExplorer */ AzureDataExplorer = "AzureDataExplorer", + /** MySql */ MySql = "MySql", + /** MariaDb */ MariaDb = "MariaDb", + /** PostgreSql */ PostgreSql = "PostgreSql", + /** DedicatedHost */ DedicatedHost = "DedicatedHost", + /** SapHana */ SapHana = "SapHana", + /** SqlAzureHybridBenefit */ SqlAzureHybridBenefit = "SqlAzureHybridBenefit", + /** AVS */ AVS = "AVS", + /** DataFactory */ DataFactory = "DataFactory", + /** NetAppStorage */ NetAppStorage = "NetAppStorage", + /** AzureFiles */ AzureFiles = "AzureFiles", + /** SqlEdge */ SqlEdge = "SqlEdge", + /** VirtualMachineSoftware */ VirtualMachineSoftware = "VirtualMachineSoftware" } @@ -1428,7 +1612,9 @@ export type ReservedResourceType = string; /** Known values of {@link AppliedScopeType} that the service accepts. */ export enum KnownAppliedScopeType { + /** Single */ Single = "Single", + /** Shared */ Shared = "Shared" } @@ -1444,7 +1630,9 @@ export type AppliedScopeType = string; /** Known values of {@link InstanceFlexibility} that the service accepts. */ export enum KnownInstanceFlexibility { + /** On */ On = "On", + /** Off */ Off = "Off" } @@ -1460,9 +1648,13 @@ export type InstanceFlexibility = string; /** Known values of {@link PaymentStatus} that the service accepts. */ export enum KnownPaymentStatus { + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed", + /** Scheduled */ Scheduled = "Scheduled", + /** Cancelled */ Cancelled = "Cancelled" } @@ -1480,15 +1672,25 @@ export type PaymentStatus = string; /** Known values of {@link ReservationStatusCode} that the service accepts. */ export enum KnownReservationStatusCode { + /** None */ None = "None", + /** Pending */ Pending = "Pending", + /** Processing */ Processing = "Processing", + /** Active */ Active = "Active", + /** PurchaseError */ PurchaseError = "PurchaseError", + /** PaymentInstrumentError */ PaymentInstrumentError = "PaymentInstrumentError", + /** Split */ Split = "Split", + /** Merged */ Merged = "Merged", + /** Expired */ Expired = "Expired", + /** Succeeded */ Succeeded = "Succeeded" } @@ -1512,18 +1714,31 @@ export type ReservationStatusCode = string; /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { + /** Creating */ Creating = "Creating", + /** PendingResourceHold */ PendingResourceHold = "PendingResourceHold", + /** ConfirmedResourceHold */ ConfirmedResourceHold = "ConfirmedResourceHold", + /** PendingBilling */ PendingBilling = "PendingBilling", + /** ConfirmedBilling */ ConfirmedBilling = "ConfirmedBilling", + /** Created */ Created = "Created", + /** Succeeded */ Succeeded = "Succeeded", + /** Cancelled */ Cancelled = "Cancelled", + /** Expired */ Expired = "Expired", + /** BillingFailed */ BillingFailed = "BillingFailed", + /** Failed */ Failed = "Failed", + /** Split */ Split = "Split", + /** Merged */ Merged = "Merged" } @@ -1550,9 +1765,13 @@ export type ProvisioningState = string; /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { + /** User */ User = "User", + /** Application */ Application = "Application", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", + /** Key */ Key = "Key" } @@ -1570,9 +1789,13 @@ export type CreatedByType = string; /** Known values of {@link CalculateExchangeOperationResultStatus} that the service accepts. */ export enum KnownCalculateExchangeOperationResultStatus { + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed", + /** Cancelled */ Cancelled = "Cancelled", + /** Pending */ Pending = "Pending" } @@ -1590,10 +1813,15 @@ export type CalculateExchangeOperationResultStatus = string; /** Known values of {@link ExchangeOperationResultStatus} that the service accepts. */ export enum KnownExchangeOperationResultStatus { + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed", + /** Cancelled */ Cancelled = "Cancelled", + /** PendingRefunds */ PendingRefunds = "PendingRefunds", + /** PendingPurchases */ PendingPurchases = "PendingPurchases" } @@ -1612,9 +1840,13 @@ export type ExchangeOperationResultStatus = string; /** Known values of {@link OperationStatus} that the service accepts. */ export enum KnownOperationStatus { + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed", + /** Cancelled */ Cancelled = "Cancelled", + /** Pending */ Pending = "Pending" } @@ -1632,10 +1864,15 @@ export type OperationStatus = string; /** Known values of {@link ResourceType} that the service accepts. */ export enum KnownResourceType { + /** Standard */ Standard = "standard", + /** Dedicated */ Dedicated = "dedicated", + /** LowPriority */ LowPriority = "lowPriority", + /** Shared */ Shared = "shared", + /** ServiceSpecific */ ServiceSpecific = "serviceSpecific" } @@ -1654,10 +1891,15 @@ export type ResourceType = string; /** Known values of {@link QuotaRequestState} that the service accepts. */ export enum KnownQuotaRequestState { + /** Accepted */ Accepted = "Accepted", + /** Invalid */ Invalid = "Invalid", + /** Succeeded */ Succeeded = "Succeeded", + /** Failed */ Failed = "Failed", + /** InProgress */ InProgress = "InProgress" } @@ -1676,29 +1918,53 @@ export type QuotaRequestState = string; /** Known values of {@link Location} that the service accepts. */ export enum KnownLocation { + /** Westus */ Westus = "westus", + /** Eastus */ Eastus = "eastus", + /** Eastus2 */ Eastus2 = "eastus2", + /** Northcentralus */ Northcentralus = "northcentralus", + /** Westus2 */ Westus2 = "westus2", + /** Southcentralus */ Southcentralus = "southcentralus", + /** Centralus */ Centralus = "centralus", + /** Westeurope */ Westeurope = "westeurope", + /** Northeurope */ Northeurope = "northeurope", + /** Eastasia */ Eastasia = "eastasia", + /** Southeastasia */ Southeastasia = "southeastasia", + /** Japaneast */ Japaneast = "japaneast", + /** Japanwest */ Japanwest = "japanwest", + /** Brazilsouth */ Brazilsouth = "brazilsouth", + /** Australiaeast */ Australiaeast = "australiaeast", + /** Australiasoutheast */ Australiasoutheast = "australiasoutheast", + /** Southindia */ Southindia = "southindia", + /** Westindia */ Westindia = "westindia", + /** Centralindia */ Centralindia = "centralindia", + /** Canadacentral */ Canadacentral = "canadacentral", + /** Canadaeast */ Canadaeast = "canadaeast", + /** Uksouth */ Uksouth = "uksouth", + /** Westcentralus */ Westcentralus = "westcentralus", + /** Ukwest */ Ukwest = "ukwest" } @@ -1736,12 +2002,19 @@ export type Location = string; /** Known values of {@link DisplayProvisioningState} that the service accepts. */ export enum KnownDisplayProvisioningState { + /** Succeeded */ Succeeded = "Succeeded", + /** Expiring */ Expiring = "Expiring", + /** Expired */ Expired = "Expired", + /** Pending */ Pending = "Pending", + /** Processing */ Processing = "Processing", + /** Cancelled */ Cancelled = "Cancelled", + /** Failed */ Failed = "Failed" } @@ -1762,10 +2035,15 @@ export type DisplayProvisioningState = string; /** Known values of {@link UserFriendlyAppliedScopeType} that the service accepts. */ export enum KnownUserFriendlyAppliedScopeType { + /** None */ None = "None", + /** Shared */ Shared = "Shared", + /** Single */ Single = "Single", + /** ResourceGroup */ ResourceGroup = "ResourceGroup", + /** ManagementGroup */ ManagementGroup = "ManagementGroup" } @@ -1784,10 +2062,15 @@ export type UserFriendlyAppliedScopeType = string; /** Known values of {@link UserFriendlyRenewState} that the service accepts. */ export enum KnownUserFriendlyRenewState { + /** On */ On = "On", + /** Off */ Off = "Off", + /** Renewed */ Renewed = "Renewed", + /** NotRenewed */ NotRenewed = "NotRenewed", + /** NotApplicable */ NotApplicable = "NotApplicable" } @@ -1869,6 +2152,14 @@ export interface ReservationUpdateOptionalParams /** Contains response data for the update operation. */ export type ReservationUpdateResponse = ReservationResponse; +/** Optional parameters. */ +export interface ReservationArchiveOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ReservationUnarchiveOptionalParams + extends coreClient.OperationOptions {} + /** Optional parameters. */ export interface ReservationListRevisionsOptionalParams extends coreClient.OperationOptions {} @@ -2018,6 +2309,19 @@ export interface OperationListNextOptionalParams /** Contains response data for the listNext operation. */ export type OperationListNextResponse = OperationList; +/** Optional parameters. */ +export interface CalculateRefundPostOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the post operation. */ +export type CalculateRefundPostResponse = CalculateRefundResponse; + +/** Optional parameters. */ +export interface ReturnPostOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the post operation. */ +export type ReturnPostResponse = ReturnPostHeaders & RefundResponse; + /** Optional parameters. */ export interface CalculateExchangePostOptionalParams extends coreClient.OperationOptions { @@ -2095,11 +2399,9 @@ export type QuotaRequestStatusGetResponse = QuotaRequestDetails; export interface QuotaRequestStatusListOptionalParams extends coreClient.OperationOptions { /** - * | Field | Supported operators - * |---------------------|------------------------ - * - * |requestSubmitTime | ge, le, eq, gt, lt - * + * | Field | Supported operators | + * |---------------------|------------------------| + * |requestSubmitTime | ge, le, eq, gt, lt | */ filter?: string; /** Number of records to return. */ @@ -2115,11 +2417,9 @@ export type QuotaRequestStatusListResponse = QuotaRequestDetailsList; export interface QuotaRequestStatusListNextOptionalParams extends coreClient.OperationOptions { /** - * | Field | Supported operators - * |---------------------|------------------------ - * - * |requestSubmitTime | ge, le, eq, gt, lt - * + * | Field | Supported operators | + * |---------------------|------------------------| + * |requestSubmitTime | ge, le, eq, gt, lt | */ filter?: string; /** Number of records to return. */ diff --git a/sdk/reservations/arm-reservations/src/models/mappers.ts b/sdk/reservations/arm-reservations/src/models/mappers.ts index d1f8f6680547..12fa4777ec75 100644 --- a/sdk/reservations/arm-reservations/src/models/mappers.ts +++ b/sdk/reservations/arm-reservations/src/models/mappers.ts @@ -1699,6 +1699,334 @@ export const OperationDisplay: coreClient.CompositeMapper = { } }; +export const CalculateRefundRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CalculateRefundRequest", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "CalculateRefundRequestProperties" + } + } + } + } +}; + +export const CalculateRefundRequestProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CalculateRefundRequestProperties", + modelProperties: { + scope: { + serializedName: "scope", + type: { + name: "String" + } + }, + reservationToReturn: { + serializedName: "reservationToReturn", + type: { + name: "Composite", + className: "ReservationToReturn" + } + } + } + } +}; + +export const ReservationToReturn: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReservationToReturn", + modelProperties: { + reservationId: { + serializedName: "reservationId", + type: { + name: "String" + } + }, + quantity: { + serializedName: "quantity", + type: { + name: "Number" + } + } + } + } +}; + +export const CalculateRefundResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CalculateRefundResponse", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "RefundResponseProperties" + } + } + } + } +}; + +export const RefundResponseProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundResponseProperties", + modelProperties: { + sessionId: { + serializedName: "sessionId", + type: { + name: "String" + } + }, + quantity: { + serializedName: "quantity", + type: { + name: "Number" + } + }, + billingRefundAmount: { + serializedName: "billingRefundAmount", + type: { + name: "Composite", + className: "Price" + } + }, + pricingRefundAmount: { + serializedName: "pricingRefundAmount", + type: { + name: "Composite", + className: "Price" + } + }, + policyResult: { + serializedName: "policyResult", + type: { + name: "Composite", + className: "RefundPolicyResult" + } + }, + billingInformation: { + serializedName: "billingInformation", + type: { + name: "Composite", + className: "RefundBillingInformation" + } + } + } + } +}; + +export const RefundPolicyResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundPolicyResult", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "RefundPolicyResultProperty" + } + } + } + } +}; + +export const RefundPolicyResultProperty: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundPolicyResultProperty", + modelProperties: { + consumedRefundsTotal: { + serializedName: "consumedRefundsTotal", + type: { + name: "Composite", + className: "Price" + } + }, + maxRefundLimit: { + serializedName: "maxRefundLimit", + type: { + name: "Composite", + className: "Price" + } + }, + policyErrors: { + serializedName: "policyErrors", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RefundPolicyError" + } + } + } + } + } + } +}; + +export const RefundPolicyError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundPolicyError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const RefundBillingInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundBillingInformation", + modelProperties: { + billingPlan: { + serializedName: "billingPlan", + type: { + name: "String" + } + }, + completedTransactions: { + serializedName: "completedTransactions", + type: { + name: "Number" + } + }, + totalTransactions: { + serializedName: "totalTransactions", + type: { + name: "Number" + } + }, + billingCurrencyTotalPaidAmount: { + serializedName: "billingCurrencyTotalPaidAmount", + type: { + name: "Composite", + className: "Price" + } + }, + billingCurrencyProratedAmount: { + serializedName: "billingCurrencyProratedAmount", + type: { + name: "Composite", + className: "Price" + } + }, + billingCurrencyRemainingCommitmentAmount: { + serializedName: "billingCurrencyRemainingCommitmentAmount", + type: { + name: "Composite", + className: "Price" + } + } + } + } +}; + +export const RefundRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundRequest", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "RefundRequestProperties" + } + } + } + } +}; + +export const RefundRequestProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundRequestProperties", + modelProperties: { + sessionId: { + serializedName: "sessionId", + type: { + name: "String" + } + }, + scope: { + serializedName: "scope", + type: { + name: "String" + } + }, + reservationToReturn: { + serializedName: "reservationToReturn", + type: { + name: "Composite", + className: "ReservationToReturn" + } + }, + returnReason: { + serializedName: "returnReason", + type: { + name: "String" + } + } + } + } +}; + +export const RefundResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RefundResponse", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "RefundResponseProperties" + } + } + } + } +}; + export const CalculateExchangeRequest: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1748,27 +2076,6 @@ export const CalculateExchangeRequestProperties: coreClient.CompositeMapper = { } }; -export const ReservationToReturn: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ReservationToReturn", - modelProperties: { - reservationId: { - serializedName: "reservationId", - type: { - name: "String" - } - }, - quantity: { - serializedName: "quantity", - type: { - name: "Number" - } - } - } - } -}; - export const CalculateExchangeOperationResultResponse: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3124,6 +3431,21 @@ export const QuotaRequestSubmitResponse: coreClient.CompositeMapper = { } }; +export const ReturnPostHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReturnPostHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const CalculateExchangePostHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/reservations/arm-reservations/src/models/parameters.ts b/sdk/reservations/arm-reservations/src/models/parameters.ts index 11d71905e1af..994017f6406c 100644 --- a/sdk/reservations/arm-reservations/src/models/parameters.ts +++ b/sdk/reservations/arm-reservations/src/models/parameters.ts @@ -18,6 +18,8 @@ import { Patch as PatchMapper, PurchaseRequest as PurchaseRequestMapper, ChangeDirectoryRequest as ChangeDirectoryRequestMapper, + CalculateRefundRequest as CalculateRefundRequestMapper, + RefundRequest as RefundRequestMapper, CalculateExchangeRequest as CalculateExchangeRequestMapper, ExchangeRequest as ExchangeRequestMapper, CurrentQuotaLimitBase as CurrentQuotaLimitBaseMapper @@ -278,10 +280,20 @@ export const body4: OperationParameter = { export const body5: OperationParameter = { parameterPath: "body", - mapper: CalculateExchangeRequestMapper + mapper: CalculateRefundRequestMapper }; export const body6: OperationParameter = { + parameterPath: "body", + mapper: RefundRequestMapper +}; + +export const body7: OperationParameter = { + parameterPath: "body", + mapper: CalculateExchangeRequestMapper +}; + +export const body8: OperationParameter = { parameterPath: "body", mapper: ExchangeRequestMapper }; diff --git a/sdk/reservations/arm-reservations/src/operations/calculateExchange.ts b/sdk/reservations/arm-reservations/src/operations/calculateExchange.ts index bdc7c2f3bf30..9e9d81e16658 100644 --- a/sdk/reservations/arm-reservations/src/operations/calculateExchange.ts +++ b/sdk/reservations/arm-reservations/src/operations/calculateExchange.ts @@ -136,7 +136,7 @@ const postOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - requestBody: Parameters.body5, + requestBody: Parameters.body7, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.contentType, Parameters.accept], diff --git a/sdk/reservations/arm-reservations/src/operations/calculateRefund.ts b/sdk/reservations/arm-reservations/src/operations/calculateRefund.ts new file mode 100644 index 000000000000..75021d8f593a --- /dev/null +++ b/sdk/reservations/arm-reservations/src/operations/calculateRefund.ts @@ -0,0 +1,71 @@ +/* + * 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 { CalculateRefund } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureReservationAPI } from "../azureReservationAPI"; +import { + CalculateRefundRequest, + CalculateRefundPostOptionalParams, + CalculateRefundPostResponse +} from "../models"; + +/** Class containing CalculateRefund operations. */ +export class CalculateRefundImpl implements CalculateRefund { + private readonly client: AzureReservationAPI; + + /** + * Initialize a new instance of the class CalculateRefund class. + * @param client Reference to the service client + */ + constructor(client: AzureReservationAPI) { + this.client = client; + } + + /** + * Calculate price for returning `Reservations` if there are no policy errors. + * + * @param reservationOrderId Order Id of the reservation + * @param body Information needed for calculating refund of a reservation. + * @param options The options parameters. + */ + post( + reservationOrderId: string, + body: CalculateRefundRequest, + options?: CalculateRefundPostOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, body, options }, + postOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const postOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CalculateRefundResponse + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + requestBody: Parameters.body5, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.reservationOrderId], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; diff --git a/sdk/reservations/arm-reservations/src/operations/exchange.ts b/sdk/reservations/arm-reservations/src/operations/exchange.ts index 50003b6c3f31..b1075adc8bb6 100644 --- a/sdk/reservations/arm-reservations/src/operations/exchange.ts +++ b/sdk/reservations/arm-reservations/src/operations/exchange.ts @@ -133,7 +133,7 @@ const postOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorModel } }, - requestBody: Parameters.body6, + requestBody: Parameters.body8, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.contentType, Parameters.accept], diff --git a/sdk/reservations/arm-reservations/src/operations/index.ts b/sdk/reservations/arm-reservations/src/operations/index.ts index 425138628c9e..62ea692e472b 100644 --- a/sdk/reservations/arm-reservations/src/operations/index.ts +++ b/sdk/reservations/arm-reservations/src/operations/index.ts @@ -9,6 +9,8 @@ export * from "./reservation"; export * from "./reservationOrder"; export * from "./operation"; +export * from "./calculateRefund"; +export * from "./return"; export * from "./calculateExchange"; export * from "./exchange"; export * from "./quota"; diff --git a/sdk/reservations/arm-reservations/src/operations/quota.ts b/sdk/reservations/arm-reservations/src/operations/quota.ts index ef8cd39a3cc4..ff27b3047014 100644 --- a/sdk/reservations/arm-reservations/src/operations/quota.ts +++ b/sdk/reservations/arm-reservations/src/operations/quota.ts @@ -148,12 +148,9 @@ export class QuotaImpl implements Quota { /** * Create or update the quota (service limits) of a resource to the requested value. * Steps: - * - 1. Make the Get request to get the quota information for specific resource. - * - 2. To increase the quota, update the limit field in the response from Get request to new value. - * - 3. Submit the JSON to the quota request API to update the quota. + * 1. Make the Get request to get the quota information for specific resource. + * 2. To increase the quota, update the limit field in the response from Get request to new value. + * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update * the quota. * @param subscriptionId Azure subscription ID. @@ -240,12 +237,9 @@ export class QuotaImpl implements Quota { /** * Create or update the quota (service limits) of a resource to the requested value. * Steps: - * - 1. Make the Get request to get the quota information for specific resource. - * - 2. To increase the quota, update the limit field in the response from Get request to new value. - * - 3. Submit the JSON to the quota request API to update the quota. + * 1. Make the Get request to get the quota information for specific resource. + * 2. To increase the quota, update the limit field in the response from Get request to new value. + * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update * the quota. * @param subscriptionId Azure subscription ID. @@ -277,12 +271,9 @@ export class QuotaImpl implements Quota { /** * Update the quota (service limits) of this resource to the requested value. - * - • To get the quota information for specific resource, send a GET request. - * - • To increase the quota, update the limit field from the GET response to a new value. - * - • To update the quota value, submit the JSON response to the quota request API to update the + * • To get the quota information for specific resource, send a GET request. + * • To increase the quota, update the limit field from the GET response to a new value. + * • To update the quota value, submit the JSON response to the quota request API to update the * quota. * • To update the quota. use the PATCH operation. * @param subscriptionId Azure subscription ID. @@ -365,12 +356,9 @@ export class QuotaImpl implements Quota { /** * Update the quota (service limits) of this resource to the requested value. - * - • To get the quota information for specific resource, send a GET request. - * - • To increase the quota, update the limit field from the GET response to a new value. - * - • To update the quota value, submit the JSON response to the quota request API to update the + * • To get the quota information for specific resource, send a GET request. + * • To increase the quota, update the limit field from the GET response to a new value. + * • To update the quota value, submit the JSON response to the quota request API to update the * quota. * • To update the quota. use the PATCH operation. * @param subscriptionId Azure subscription ID. diff --git a/sdk/reservations/arm-reservations/src/operations/reservation.ts b/sdk/reservations/arm-reservations/src/operations/reservation.ts index 52eecc199909..779e6c2a2410 100644 --- a/sdk/reservations/arm-reservations/src/operations/reservation.ts +++ b/sdk/reservations/arm-reservations/src/operations/reservation.ts @@ -37,6 +37,8 @@ import { Patch, ReservationUpdateOptionalParams, ReservationUpdateResponse, + ReservationArchiveOptionalParams, + ReservationUnarchiveOptionalParams, ReservationListRevisionsResponse, ReservationListAllResponse, ReservationListNextResponse, @@ -609,6 +611,41 @@ export class ReservationImpl implements Reservation { return poller.pollUntilDone(); } + /** + * Archiving a `Reservation` moves it to `Archived` state. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the Reservation Item + * @param options The options parameters. + */ + archive( + reservationOrderId: string, + reservationId: string, + options?: ReservationArchiveOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, reservationId, options }, + archiveOperationSpec + ); + } + + /** + * Unarchiving a `Reservation` moves it to the state it was before archiving. + * + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the Reservation Item + * @param options The options parameters. + */ + unarchive( + reservationOrderId: string, + reservationId: string, + options?: ReservationUnarchiveOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, reservationId, options }, + unarchiveOperationSpec + ); + } + /** * List of all the revisions for the `Reservation`. * @param reservationId Id of the Reservation Item @@ -905,6 +942,44 @@ const updateOperationSpec: coreClient.OperationSpec = { mediaType: "json", serializer }; +const archiveOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/archive", + httpMethod: "POST", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.reservationOrderId, + Parameters.reservationId + ], + headerParameters: [Parameters.accept], + serializer +}; +const unarchiveOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/unarchive", + httpMethod: "POST", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.reservationOrderId, + Parameters.reservationId + ], + headerParameters: [Parameters.accept], + serializer +}; const listRevisionsOperationSpec: coreClient.OperationSpec = { path: "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/revisions", diff --git a/sdk/reservations/arm-reservations/src/operations/return.ts b/sdk/reservations/arm-reservations/src/operations/return.ts new file mode 100644 index 000000000000..1a6542d4cf8d --- /dev/null +++ b/sdk/reservations/arm-reservations/src/operations/return.ts @@ -0,0 +1,71 @@ +/* + * 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 { Return } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureReservationAPI } from "../azureReservationAPI"; +import { + RefundRequest, + ReturnPostOptionalParams, + ReturnPostResponse +} from "../models"; + +/** Class containing Return operations. */ +export class ReturnImpl implements Return { + private readonly client: AzureReservationAPI; + + /** + * Initialize a new instance of the class Return class. + * @param client Reference to the service client + */ + constructor(client: AzureReservationAPI) { + this.client = client; + } + + /** + * Return a reservation. + * @param reservationOrderId Order Id of the reservation + * @param body Information needed for returning reservation. + * @param options The options parameters. + */ + post( + reservationOrderId: string, + body: RefundRequest, + options?: ReturnPostOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { reservationOrderId, body, options }, + postOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const postOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return", + httpMethod: "POST", + responses: { + 202: { + bodyMapper: Mappers.RefundResponse, + headersMapper: Mappers.ReturnPostHeaders + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + requestBody: Parameters.body6, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.reservationOrderId], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; diff --git a/sdk/reservations/arm-reservations/src/operationsInterfaces/calculateRefund.ts b/sdk/reservations/arm-reservations/src/operationsInterfaces/calculateRefund.ts new file mode 100644 index 000000000000..0b54644a6009 --- /dev/null +++ b/sdk/reservations/arm-reservations/src/operationsInterfaces/calculateRefund.ts @@ -0,0 +1,29 @@ +/* + * 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 { + CalculateRefundRequest, + CalculateRefundPostOptionalParams, + CalculateRefundPostResponse +} from "../models"; + +/** Interface representing a CalculateRefund. */ +export interface CalculateRefund { + /** + * Calculate price for returning `Reservations` if there are no policy errors. + * + * @param reservationOrderId Order Id of the reservation + * @param body Information needed for calculating refund of a reservation. + * @param options The options parameters. + */ + post( + reservationOrderId: string, + body: CalculateRefundRequest, + options?: CalculateRefundPostOptionalParams + ): Promise; +} diff --git a/sdk/reservations/arm-reservations/src/operationsInterfaces/index.ts b/sdk/reservations/arm-reservations/src/operationsInterfaces/index.ts index 425138628c9e..62ea692e472b 100644 --- a/sdk/reservations/arm-reservations/src/operationsInterfaces/index.ts +++ b/sdk/reservations/arm-reservations/src/operationsInterfaces/index.ts @@ -9,6 +9,8 @@ export * from "./reservation"; export * from "./reservationOrder"; export * from "./operation"; +export * from "./calculateRefund"; +export * from "./return"; export * from "./calculateExchange"; export * from "./exchange"; export * from "./quota"; diff --git a/sdk/reservations/arm-reservations/src/operationsInterfaces/quota.ts b/sdk/reservations/arm-reservations/src/operationsInterfaces/quota.ts index 350994eb4e36..6d573e774586 100644 --- a/sdk/reservations/arm-reservations/src/operationsInterfaces/quota.ts +++ b/sdk/reservations/arm-reservations/src/operationsInterfaces/quota.ts @@ -56,12 +56,9 @@ export interface Quota { /** * Create or update the quota (service limits) of a resource to the requested value. * Steps: - * - 1. Make the Get request to get the quota information for specific resource. - * - 2. To increase the quota, update the limit field in the response from Get request to new value. - * - 3. Submit the JSON to the quota request API to update the quota. + * 1. Make the Get request to get the quota information for specific resource. + * 2. To increase the quota, update the limit field in the response from Get request to new value. + * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update * the quota. * @param subscriptionId Azure subscription ID. @@ -88,12 +85,9 @@ export interface Quota { /** * Create or update the quota (service limits) of a resource to the requested value. * Steps: - * - 1. Make the Get request to get the quota information for specific resource. - * - 2. To increase the quota, update the limit field in the response from Get request to new value. - * - 3. Submit the JSON to the quota request API to update the quota. + * 1. Make the Get request to get the quota information for specific resource. + * 2. To increase the quota, update the limit field in the response from Get request to new value. + * 3. Submit the JSON to the quota request API to update the quota. * The Create quota request may be constructed as follows. The PUT operation can be used to update * the quota. * @param subscriptionId Azure subscription ID. @@ -114,12 +108,9 @@ export interface Quota { ): Promise; /** * Update the quota (service limits) of this resource to the requested value. - * - • To get the quota information for specific resource, send a GET request. - * - • To increase the quota, update the limit field from the GET response to a new value. - * - • To update the quota value, submit the JSON response to the quota request API to update the + * • To get the quota information for specific resource, send a GET request. + * • To increase the quota, update the limit field from the GET response to a new value. + * • To update the quota value, submit the JSON response to the quota request API to update the * quota. * • To update the quota. use the PATCH operation. * @param subscriptionId Azure subscription ID. @@ -142,12 +133,9 @@ export interface Quota { >; /** * Update the quota (service limits) of this resource to the requested value. - * - • To get the quota information for specific resource, send a GET request. - * - • To increase the quota, update the limit field from the GET response to a new value. - * - • To update the quota value, submit the JSON response to the quota request API to update the + * • To get the quota information for specific resource, send a GET request. + * • To increase the quota, update the limit field from the GET response to a new value. + * • To update the quota value, submit the JSON response to the quota request API to update the * quota. * • To update the quota. use the PATCH operation. * @param subscriptionId Azure subscription ID. diff --git a/sdk/reservations/arm-reservations/src/operationsInterfaces/reservation.ts b/sdk/reservations/arm-reservations/src/operationsInterfaces/reservation.ts index a483bc74afa1..36e1875e8c6b 100644 --- a/sdk/reservations/arm-reservations/src/operationsInterfaces/reservation.ts +++ b/sdk/reservations/arm-reservations/src/operationsInterfaces/reservation.ts @@ -26,7 +26,9 @@ import { ReservationGetResponse, Patch, ReservationUpdateOptionalParams, - ReservationUpdateResponse + ReservationUpdateResponse, + ReservationArchiveOptionalParams, + ReservationUnarchiveOptionalParams } from "../models"; /// @@ -191,4 +193,27 @@ export interface Reservation { parameters: Patch, options?: ReservationUpdateOptionalParams ): Promise; + /** + * Archiving a `Reservation` moves it to `Archived` state. + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the Reservation Item + * @param options The options parameters. + */ + archive( + reservationOrderId: string, + reservationId: string, + options?: ReservationArchiveOptionalParams + ): Promise; + /** + * Unarchiving a `Reservation` moves it to the state it was before archiving. + * + * @param reservationOrderId Order Id of the reservation + * @param reservationId Id of the Reservation Item + * @param options The options parameters. + */ + unarchive( + reservationOrderId: string, + reservationId: string, + options?: ReservationUnarchiveOptionalParams + ): Promise; } diff --git a/sdk/reservations/arm-reservations/src/operationsInterfaces/return.ts b/sdk/reservations/arm-reservations/src/operationsInterfaces/return.ts new file mode 100644 index 000000000000..844229b808ca --- /dev/null +++ b/sdk/reservations/arm-reservations/src/operationsInterfaces/return.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 { + RefundRequest, + ReturnPostOptionalParams, + ReturnPostResponse +} from "../models"; + +/** Interface representing a Return. */ +export interface Return { + /** + * Return a reservation. + * @param reservationOrderId Order Id of the reservation + * @param body Information needed for returning reservation. + * @param options The options parameters. + */ + post( + reservationOrderId: string, + body: RefundRequest, + options?: ReturnPostOptionalParams + ): Promise; +} diff --git a/sdk/reservations/arm-reservations/test/sampleTest.ts b/sdk/reservations/arm-reservations/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/reservations/arm-reservations/test/sampleTest.ts +++ b/sdk/reservations/arm-reservations/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -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: [] +const replaceableVariables: Record = { + 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" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; describe("My test", () => { let recorder: Recorder; - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() { diff --git a/sdk/reservations/arm-reservations/tsconfig.json b/sdk/reservations/arm-reservations/tsconfig.json index 036e5f561409..3e6ae96443f3 100644 --- a/sdk/reservations/arm-reservations/tsconfig.json +++ b/sdk/reservations/arm-reservations/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-reservations": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"