diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8bff9bd66933..348d457d3cf5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5957,6 +5957,85 @@ importers: specifier: catalog:testing version: 4.0.9(@types/debug@4.1.12)(@types/node@20.19.25)(@vitest/browser-playwright@4.0.9)(jsdom@16.7.0)(msw@2.7.3(@types/node@20.19.25)(typescript@5.9.3))(terser@5.39.0)(tsx@4.20.6)(yaml@2.8.1) + sdk/compute/arm-compute-disk: + dependencies: + '@azure/abort-controller': + specifier: ^2.1.2 + version: link:../../core/abort-controller + '@azure/core-auth': + specifier: ^1.9.0 + version: link:../../core/core-auth + '@azure/core-client': + specifier: ^1.9.3 + version: link:../../core/core-client + '@azure/core-lro': + specifier: ^2.5.4 + version: 2.7.2 + '@azure/core-paging': + specifier: ^1.6.2 + version: link:../../core/core-paging + '@azure/core-rest-pipeline': + specifier: ^1.19.1 + version: link:../../core/core-rest-pipeline + tslib: + specifier: ^2.8.1 + version: 2.8.1 + devDependencies: + '@azure-tools/test-credential': + specifier: workspace:^ + version: link:../../test-utils/test-credential + '@azure-tools/test-recorder': + specifier: workspace:^ + version: link:../../test-utils/recorder + '@azure-tools/test-utils-vitest': + specifier: workspace:^ + version: link:../../test-utils/test-utils-vitest + '@azure/dev-tool': + specifier: workspace:^ + version: link:../../../common/tools/dev-tool + '@azure/identity': + specifier: catalog:internal + version: 4.11.1 + '@azure/logger': + specifier: workspace:^ + version: link:../../core/logger + '@types/node': + specifier: 'catalog:' + version: 20.19.25 + '@vitest/browser-playwright': + specifier: catalog:testing + version: 4.0.9(msw@2.7.3(@types/node@20.19.25)(typescript@5.9.3))(playwright@1.56.1)(vite@7.2.2(@types/node@20.19.25)(terser@5.39.0)(tsx@4.20.6)(yaml@2.8.1))(vitest@4.0.9) + '@vitest/coverage-istanbul': + specifier: catalog:testing + version: 4.0.9(vitest@4.0.9) + cross-env: + specifier: 'catalog:' + version: 7.0.3 + dotenv: + specifier: catalog:testing + version: 16.6.1 + eslint: + specifier: 'catalog:' + version: 9.39.1 + playwright: + specifier: catalog:testing + version: 1.56.1 + prettier: + specifier: 'catalog:' + version: 3.6.2 + rimraf: + specifier: 'catalog:' + version: 6.1.0 + tshy: + specifier: 'catalog:' + version: 3.1.0 + typescript: + specifier: 'catalog:' + version: 5.9.3 + vitest: + specifier: catalog:testing + version: 4.0.9(@types/debug@4.1.12)(@types/node@20.19.25)(@vitest/browser-playwright@4.0.9)(jsdom@16.7.0)(msw@2.7.3(@types/node@20.19.25)(typescript@5.9.3))(terser@5.39.0)(tsx@4.20.6)(yaml@2.8.1) + sdk/compute/arm-compute-profile-2020-09-01-hybrid: dependencies: '@azure/abort-controller': diff --git a/sdk/compute/arm-compute-disk/CHANGELOG.md b/sdk/compute/arm-compute-disk/CHANGELOG.md new file mode 100644 index 000000000000..e0a44782cf62 --- /dev/null +++ b/sdk/compute/arm-compute-disk/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0-beta.1 (2025-11-18) + +### Features Added + +The package of @azure/arm-compute-disk is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/compute/arm-compute-disk/LICENSE b/sdk/compute/arm-compute-disk/LICENSE new file mode 100644 index 000000000000..63447fd8bbbf --- /dev/null +++ b/sdk/compute/arm-compute-disk/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/compute/arm-compute-disk/README.md b/sdk/compute/arm-compute-disk/README.md new file mode 100644 index 000000000000..1b10dfbe4847 --- /dev/null +++ b/sdk/compute/arm-compute-disk/README.md @@ -0,0 +1,115 @@ +# Azure ComputeDisk client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ComputeDisk client. + +Compute Disk Client + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute-disk) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-compute-disk) | +[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-compute-disk?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-compute-disk` package + +Install the Azure ComputeDisk client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-compute-disk +``` + +### Create and authenticate a `ComputeDiskClient` + +To create a client object to access the Azure ComputeDisk API, you will need the `endpoint` of your Azure ComputeDisk resource and a `credential`. The Azure ComputeDisk client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure ComputeDisk resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure ComputeDisk** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). + +For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. + +```ts snippet:ReadmeSampleCreateClient_Node +import { ComputeDiskClient } from "@azure/arm-compute-disk"; +import { DefaultAzureCredential } from "@azure/identity"; + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new ComputeDiskClient(new DefaultAzureCredential(), subscriptionId); +``` + +For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. + +```ts snippet:ReadmeSampleCreateClient_Browser +import { InteractiveBrowserCredential } from "@azure/identity"; +import { ComputeDiskClient } from "@azure/arm-compute-disk"; + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", +}); +const client = new ComputeDiskClient(credential, subscriptionId); +``` + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### ComputeDiskClient + +`ComputeDiskClient` is the primary interface for developers using the Azure ComputeDisk client library. Explore the methods on this client object to understand the different features of the Azure ComputeDisk 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`: + +```ts snippet:SetLogLevel +import { setLogLevel } from "@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) + + +[azure_cli]: https://learn.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/compute/arm-compute-disk/_meta.json b/sdk/compute/arm-compute-disk/_meta.json new file mode 100644 index 000000000000..22b1bc31ccd9 --- /dev/null +++ b/sdk/compute/arm-compute-disk/_meta.json @@ -0,0 +1,9 @@ +{ + "commit": "0b1e63c8a946be5d52d24dce6f10222a1a2de51c", + "readme": "specification/compute/resource-manager/Microsoft.Compute/DiskRP/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/compute/resource-manager/Microsoft.Compute/DiskRP/readme.md --tag=package-2025-04-01 --use=@autorest/typescript@^6.0.52", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.15.1", + "tag": "package-2025-04-01", + "use": "@autorest/typescript@^6.0.52" +} \ No newline at end of file diff --git a/sdk/compute/arm-compute-disk/api-extractor.json b/sdk/compute/arm-compute-disk/api-extractor.json new file mode 100644 index 000000000000..1e1b312909b1 --- /dev/null +++ b/sdk/compute/arm-compute-disk/api-extractor.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../api-extractor-base.json" +} \ No newline at end of file diff --git a/sdk/compute/arm-compute-disk/package.json b/sdk/compute/arm-compute-disk/package.json new file mode 100644 index 000000000000..b2f4743e8c61 --- /dev/null +++ b/sdk/compute/arm-compute-disk/package.json @@ -0,0 +1,127 @@ +{ + "name": "@azure/arm-compute-disk", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for ComputeDiskClient.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=20.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", + "@azure/core-paging": "^1.6.2", + "@azure/core-client": "^1.9.3", + "@azure/core-auth": "^1.9.0", + "@azure/core-rest-pipeline": "^1.19.1", + "tslib": "^2.8.1" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic", + "cloud" + ], + "license": "MIT", + "main": "./dist/commonjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/commonjs/index.d.ts", + "type": "module", + "devDependencies": { + "typescript": "catalog:", + "rimraf": "catalog:", + "dotenv": "catalog:testing", + "@azure/dev-tool": "workspace:^", + "cross-env": "catalog:", + "eslint": "catalog:", + "prettier": "catalog:", + "tshy": "catalog:", + "@azure/identity": "catalog:internal", + "@azure/logger": "workspace:^", + "@azure-tools/test-recorder": "workspace:^", + "@azure-tools/test-credential": "workspace:^", + "@azure-tools/test-utils-vitest": "workspace:^", + "@types/node": "catalog:", + "@vitest/browser-playwright": "catalog:testing", + "@vitest/coverage-istanbul": "catalog:testing", + "playwright": "catalog:testing", + "vitest": "catalog:testing" + }, + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/", + "README.md", + "LICENSE" + ], + "scripts": { + "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "pack": "pnpm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:samples": "echo skipped.", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "execute:samples": "echo skipped", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "test": "npm run test:node && npm run test:browser", + "test:node": "dev-tool run test:vitest", + "test:browser": "echo skipped", + "update-snippets": "dev-tool run update-snippets", + "test:node:esm": "dev-tool run test:vitest --esm" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/computeDiskClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "tshy": { + "project": "../../../tsconfig.src.build.json", + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute-disk", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + } +} \ No newline at end of file diff --git a/sdk/compute/arm-compute-disk/review/arm-compute-disk-node.api.md b/sdk/compute/arm-compute-disk/review/arm-compute-disk-node.api.md new file mode 100644 index 000000000000..0ea398b815fb --- /dev/null +++ b/sdk/compute/arm-compute-disk/review/arm-compute-disk-node.api.md @@ -0,0 +1,1335 @@ +## API Report File for "@azure/arm-compute-disk" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PagedAsyncIterableIterator } from '@azure/core-paging'; +import type { SimplePollerLike } from '@azure/core-lro'; + +// @public +export type AccessLevel = string; + +// @public +export interface AccessUri { + readonly accessSAS?: string; + readonly securityDataAccessSAS?: string; + readonly securityMetadataAccessSAS?: string; +} + +// @public +export interface ApiError { + code?: string; + details?: ApiErrorBase[]; + innererror?: InnerError; + message?: string; + target?: string; +} + +// @public +export interface ApiErrorBase { + code?: string; + message?: string; + target?: string; +} + +// @public +export type Architecture = string; + +// @public +export interface AvailabilityPolicy { + actionOnDiskDelay?: AvailabilityPolicyDiskDelay; +} + +// @public +export type AvailabilityPolicyDiskDelay = string; + +// @public +export interface CloudError { + error?: ApiError; +} + +// @public (undocumented) +export class ComputeDiskClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ComputeDiskClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + diskAccesses: DiskAccesses; + // (undocumented) + diskEncryptionSets: DiskEncryptionSets; + // (undocumented) + diskRestorePointOperations: DiskRestorePointOperations; + // (undocumented) + disks: Disks; + // (undocumented) + snapshots: Snapshots; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface ComputeDiskClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export interface CopyCompletionError { + errorCode: CopyCompletionErrorReason; + errorMessage: string; +} + +// @public +export type CopyCompletionErrorReason = string; + +// @public +export type CreatedByType = string; + +// @public +export interface CreationData { + createOption: DiskCreateOption; + elasticSanResourceId?: string; + galleryImageReference?: ImageDiskReference; + imageReference?: ImageDiskReference; + instantAccessDurationMinutes?: number; + logicalSectorSize?: number; + performancePlus?: boolean; + provisionedBandwidthCopySpeed?: ProvisionedBandwidthCopyOption; + securityDataUri?: string; + securityMetadataUri?: string; + sourceResourceId?: string; + readonly sourceUniqueId?: string; + sourceUri?: string; + storageAccountId?: string; + uploadSizeBytes?: number; +} + +// @public +export type DataAccessAuthMode = string; + +// @public +export interface Disk extends TrackedResource { + availabilityPolicy?: AvailabilityPolicy; + burstingEnabled?: boolean; + readonly burstingEnabledTime?: Date; + completionPercent?: number; + creationData?: CreationData; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskIopsReadOnly?: number; + diskIopsReadWrite?: number; + diskMBpsReadOnly?: number; + diskMBpsReadWrite?: number; + readonly diskSizeBytes?: number; + diskSizeGB?: number; + readonly diskState?: DiskState; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + extendedLocation?: ExtendedLocation; + hyperVGeneration?: HyperVGeneration; + readonly lastOwnershipUpdateTime?: Date; + readonly managedBy?: string; + readonly managedByExtended?: string[]; + maxShares?: number; + networkAccessPolicy?: NetworkAccessPolicy; + optimizedForFrequentAttach?: boolean; + osType?: OperatingSystemTypes; + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + securityProfile?: DiskSecurityProfile; + readonly shareInfo?: ShareInfoElement[]; + sku?: DiskSku; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + tier?: string; + readonly timeCreated?: Date; + readonly uniqueId?: string; + zones?: string[]; +} + +// @public +export interface DiskAccess extends TrackedResource { + extendedLocation?: ExtendedLocation; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: string; + readonly timeCreated?: Date; +} + +// @public +export interface DiskAccesses { + beginCreateOrUpdate(resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccess, options?: DiskAccessesCreateOrUpdateOptionalParams): Promise, DiskAccessesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccess, options?: DiskAccessesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, diskAccessName: string, options?: DiskAccessesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, diskAccessName: string, options?: DiskAccessesDeleteOptionalParams): Promise; + beginDeleteAPrivateEndpointConnection(resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams): Promise, void>>; + beginDeleteAPrivateEndpointConnectionAndWait(resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams): Promise; + beginUpdate(resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccessUpdate, options?: DiskAccessesUpdateOptionalParams): Promise, DiskAccessesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, diskAccessName: string, diskAccess: DiskAccessUpdate, options?: DiskAccessesUpdateOptionalParams): Promise; + beginUpdateAPrivateEndpointConnection(resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams): Promise, DiskAccessesUpdateAPrivateEndpointConnectionResponse>>; + beginUpdateAPrivateEndpointConnectionAndWait(resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams): Promise; + get(resourceGroupName: string, diskAccessName: string, options?: DiskAccessesGetOptionalParams): Promise; + getAPrivateEndpointConnection(resourceGroupName: string, diskAccessName: string, privateEndpointConnectionName: string, options?: DiskAccessesGetAPrivateEndpointConnectionOptionalParams): Promise; + getPrivateLinkResources(resourceGroupName: string, diskAccessName: string, options?: DiskAccessesGetPrivateLinkResourcesOptionalParams): Promise; + list(options?: DiskAccessesListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: DiskAccessesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listPrivateEndpointConnections(resourceGroupName: string, diskAccessName: string, options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DiskAccessesCreateOrUpdateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DiskAccessesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DiskAccessesCreateOrUpdateResponse = DiskAccess; + +// @public +export interface DiskAccessesDeleteAPrivateEndpointConnectionHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DiskAccessesDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DiskAccessesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DiskAccessesGetAPrivateEndpointConnectionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskAccessesGetAPrivateEndpointConnectionResponse = PrivateEndpointConnection; + +// @public +export interface DiskAccessesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DiskAccessesGetPrivateLinkResourcesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskAccessesGetPrivateLinkResourcesResponse = PrivateLinkResourceListResult; + +// @public +export type DiskAccessesGetResponse = DiskAccess; + +// @public +export interface DiskAccessesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskAccessesListByResourceGroupNextResponse = DiskAccessList; + +// @public +export interface DiskAccessesListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskAccessesListByResourceGroupResponse = DiskAccessList; + +// @public +export interface DiskAccessesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskAccessesListNextResponse = DiskAccessList; + +// @public +export interface DiskAccessesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DiskAccessesListPrivateEndpointConnectionsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskAccessesListPrivateEndpointConnectionsNextResponse = PrivateEndpointConnectionListResult; + +// @public +export interface DiskAccessesListPrivateEndpointConnectionsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskAccessesListPrivateEndpointConnectionsResponse = PrivateEndpointConnectionListResult; + +// @public +export type DiskAccessesListResponse = DiskAccessList; + +// @public +export interface DiskAccessesUpdateAPrivateEndpointConnectionHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DiskAccessesUpdateAPrivateEndpointConnectionResponse = PrivateEndpointConnection; + +// @public +export interface DiskAccessesUpdateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DiskAccessesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DiskAccessesUpdateResponse = DiskAccess; + +// @public +export interface DiskAccessList { + nextLink?: string; + value: DiskAccess[]; +} + +// @public +export interface DiskAccessUpdate { + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type DiskCreateOption = string; + +// @public +export interface DiskEncryptionSet extends TrackedResource { + activeKey?: KeyForDiskEncryptionSet; + readonly autoKeyRotationError?: ApiError; + encryptionType?: DiskEncryptionSetType; + federatedClientId?: string; + identity?: EncryptionSetIdentity; + readonly lastKeyRotationTimestamp?: Date; + readonly previousKeys?: KeyForDiskEncryptionSet[]; + readonly provisioningState?: string; + rotationToLatestKeyVersionEnabled?: boolean; +} + +// @public +export type DiskEncryptionSetIdentityType = string; + +// @public +export interface DiskEncryptionSetList { + nextLink?: string; + value: DiskEncryptionSet[]; +} + +// @public +export interface DiskEncryptionSets { + beginCreateOrUpdate(resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSet, options?: DiskEncryptionSetsCreateOrUpdateOptionalParams): Promise, DiskEncryptionSetsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSet, options?: DiskEncryptionSetsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSetUpdate, options?: DiskEncryptionSetsUpdateOptionalParams): Promise, DiskEncryptionSetsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, diskEncryptionSetName: string, diskEncryptionSet: DiskEncryptionSetUpdate, options?: DiskEncryptionSetsUpdateOptionalParams): Promise; + get(resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsGetOptionalParams): Promise; + list(options?: DiskEncryptionSetsListOptionalParams): PagedAsyncIterableIterator; + listAssociatedResources(resourceGroupName: string, diskEncryptionSetName: string, options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: DiskEncryptionSetsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DiskEncryptionSetsCreateOrUpdateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DiskEncryptionSetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DiskEncryptionSetsCreateOrUpdateResponse = DiskEncryptionSet; + +// @public +export interface DiskEncryptionSetsDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DiskEncryptionSetsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DiskEncryptionSetsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskEncryptionSetsGetResponse = DiskEncryptionSet; + +// @public +export interface DiskEncryptionSetsListAssociatedResourcesNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskEncryptionSetsListAssociatedResourcesNextResponse = ResourceUriList; + +// @public +export interface DiskEncryptionSetsListAssociatedResourcesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskEncryptionSetsListAssociatedResourcesResponse = ResourceUriList; + +// @public +export interface DiskEncryptionSetsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskEncryptionSetsListByResourceGroupNextResponse = DiskEncryptionSetList; + +// @public +export interface DiskEncryptionSetsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskEncryptionSetsListByResourceGroupResponse = DiskEncryptionSetList; + +// @public +export interface DiskEncryptionSetsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskEncryptionSetsListNextResponse = DiskEncryptionSetList; + +// @public +export interface DiskEncryptionSetsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskEncryptionSetsListResponse = DiskEncryptionSetList; + +// @public +export interface DiskEncryptionSetsUpdateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DiskEncryptionSetsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DiskEncryptionSetsUpdateResponse = DiskEncryptionSet; + +// @public +export type DiskEncryptionSetType = string; + +// @public +export interface DiskEncryptionSetUpdate { + activeKey?: KeyForDiskEncryptionSet; + encryptionType?: DiskEncryptionSetType; + federatedClientId?: string; + identity?: EncryptionSetIdentity; + rotationToLatestKeyVersionEnabled?: boolean; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface DiskList { + nextLink?: string; + value: Disk[]; +} + +// @public +export interface DiskPurchasePlan { + name: string; + product: string; + promotionCode?: string; + publisher: string; +} + +// @public +export interface DiskRestorePoint extends ProxyResource { + completionPercent?: number; + diskAccessId?: string; + readonly encryption?: Encryption; + readonly familyId?: string; + hyperVGeneration?: HyperVGeneration; + readonly logicalSectorSize?: number; + networkAccessPolicy?: NetworkAccessPolicy; + readonly osType?: OperatingSystemTypes; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + readonly replicationState?: string; + securityProfile?: DiskSecurityProfile; + readonly sourceResourceId?: string; + readonly sourceResourceLocation?: string; + readonly sourceUniqueId?: string; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + readonly timeCreated?: Date; +} + +// @public +export interface DiskRestorePointGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskRestorePointGetResponse = DiskRestorePoint; + +// @public +export interface DiskRestorePointGrantAccessHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DiskRestorePointGrantAccessOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DiskRestorePointGrantAccessResponse = AccessUri; + +// @public +export interface DiskRestorePointList { + nextLink?: string; + value: DiskRestorePoint[]; +} + +// @public +export interface DiskRestorePointListByRestorePointNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskRestorePointListByRestorePointNextResponse = DiskRestorePointList; + +// @public +export interface DiskRestorePointListByRestorePointOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DiskRestorePointListByRestorePointResponse = DiskRestorePointList; + +// @public +export interface DiskRestorePointOperations { + beginGrantAccess(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, grantAccessData: GrantAccessData, options?: DiskRestorePointGrantAccessOptionalParams): Promise, DiskRestorePointGrantAccessResponse>>; + beginGrantAccessAndWait(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, grantAccessData: GrantAccessData, options?: DiskRestorePointGrantAccessOptionalParams): Promise; + beginRevokeAccess(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, options?: DiskRestorePointRevokeAccessOptionalParams): Promise, void>>; + beginRevokeAccessAndWait(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, options?: DiskRestorePointRevokeAccessOptionalParams): Promise; + get(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, diskRestorePointName: string, options?: DiskRestorePointGetOptionalParams): Promise; + listByRestorePoint(resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, options?: DiskRestorePointListByRestorePointOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DiskRestorePointRevokeAccessHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DiskRestorePointRevokeAccessOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface Disks { + beginCreateOrUpdate(resourceGroupName: string, diskName: string, disk: Disk, options?: DisksCreateOrUpdateOptionalParams): Promise, DisksCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, diskName: string, disk: Disk, options?: DisksCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, diskName: string, options?: DisksDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, diskName: string, options?: DisksDeleteOptionalParams): Promise; + beginGrantAccess(resourceGroupName: string, diskName: string, grantAccessData: GrantAccessData, options?: DisksGrantAccessOptionalParams): Promise, DisksGrantAccessResponse>>; + beginGrantAccessAndWait(resourceGroupName: string, diskName: string, grantAccessData: GrantAccessData, options?: DisksGrantAccessOptionalParams): Promise; + beginRevokeAccess(resourceGroupName: string, diskName: string, options?: DisksRevokeAccessOptionalParams): Promise, void>>; + beginRevokeAccessAndWait(resourceGroupName: string, diskName: string, options?: DisksRevokeAccessOptionalParams): Promise; + beginUpdate(resourceGroupName: string, diskName: string, disk: DiskUpdate, options?: DisksUpdateOptionalParams): Promise, DisksUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, diskName: string, disk: DiskUpdate, options?: DisksUpdateOptionalParams): Promise; + get(resourceGroupName: string, diskName: string, options?: DisksGetOptionalParams): Promise; + list(options?: DisksListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: DisksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DisksCreateOrUpdateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DisksCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DisksCreateOrUpdateResponse = Disk; + +// @public +export interface DisksDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DisksDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface DiskSecurityProfile { + secureVMDiskEncryptionSetId?: string; + securityType?: DiskSecurityTypes; +} + +// @public +export type DiskSecurityTypes = string; + +// @public +export interface DisksGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisksGetResponse = Disk; + +// @public +export interface DisksGrantAccessHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DisksGrantAccessOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DisksGrantAccessResponse = AccessUri; + +// @public +export interface DiskSku { + name?: DiskStorageAccountTypes; + readonly tier?: string; +} + +// @public +export interface DisksListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisksListByResourceGroupNextResponse = DiskList; + +// @public +export interface DisksListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisksListByResourceGroupResponse = DiskList; + +// @public +export interface DisksListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisksListNextResponse = DiskList; + +// @public +export interface DisksListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DisksListResponse = DiskList; + +// @public +export interface DisksRevokeAccessHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DisksRevokeAccessOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DiskState = string; + +// @public +export type DiskStorageAccountTypes = string; + +// @public +export interface DisksUpdateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface DisksUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type DisksUpdateResponse = Disk; + +// @public +export interface DiskUpdate { + availabilityPolicy?: AvailabilityPolicy; + burstingEnabled?: boolean; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskIopsReadOnly?: number; + diskIopsReadWrite?: number; + diskMBpsReadOnly?: number; + diskMBpsReadWrite?: number; + diskSizeGB?: number; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + maxShares?: number; + networkAccessPolicy?: NetworkAccessPolicy; + optimizedForFrequentAttach?: boolean; + osType?: OperatingSystemTypes; + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + sku?: DiskSku; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + tags?: { + [propertyName: string]: string; + }; + tier?: string; +} + +// @public +export interface Encryption { + diskEncryptionSetId?: string; + type?: EncryptionType; +} + +// @public +export interface EncryptionSetIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type?: DiskEncryptionSetIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentitiesValue; + }; +} + +// @public +export interface EncryptionSettingsCollection { + enabled: boolean; + encryptionSettings?: EncryptionSettingsElement[]; + encryptionSettingsVersion?: string; +} + +// @public +export interface EncryptionSettingsElement { + diskEncryptionKey?: KeyVaultAndSecretReference; + keyEncryptionKey?: KeyVaultAndKeyReference; +} + +// @public +export type EncryptionType = string; + +// @public +export interface ExtendedLocation { + name?: string; + type?: ExtendedLocationTypes; +} + +// @public +export type ExtendedLocationTypes = string; + +// @public +export type FileFormat = string; + +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export interface GrantAccessData { + access: AccessLevel; + durationInSeconds: number; + fileFormat?: FileFormat; + getSecureVMGuestStateSAS?: boolean; +} + +// @public +export type HyperVGeneration = string; + +// @public +export interface ImageDiskReference { + communityGalleryImageId?: string; + id?: string; + lun?: number; + sharedGalleryImageId?: string; +} + +// @public +export interface InnerError { + errordetail?: string; + exceptiontype?: string; +} + +// @public +export interface KeyForDiskEncryptionSet { + keyUrl: string; + sourceVault?: SourceVault; +} + +// @public +export interface KeyVaultAndKeyReference { + keyUrl: string; + sourceVault: SourceVault; +} + +// @public +export interface KeyVaultAndSecretReference { + secretUrl: string; + sourceVault: SourceVault; +} + +// @public +export enum KnownAccessLevel { + None = "None", + Read = "Read", + Write = "Write" +} + +// @public +export enum KnownArchitecture { + Arm64 = "Arm64", + X64 = "x64" +} + +// @public +export enum KnownAvailabilityPolicyDiskDelay { + AutomaticReattach = "AutomaticReattach", + None = "None" +} + +// @public +export enum KnownCopyCompletionErrorReason { + CopySourceNotFound = "CopySourceNotFound" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDataAccessAuthMode { + AzureActiveDirectory = "AzureActiveDirectory", + None = "None" +} + +// @public +export enum KnownDiskCreateOption { + Attach = "Attach", + Copy = "Copy", + CopyFromSanSnapshot = "CopyFromSanSnapshot", + CopyStart = "CopyStart", + Empty = "Empty", + FromImage = "FromImage", + Import = "Import", + ImportSecure = "ImportSecure", + Restore = "Restore", + Upload = "Upload", + UploadPreparedSecure = "UploadPreparedSecure" +} + +// @public +export enum KnownDiskEncryptionSetIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownDiskEncryptionSetType { + ConfidentialVmEncryptedWithCustomerKey = "ConfidentialVmEncryptedWithCustomerKey", + EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", + EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys" +} + +// @public +export enum KnownDiskSecurityTypes { + ConfidentialVMDiskEncryptedWithCustomerKey = "ConfidentialVM_DiskEncryptedWithCustomerKey", + ConfidentialVMDiskEncryptedWithPlatformKey = "ConfidentialVM_DiskEncryptedWithPlatformKey", + ConfidentialVMNonPersistedTPM = "ConfidentialVM_NonPersistedTPM", + ConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", + TrustedLaunch = "TrustedLaunch" +} + +// @public +export enum KnownDiskState { + ActiveSAS = "ActiveSAS", + ActiveSASFrozen = "ActiveSASFrozen", + ActiveUpload = "ActiveUpload", + Attached = "Attached", + Frozen = "Frozen", + ReadyToUpload = "ReadyToUpload", + Reserved = "Reserved", + Unattached = "Unattached" +} + +// @public +export enum KnownDiskStorageAccountTypes { + PremiumLRS = "Premium_LRS", + PremiumV2LRS = "PremiumV2_LRS", + PremiumZRS = "Premium_ZRS", + StandardLRS = "Standard_LRS", + StandardSSDLRS = "StandardSSD_LRS", + StandardSSDZRS = "StandardSSD_ZRS", + UltraSSDLRS = "UltraSSD_LRS" +} + +// @public +export enum KnownEncryptionType { + EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", + EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys", + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey" +} + +// @public +export enum KnownExtendedLocationTypes { + EdgeZone = "EdgeZone" +} + +// @public +export enum KnownFileFormat { + VHD = "VHD", + Vhdx = "VHDX" +} + +// @public +export enum KnownHyperVGeneration { + V1 = "V1", + V2 = "V2" +} + +// @public +export enum KnownNetworkAccessPolicy { + AllowAll = "AllowAll", + AllowPrivate = "AllowPrivate", + DenyAll = "DenyAll" +} + +// @public +export enum KnownPrivateEndpointConnectionProvisioningState { + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + Approved = "Approved", + Pending = "Pending", + Rejected = "Rejected" +} + +// @public +export enum KnownProvisionedBandwidthCopyOption { + Enhanced = "Enhanced", + None = "None" +} + +// @public +export enum KnownPublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownSnapshotAccessState { + Available = "Available", + AvailableWithInstantAccess = "AvailableWithInstantAccess", + InstantAccess = "InstantAccess", + Pending = "Pending", + Unknown = "Unknown" +} + +// @public +export enum KnownSnapshotStorageAccountTypes { + PremiumLRS = "Premium_LRS", + StandardLRS = "Standard_LRS", + StandardZRS = "Standard_ZRS" +} + +// @public +export enum KnownSupportedSecurityOption { + TrustedLaunchAndConfidentialVMSupported = "TrustedLaunchAndConfidentialVMSupported", + TrustedLaunchSupported = "TrustedLaunchSupported" +} + +// @public +export type NetworkAccessPolicy = string; + +// @public +export type OperatingSystemTypes = "Windows" | "Linux"; + +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export interface PrivateEndpointConnection extends ProxyResource { + readonly privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +// @public +export interface PrivateEndpointConnectionListResult { + nextLink?: string; + value: PrivateEndpointConnection[]; +} + +// @public +export type PrivateEndpointConnectionProvisioningState = string; + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export interface PrivateLinkResource { + readonly groupId?: string; + readonly id?: string; + readonly name?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; + readonly type?: string; +} + +// @public +export interface PrivateLinkResourceListResult { + value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + +// @public +export interface PropertyUpdatesInProgress { + targetTier?: string; +} + +// @public +export type ProvisionedBandwidthCopyOption = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export type PublicNetworkAccess = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ResourceUriList { + nextLink?: string; + value: string[]; +} + +// @public (undocumented) +export interface ShareInfoElement { + readonly vmUri?: string; +} + +// @public +export interface Snapshot extends TrackedResource { + completionPercent?: number; + copyCompletionError?: CopyCompletionError; + creationData?: CreationData; + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + readonly diskSizeBytes?: number; + diskSizeGB?: number; + readonly diskState?: DiskState; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + extendedLocation?: ExtendedLocation; + hyperVGeneration?: HyperVGeneration; + incremental?: boolean; + readonly incrementalSnapshotFamilyId?: string; + readonly managedBy?: string; + networkAccessPolicy?: NetworkAccessPolicy; + osType?: OperatingSystemTypes; + readonly provisioningState?: string; + publicNetworkAccess?: PublicNetworkAccess; + purchasePlan?: DiskPurchasePlan; + securityProfile?: DiskSecurityProfile; + sku?: SnapshotSku; + readonly snapshotAccessState?: SnapshotAccessState; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + readonly timeCreated?: Date; + readonly uniqueId?: string; +} + +// @public +export type SnapshotAccessState = string; + +// @public +export interface SnapshotList { + nextLink?: string; + value: Snapshot[]; +} + +// @public +export interface Snapshots { + beginCreateOrUpdate(resourceGroupName: string, snapshotName: string, snapshot: Snapshot, options?: SnapshotsCreateOrUpdateOptionalParams): Promise, SnapshotsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, snapshotName: string, snapshot: Snapshot, options?: SnapshotsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, snapshotName: string, options?: SnapshotsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, snapshotName: string, options?: SnapshotsDeleteOptionalParams): Promise; + beginGrantAccess(resourceGroupName: string, snapshotName: string, grantAccessData: GrantAccessData, options?: SnapshotsGrantAccessOptionalParams): Promise, SnapshotsGrantAccessResponse>>; + beginGrantAccessAndWait(resourceGroupName: string, snapshotName: string, grantAccessData: GrantAccessData, options?: SnapshotsGrantAccessOptionalParams): Promise; + beginRevokeAccess(resourceGroupName: string, snapshotName: string, options?: SnapshotsRevokeAccessOptionalParams): Promise, void>>; + beginRevokeAccessAndWait(resourceGroupName: string, snapshotName: string, options?: SnapshotsRevokeAccessOptionalParams): Promise; + beginUpdate(resourceGroupName: string, snapshotName: string, snapshot: SnapshotUpdate, options?: SnapshotsUpdateOptionalParams): Promise, SnapshotsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, snapshotName: string, snapshot: SnapshotUpdate, options?: SnapshotsUpdateOptionalParams): Promise; + get(resourceGroupName: string, snapshotName: string, options?: SnapshotsGetOptionalParams): Promise; + list(options?: SnapshotsListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: SnapshotsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SnapshotsCreateOrUpdateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface SnapshotsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SnapshotsCreateOrUpdateResponse = Snapshot; + +// @public +export interface SnapshotsDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface SnapshotsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface SnapshotsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SnapshotsGetResponse = Snapshot; + +// @public +export interface SnapshotsGrantAccessHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface SnapshotsGrantAccessOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SnapshotsGrantAccessResponse = AccessUri; + +// @public +export interface SnapshotSku { + name?: SnapshotStorageAccountTypes; + readonly tier?: string; +} + +// @public +export interface SnapshotsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SnapshotsListByResourceGroupNextResponse = SnapshotList; + +// @public +export interface SnapshotsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SnapshotsListByResourceGroupResponse = SnapshotList; + +// @public +export interface SnapshotsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SnapshotsListNextResponse = SnapshotList; + +// @public +export interface SnapshotsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SnapshotsListResponse = SnapshotList; + +// @public +export interface SnapshotsRevokeAccessHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface SnapshotsRevokeAccessOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SnapshotStorageAccountTypes = string; + +// @public +export interface SnapshotsUpdateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface SnapshotsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SnapshotsUpdateResponse = Snapshot; + +// @public +export interface SnapshotUpdate { + dataAccessAuthMode?: DataAccessAuthMode; + diskAccessId?: string; + diskSizeGB?: number; + encryption?: Encryption; + encryptionSettingsCollection?: EncryptionSettingsCollection; + networkAccessPolicy?: NetworkAccessPolicy; + osType?: OperatingSystemTypes; + publicNetworkAccess?: PublicNetworkAccess; + sku?: SnapshotSku; + readonly snapshotAccessState?: SnapshotAccessState; + supportedCapabilities?: SupportedCapabilities; + supportsHibernation?: boolean; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface SourceVault { + id?: string; +} + +// @public +export interface SupportedCapabilities { + acceleratedNetwork?: boolean; + architecture?: Architecture; + diskControllerTypes?: string; + supportedSecurityOption?: SupportedSecurityOption; +} + +// @public +export type SupportedSecurityOption = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public (undocumented) +export interface UserAssignedIdentitiesValue { + readonly clientId?: string; + readonly principalId?: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/compute/arm-compute-disk/sample.env b/sdk/compute/arm-compute-disk/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/compute/arm-compute-disk/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/compute/arm-compute-disk/src/computeDiskClient.ts b/sdk/compute/arm-compute-disk/src/computeDiskClient.ts new file mode 100644 index 000000000000..c840b285bac7 --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/computeDiskClient.ts @@ -0,0 +1,159 @@ +// 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 coreRestPipeline from "@azure/core-rest-pipeline"; +import type { + PipelineRequest, + PipelineResponse, + SendRequest, +} from "@azure/core-rest-pipeline"; +import type * as coreAuth from "@azure/core-auth"; +import { + DiskAccessesImpl, + DiskEncryptionSetsImpl, + DisksImpl, + SnapshotsImpl, + DiskRestorePointOperationsImpl, +} from "./operations/index.js"; +import type { + DiskAccesses, + DiskEncryptionSets, + Disks, + Snapshots, + DiskRestorePointOperations, +} from "./operationsInterfaces/index.js"; +import type { ComputeDiskClientOptionalParams } from "./models/index.js"; + +export class ComputeDiskClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the ComputeDiskClient 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?: ComputeDiskClientOptionalParams, + ) { + 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: ComputeDiskClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials, + }; + + const packageDetails = `azsdk-js-arm-compute-disk/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix, + }, + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com", + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName, + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge, + }, + }), + ); + } + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2025-01-02"; + this.diskAccesses = new DiskAccessesImpl(this); + this.diskEncryptionSets = new DiskEncryptionSetsImpl(this); + this.disks = new DisksImpl(this); + this.snapshots = new SnapshotsImpl(this); + this.diskRestorePointOperations = new DiskRestorePointOperationsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest, + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + }, + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + diskAccesses: DiskAccesses; + diskEncryptionSets: DiskEncryptionSets; + disks: Disks; + snapshots: Snapshots; + diskRestorePointOperations: DiskRestorePointOperations; +} diff --git a/sdk/compute/arm-compute-disk/src/index.ts b/sdk/compute/arm-compute-disk/src/index.ts new file mode 100644 index 000000000000..6a162f2e5bfb --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +/// +export { getContinuationToken } from "./pagingHelper.js"; +export * from "./models/index.js"; +export { ComputeDiskClient } from "./computeDiskClient.js"; +export * from "./operationsInterfaces/index.js"; diff --git a/sdk/compute/arm-compute-disk/src/lroImpl.ts b/sdk/compute/arm-compute-disk/src/lroImpl.ts new file mode 100644 index 000000000000..d8248eb2db2d --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/lroImpl.ts @@ -0,0 +1,37 @@ +// 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 type { AbortSignalLike } from "@azure/abort-controller"; +import type { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike }, + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal, + }); + }, + }; +} diff --git a/sdk/compute/arm-compute-disk/src/models/index.ts b/sdk/compute/arm-compute-disk/src/models/index.ts new file mode 100644 index 000000000000..c445787c5e25 --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/models/index.ts @@ -0,0 +1,2045 @@ +// 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 type * as coreClient from "@azure/core-client"; + +/** The List disk access operation response. */ +export interface DiskAccessList { + /** The DiskAccess items on this page */ + value: DiskAccess[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** 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. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * 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; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** The complex type of the extended location. */ +export interface ExtendedLocation { + /** The name of the extended location. */ + name?: string; + /** The type of the extended location. */ + type?: ExtendedLocationTypes; +} + +/** An error response from the Compute service. */ +export interface CloudError { + /** Api error. */ + error?: ApiError; +} + +/** Api error. */ +export interface ApiError { + /** The Api error details */ + details?: ApiErrorBase[]; + /** The Api inner error */ + innererror?: InnerError; + /** The error code. */ + code?: string; + /** The target of the particular error. */ + target?: string; + /** The error message. */ + message?: string; +} + +/** Api error base. */ +export interface ApiErrorBase { + /** The error code. */ + code?: string; + /** The target of the particular error. */ + target?: string; + /** The error message. */ + message?: string; +} + +/** Inner error details. */ +export interface InnerError { + /** The exception type. */ + exceptiontype?: string; + /** The internal error message or exception dump. */ + errordetail?: string; +} + +/** The List disk encryption set operation response. */ +export interface DiskEncryptionSetList { + /** The DiskEncryptionSet items on this page */ + value: DiskEncryptionSet[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots */ +export interface KeyForDiskEncryptionSet { + /** Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the KeyVault subscription is not the same as the Disk Encryption Set subscription. */ + sourceVault?: SourceVault; + /** Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled value. */ + keyUrl: string; +} + +/** The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} */ +export interface SourceVault { + /** Resource Id */ + id?: string; +} + +/** The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. */ +export interface EncryptionSetIdentity { + /** The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. */ + type?: DiskEncryptionSetIdentityType; + /** + * The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The list of user identities associated with the disk encryption set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentitiesValue; + }; +} + +export interface UserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + +/** The List Disks operation response. */ +export interface DiskList { + /** The Disk items on this page */ + value: Disk[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ +export interface DiskPurchasePlan { + /** The plan ID. */ + name: string; + /** The publisher ID. */ + publisher: string; + /** Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. */ + product: string; + /** The Offer Promotion Code. */ + promotionCode?: string; +} + +/** List of supported capabilities persisted on the disk resource for VM use. */ +export interface SupportedCapabilities { + /** The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI. */ + diskControllerTypes?: string; + /** True if the image from which the OS disk is created supports accelerated networking. */ + acceleratedNetwork?: boolean; + /** CPU architecture supported by an OS disk. */ + architecture?: Architecture; + /** Refers to the security capability of the disk supported to create a Trusted launch or Confidential VM */ + supportedSecurityOption?: SupportedSecurityOption; +} + +/** Data used when creating a disk. */ +export interface CreationData { + /** This enumerates the possible sources of a disk's creation. */ + createOption: DiskCreateOption; + /** Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. */ + storageAccountId?: string; + /** Disk source information for PIR or user images. */ + imageReference?: ImageDiskReference; + /** Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. */ + galleryImageReference?: ImageDiskReference; + /** If createOption is Import, this is the URI of a blob to be imported into a managed disk. */ + sourceUri?: string; + /** If createOption is Copy, this is the ARM id of the source snapshot or disk. */ + sourceResourceId?: string; + /** + * If this field is set, this is the unique id identifying the source of this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sourceUniqueId?: string; + /** If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). */ + uploadSizeBytes?: number; + /** Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. */ + logicalSectorSize?: number; + /** If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state. */ + securityDataUri?: string; + /** If createOption is ImportSecure, this is the URI of a blob to be imported into VM metadata for Confidential VM. */ + securityMetadataUri?: string; + /** Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance target. This flag can only be set on disk creation time and cannot be disabled after enabled. */ + performancePlus?: boolean; + /** Required if createOption is CopyFromSanSnapshot. This is the ARM id of the source elastic san volume snapshot. */ + elasticSanResourceId?: string; + /** If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed. */ + provisionedBandwidthCopySpeed?: ProvisionedBandwidthCopyOption; + /** For snapshots created from Premium SSD v2 or Ultra disk, this property determines the time in minutes the snapshot is retained for instant access to enable faster restore. */ + instantAccessDurationMinutes?: number; +} + +/** The source image used for creating the disk. */ +export interface ImageDiskReference { + /** A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference. */ + id?: string; + /** A relative uri containing a direct shared Azure Compute Gallery image reference. */ + sharedGalleryImageId?: string; + /** A relative uri containing a community Azure Compute Gallery image reference. */ + communityGalleryImageId?: string; + /** If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. */ + lun?: number; +} + +/** Encryption settings for disk or snapshot */ +export interface EncryptionSettingsCollection { + /** Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. */ + enabled: boolean; + /** A collection of encryption settings, one for each disk volume. */ + encryptionSettings?: EncryptionSettingsElement[]; + /** Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. */ + encryptionSettingsVersion?: string; +} + +/** Encryption settings for one disk volume. */ +export interface EncryptionSettingsElement { + /** Key Vault Secret Url and vault id of the disk encryption key */ + diskEncryptionKey?: KeyVaultAndSecretReference; + /** Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. */ + keyEncryptionKey?: KeyVaultAndKeyReference; +} + +/** Key Vault Secret Url and vault id of the encryption key */ +export interface KeyVaultAndSecretReference { + /** Resource id of the KeyVault containing the key or secret */ + sourceVault: SourceVault; + /** Url pointing to a key or secret in KeyVault */ + secretUrl: string; +} + +/** Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey */ +export interface KeyVaultAndKeyReference { + /** Resource id of the KeyVault containing the key or secret */ + sourceVault: SourceVault; + /** Url pointing to a key or secret in KeyVault */ + keyUrl: string; +} + +/** Encryption at rest settings for disk or snapshot */ +export interface Encryption { + /** ResourceId of the disk encryption set to use for enabling encryption at rest. */ + diskEncryptionSetId?: string; + /** The type of key used to encrypt the data of the disk. */ + type?: EncryptionType; +} + +export interface ShareInfoElement { + /** + * A relative URI containing the ID of the VM that has the disk attached. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly vmUri?: string; +} + +/** Properties of the disk for which update is pending. */ +export interface PropertyUpdatesInProgress { + /** The target performance tier of the disk if a tier change operation is in progress. */ + targetTier?: string; +} + +/** Contains the security related information for the resource. */ +export interface DiskSecurityProfile { + /** Specifies the SecurityType of the VM. Applicable for OS disks only. */ + securityType?: DiskSecurityTypes; + /** ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer managed key */ + secureVMDiskEncryptionSetId?: string; +} + +/** In the case of an availability or connectivity issue with the data disk, specify the behavior of your VM */ +export interface AvailabilityPolicy { + /** Determines on how to handle disks with slow I/O. */ + actionOnDiskDelay?: AvailabilityPolicyDiskDelay; +} + +/** The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. */ +export interface DiskSku { + /** The sku name. */ + name?: DiskStorageAccountTypes; + /** + * The sku tier. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tier?: string; +} + +/** The List Snapshots operation response. */ +export interface SnapshotList { + /** A list of snapshots. */ + value: Snapshot[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Indicates the error details if the background copy of a resource created via the CopyStart operation fails. */ +export interface CopyCompletionError { + /** Indicates the error code if the background copy of a resource created via the CopyStart operation fails. */ + errorCode: CopyCompletionErrorReason; + /** Indicates the error message if the background copy of a resource created via the CopyStart operation fails. */ + errorMessage: string; +} + +/** The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot */ +export interface SnapshotSku { + /** The sku name. */ + name?: SnapshotStorageAccountTypes; + /** + * The sku tier. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tier?: string; +} + +/** Used for updating a disk access resource. */ +export interface DiskAccessUpdate { + /** Resource tags */ + tags?: { [propertyName: string]: string }; +} + +/** A list of private link resources */ +export interface PrivateEndpointConnectionListResult { + /** The PrivateEndpointConnection items on this page */ + value: PrivateEndpointConnection[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** Array of private link resources */ + value?: PrivateLinkResource[]; +} + +/** A private link resource */ +export interface PrivateLinkResource { + /** + * private link resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * private link resource name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * private link resource type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The private link resource group id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupId?: string; + /** + * The private link resource required member names. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredMembers?: string[]; + /** The private link resource DNS zone name. */ + requiredZoneNames?: string[]; +} + +/** disk encryption set update resource. */ +export interface DiskEncryptionSetUpdate { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. */ + identity?: EncryptionSetIdentity; + /** The type of key used to encrypt the data of the disk. */ + encryptionType?: DiskEncryptionSetType; + /** Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots */ + activeKey?: KeyForDiskEncryptionSet; + /** Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. */ + rotationToLatestKeyVersionEnabled?: boolean; + /** Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. */ + federatedClientId?: string; +} + +/** The List resources which are encrypted with the disk encryption set. */ +export interface ResourceUriList { + /** A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. */ + value: string[]; + /** The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. */ + nextLink?: string; +} + +/** Disk update resource. */ +export interface DiskUpdate { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. */ + sku?: DiskSku; + /** the Operating System type. */ + osType?: OperatingSystemTypes; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadWrite?: number; + /** The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadWrite?: number; + /** The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadOnly?: number; + /** The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadOnly?: number; + /** The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. */ + maxShares?: number; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. */ + tier?: string; + /** Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. */ + burstingEnabled?: boolean; + /** Purchase plan information to be added on the OS disk */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities to be added on the OS disk. */ + supportedCapabilities?: SupportedCapabilities; + /** + * Properties of the disk for which update is pending. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + /** Indicates the OS on a disk supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine. */ + optimizedForFrequentAttach?: boolean; + /** Determines how platform treats disk failures */ + availabilityPolicy?: AvailabilityPolicy; +} + +/** Data used for requesting a SAS. */ +export interface GrantAccessData { + /** The Access Level, accepted values include None, Read, Write. */ + access: AccessLevel; + /** Time duration in seconds until the SAS access expires. */ + durationInSeconds: number; + /** Set this flag to true to get additional SAS for VM guest state */ + getSecureVMGuestStateSAS?: boolean; + /** Used to specify the file format when making request for SAS on a VHDX file format snapshot */ + fileFormat?: FileFormat; +} + +/** A disk access SAS uri. */ +export interface AccessUri { + /** + * A SAS uri for accessing a disk. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accessSAS?: string; + /** + * A SAS uri for accessing a VM guest state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly securityDataAccessSAS?: string; + /** + * A SAS uri for accessing a VM metadata. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly securityMetadataAccessSAS?: string; +} + +/** The List Disk Restore Points operation response. */ +export interface DiskRestorePointList { + /** The DiskRestorePoint items on this page */ + value: DiskRestorePoint[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Snapshot update resource. */ +export interface SnapshotUpdate { + /** Resource tags */ + tags?: { [propertyName: string]: string }; + /** The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot */ + sku?: SnapshotSku; + /** the Operating System type. */ + osType?: OperatingSystemTypes; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Indicates the OS on a snapshot supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** List of supported capabilities for the image from which the OS disk was created. */ + supportedCapabilities?: SupportedCapabilities; + /** + * The state of snapshot which determines the access availability of the snapshot. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly snapshotAccessState?: SnapshotAccessState; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +/** The Private Endpoint Connection resource. */ +export interface PrivateEndpointConnection extends ProxyResource { + /** + * The resource of private end point. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between DiskAccess and Virtual Network. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** + * The provisioning state of the private endpoint connection resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +/** Properties of disk restore point */ +export interface DiskRestorePoint extends ProxyResource { + /** + * The timestamp of restorePoint creation + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly timeCreated?: Date; + /** + * arm id of source disk or source disk restore point. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sourceResourceId?: string; + /** + * The Operating System type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly osType?: OperatingSystemTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** Purchase plan information for the the image from which the OS disk was created. */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities for the image from which the OS disk was created. */ + supportedCapabilities?: SupportedCapabilities; + /** + * id of the backing snapshot's MIS family + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly familyId?: string; + /** + * unique incarnation id of the source disk + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sourceUniqueId?: string; + /** + * Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly encryption?: Encryption; + /** Indicates the OS on a disk supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Percentage complete for the background copy of disk restore point when source resource is from a different region. */ + completionPercent?: number; + /** + * Replication state of disk restore point when source resource is from a different region. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly replicationState?: string; + /** + * Location of source disk or source disk restore point when source resource is from a different region. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sourceResourceLocation?: string; + /** Contains the security related information for the resource. */ + securityProfile?: DiskSecurityProfile; + /** + * Logical sector size in bytes for disk restore points of UltraSSD_LRS and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the default. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly logicalSectorSize?: number; +} + +/** disk access resource. */ +export interface DiskAccess extends TrackedResource { + /** The extended location where the disk access will be created. Extended location cannot be changed. */ + extendedLocation?: ExtendedLocation; + /** + * A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** + * The disk access resource provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** + * The time when the disk access was created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly timeCreated?: Date; +} + +/** disk encryption set resource. */ +export interface DiskEncryptionSet extends TrackedResource { + /** The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. */ + identity?: EncryptionSetIdentity; + /** The type of key used to encrypt the data of the disk. */ + encryptionType?: DiskEncryptionSetType; + /** The key vault key which is currently used by this disk encryption set. */ + activeKey?: KeyForDiskEncryptionSet; + /** + * A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly previousKeys?: KeyForDiskEncryptionSet[]; + /** + * The disk encryption set provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. */ + rotationToLatestKeyVersionEnabled?: boolean; + /** + * The time when the active key of this disk encryption set was updated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastKeyRotationTimestamp?: Date; + /** + * The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly autoKeyRotationError?: ApiError; + /** Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. */ + federatedClientId?: string; +} + +/** Disk resource. */ +export interface Disk extends TrackedResource { + /** + * A relative URI containing the ID of the VM that has the disk attached. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly managedBy?: string; + /** + * List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly managedByExtended?: string[]; + /** The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. */ + sku?: DiskSku; + /** The Logical zone list for Disk. */ + zones?: string[]; + /** The extended location where the disk will be created. Extended location cannot be changed. */ + extendedLocation?: ExtendedLocation; + /** + * The time when the disk was created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly timeCreated?: Date; + /** The Operating System type. */ + osType?: OperatingSystemTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer} */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities for the image from which the OS disk was created. */ + supportedCapabilities?: SupportedCapabilities; + /** Disk source information. CreationData information cannot be changed after the disk has been created. */ + creationData?: CreationData; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** + * The size of the disk in bytes. This field is read only. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly diskSizeBytes?: number; + /** + * Unique Guid identifying the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uniqueId?: string; + /** Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** + * The disk provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadWrite?: number; + /** The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadWrite?: number; + /** The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. */ + diskIopsReadOnly?: number; + /** The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. */ + diskMBpsReadOnly?: number; + /** + * The state of the disk. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly diskState?: DiskState; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. */ + maxShares?: number; + /** + * Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly shareInfo?: ShareInfoElement[]; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** + * Latest time when bursting was last enabled on a disk. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly burstingEnabledTime?: Date; + /** Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. */ + tier?: string; + /** Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. */ + burstingEnabled?: boolean; + /** + * Properties of the disk for which update is pending. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly propertyUpdatesInProgress?: PropertyUpdatesInProgress; + /** Indicates the OS on a disk supports hibernation. */ + supportsHibernation?: boolean; + /** Contains the security related information for the resource. */ + securityProfile?: DiskSecurityProfile; + /** Percentage complete for the background copy when a resource is created via the CopyStart operation. */ + completionPercent?: number; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine. */ + optimizedForFrequentAttach?: boolean; + /** + * The UTC time when the ownership state of the disk was last changed i.e., the time the disk was last attached or detached from a VM or the time when the VM to which the disk was attached was deallocated or started. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastOwnershipUpdateTime?: Date; + /** Determines how platform treats disk failures */ + availabilityPolicy?: AvailabilityPolicy; +} + +/** Snapshot resource. */ +export interface Snapshot extends TrackedResource { + /** + * Unused. Always Null. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly managedBy?: string; + /** The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot */ + sku?: SnapshotSku; + /** The extended location where the snapshot will be created. Extended location cannot be changed. */ + extendedLocation?: ExtendedLocation; + /** + * The time when the snapshot was created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly timeCreated?: Date; + /** The Operating System type. */ + osType?: OperatingSystemTypes; + /** The hypervisor generation of the Virtual Machine. Applicable to OS disks only. */ + hyperVGeneration?: HyperVGeneration; + /** Purchase plan information for the image from which the source disk for the snapshot was originally created. */ + purchasePlan?: DiskPurchasePlan; + /** List of supported capabilities for the image from which the source disk from the snapshot was originally created. */ + supportedCapabilities?: SupportedCapabilities; + /** Disk source information. CreationData information cannot be changed after the disk has been created. */ + creationData?: CreationData; + /** If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. */ + diskSizeGB?: number; + /** + * The size of the disk in bytes. This field is read only. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly diskSizeBytes?: number; + /** + * The state of the snapshot. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly diskState?: DiskState; + /** + * Unique Guid identifying the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly uniqueId?: string; + /** Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. */ + encryptionSettingsCollection?: EncryptionSettingsCollection; + /** + * The disk provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. */ + incremental?: boolean; + /** + * Incremental snapshots for a disk share an incremental snapshot family id. The Get Page Range Diff API can only be called on incremental snapshots with the same family id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly incrementalSnapshotFamilyId?: string; + /** Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. */ + encryption?: Encryption; + /** Policy for accessing the disk via network. */ + networkAccessPolicy?: NetworkAccessPolicy; + /** ARM id of the DiskAccess resource for using private endpoints on disks. */ + diskAccessId?: string; + /** Contains the security related information for the resource. */ + securityProfile?: DiskSecurityProfile; + /** Indicates the OS on a snapshot supports hibernation. */ + supportsHibernation?: boolean; + /** Policy for controlling export on the disk. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Percentage complete for the background copy when a resource is created via the CopyStart operation. */ + completionPercent?: number; + /** Indicates the error details if the background copy of a resource created via the CopyStart operation fails. */ + copyCompletionError?: CopyCompletionError; + /** Additional authentication requirements when exporting or uploading to a disk or snapshot. */ + dataAccessAuthMode?: DataAccessAuthMode; + /** + * The state of snapshot which determines the access availability of the snapshot. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly snapshotAccessState?: SnapshotAccessState; +} + +/** Defines headers for DiskAccesses_createOrUpdate operation. */ +export interface DiskAccessesCreateOrUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for DiskAccesses_update operation. */ +export interface DiskAccessesUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for DiskAccesses_delete operation. */ +export interface DiskAccessesDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for DiskAccesses_updateAPrivateEndpointConnection operation. */ +export interface DiskAccessesUpdateAPrivateEndpointConnectionHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for DiskAccesses_deleteAPrivateEndpointConnection operation. */ +export interface DiskAccessesDeleteAPrivateEndpointConnectionHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for DiskEncryptionSets_createOrUpdate operation. */ +export interface DiskEncryptionSetsCreateOrUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for DiskEncryptionSets_update operation. */ +export interface DiskEncryptionSetsUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for DiskEncryptionSets_delete operation. */ +export interface DiskEncryptionSetsDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Disks_createOrUpdate operation. */ +export interface DisksCreateOrUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Disks_update operation. */ +export interface DisksUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Disks_delete operation. */ +export interface DisksDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Disks_grantAccess operation. */ +export interface DisksGrantAccessHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Disks_revokeAccess operation. */ +export interface DisksRevokeAccessHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Snapshots_createOrUpdate operation. */ +export interface SnapshotsCreateOrUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Snapshots_update operation. */ +export interface SnapshotsUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Snapshots_delete operation. */ +export interface SnapshotsDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Snapshots_grantAccess operation. */ +export interface SnapshotsGrantAccessHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for Snapshots_revokeAccess operation. */ +export interface SnapshotsRevokeAccessHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for DiskRestorePoint_grantAccess operation. */ +export interface DiskRestorePointGrantAccessHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for DiskRestorePoint_revokeAccess operation. */ +export interface DiskRestorePointRevokeAccessHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Rejected */ + Rejected = "Rejected", +} + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Creating */ + Creating = "Creating", + /** Deleting */ + Deleting = "Deleting", + /** Failed */ + Failed = "Failed", +} + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Deleting** \ + * **Failed** + */ +export type PrivateEndpointConnectionProvisioningState = 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", +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link ExtendedLocationTypes} that the service accepts. */ +export enum KnownExtendedLocationTypes { + /** EdgeZone */ + EdgeZone = "EdgeZone", +} + +/** + * Defines values for ExtendedLocationTypes. \ + * {@link KnownExtendedLocationTypes} can be used interchangeably with ExtendedLocationTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EdgeZone** + */ +export type ExtendedLocationTypes = string; + +/** Known values of {@link DiskEncryptionSetType} that the service accepts. */ +export enum KnownDiskEncryptionSetType { + /** Resource using diskEncryptionSet would be encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ + EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", + /** Resource using diskEncryptionSet would be encrypted at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed. */ + EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys", + /** Confidential VM supported disk and VM guest state would be encrypted with customer managed key. */ + ConfidentialVmEncryptedWithCustomerKey = "ConfidentialVmEncryptedWithCustomerKey", +} + +/** + * Defines values for DiskEncryptionSetType. \ + * {@link KnownDiskEncryptionSetType} can be used interchangeably with DiskEncryptionSetType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EncryptionAtRestWithCustomerKey**: Resource using diskEncryptionSet would be encrypted at rest with Customer managed key that can be changed and revoked by a customer. \ + * **EncryptionAtRestWithPlatformAndCustomerKeys**: Resource using diskEncryptionSet would be encrypted at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed. \ + * **ConfidentialVmEncryptedWithCustomerKey**: Confidential VM supported disk and VM guest state would be encrypted with customer managed key. + */ +export type DiskEncryptionSetType = string; + +/** Known values of {@link DiskEncryptionSetIdentityType} that the service accepts. */ +export enum KnownDiskEncryptionSetIdentityType { + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", + /** SystemAssignedUserAssigned */ + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + /** None */ + None = "None", +} + +/** + * Defines values for DiskEncryptionSetIdentityType. \ + * {@link KnownDiskEncryptionSetIdentityType} can be used interchangeably with DiskEncryptionSetIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned, UserAssigned** \ + * **None** + */ +export type DiskEncryptionSetIdentityType = string; + +/** Known values of {@link HyperVGeneration} that the service accepts. */ +export enum KnownHyperVGeneration { + /** V1 */ + V1 = "V1", + /** V2 */ + V2 = "V2", +} + +/** + * Defines values for HyperVGeneration. \ + * {@link KnownHyperVGeneration} can be used interchangeably with HyperVGeneration, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **V1** \ + * **V2** + */ +export type HyperVGeneration = string; + +/** Known values of {@link Architecture} that the service accepts. */ +export enum KnownArchitecture { + /** X64 */ + X64 = "x64", + /** Arm64 */ + Arm64 = "Arm64", +} + +/** + * Defines values for Architecture. \ + * {@link KnownArchitecture} can be used interchangeably with Architecture, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **x64** \ + * **Arm64** + */ +export type Architecture = string; + +/** Known values of {@link SupportedSecurityOption} that the service accepts. */ +export enum KnownSupportedSecurityOption { + /** The disk supports creating Trusted Launch VMs. */ + TrustedLaunchSupported = "TrustedLaunchSupported", + /** The disk supports creating both Trusted Launch and Confidential VMs. */ + TrustedLaunchAndConfidentialVMSupported = "TrustedLaunchAndConfidentialVMSupported", +} + +/** + * Defines values for SupportedSecurityOption. \ + * {@link KnownSupportedSecurityOption} can be used interchangeably with SupportedSecurityOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **TrustedLaunchSupported**: The disk supports creating Trusted Launch VMs. \ + * **TrustedLaunchAndConfidentialVMSupported**: The disk supports creating both Trusted Launch and Confidential VMs. + */ +export type SupportedSecurityOption = string; + +/** Known values of {@link DiskCreateOption} that the service accepts. */ +export enum KnownDiskCreateOption { + /** Create an empty data disk of a size given by diskSizeGB. */ + Empty = "Empty", + /** Disk will be attached to a VM. */ + Attach = "Attach", + /** Create a new disk from a platform image specified by the given imageReference or galleryImageReference. */ + FromImage = "FromImage", + /** Create a disk by importing from a blob specified by a sourceUri in a storage account specified by storageAccountId. */ + Import = "Import", + /** Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId. */ + Copy = "Copy", + /** Create a new disk by copying from a backup recovery point. */ + Restore = "Restore", + /** Create a new disk by obtaining a write token and using it to directly upload the contents of the disk. */ + Upload = "Upload", + /** Create a new disk by using a deep copy process, where the resource creation is considered complete only after all data has been copied from the source. */ + CopyStart = "CopyStart", + /** Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported disk by importing additional blobs for VM guest state specified by securityDataUri and VM metadata specified by securityMetadataUri in storage account specified by storageAccountId. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. */ + ImportSecure = "ImportSecure", + /** Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM supported disk and upload using write token in disk, VM guest state and VM metadata. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. */ + UploadPreparedSecure = "UploadPreparedSecure", + /** Create a new disk by exporting from elastic san volume snapshot */ + CopyFromSanSnapshot = "CopyFromSanSnapshot", +} + +/** + * Defines values for DiskCreateOption. \ + * {@link KnownDiskCreateOption} can be used interchangeably with DiskCreateOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Empty**: Create an empty data disk of a size given by diskSizeGB. \ + * **Attach**: Disk will be attached to a VM. \ + * **FromImage**: Create a new disk from a platform image specified by the given imageReference or galleryImageReference. \ + * **Import**: Create a disk by importing from a blob specified by a sourceUri in a storage account specified by storageAccountId. \ + * **Copy**: Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId. \ + * **Restore**: Create a new disk by copying from a backup recovery point. \ + * **Upload**: Create a new disk by obtaining a write token and using it to directly upload the contents of the disk. \ + * **CopyStart**: Create a new disk by using a deep copy process, where the resource creation is considered complete only after all data has been copied from the source. \ + * **ImportSecure**: Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported disk by importing additional blobs for VM guest state specified by securityDataUri and VM metadata specified by securityMetadataUri in storage account specified by storageAccountId. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. \ + * **UploadPreparedSecure**: Similar to Upload create option. Create a new Trusted Launch VM or Confidential VM supported disk and upload using write token in disk, VM guest state and VM metadata. The VM metadata is optional and only required for certain Confidential VM configurations and not required for Trusted Launch VM. \ + * **CopyFromSanSnapshot**: Create a new disk by exporting from elastic san volume snapshot + */ +export type DiskCreateOption = string; + +/** Known values of {@link ProvisionedBandwidthCopyOption} that the service accepts. */ +export enum KnownProvisionedBandwidthCopyOption { + /** None */ + None = "None", + /** Enhanced */ + Enhanced = "Enhanced", +} + +/** + * Defines values for ProvisionedBandwidthCopyOption. \ + * {@link KnownProvisionedBandwidthCopyOption} can be used interchangeably with ProvisionedBandwidthCopyOption, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Enhanced** + */ +export type ProvisionedBandwidthCopyOption = string; + +/** Known values of {@link DiskState} that the service accepts. */ +export enum KnownDiskState { + /** The disk is not being used and can be attached to a VM. */ + Unattached = "Unattached", + /** The disk is currently attached to a running VM. */ + Attached = "Attached", + /** The disk is attached to a stopped-deallocated VM. */ + Reserved = "Reserved", + /** The disk is attached to a VM which is in hibernated state. */ + Frozen = "Frozen", + /** The disk currently has an Active SAS Uri associated with it. */ + ActiveSAS = "ActiveSAS", + /** The disk is attached to a VM in hibernated state and has an active SAS URI associated with it. */ + ActiveSASFrozen = "ActiveSASFrozen", + /** A disk is ready to be created by upload by requesting a write token. */ + ReadyToUpload = "ReadyToUpload", + /** A disk is created for upload and a write token has been issued for uploading to it. */ + ActiveUpload = "ActiveUpload", +} + +/** + * Defines values for DiskState. \ + * {@link KnownDiskState} can be used interchangeably with DiskState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unattached**: The disk is not being used and can be attached to a VM. \ + * **Attached**: The disk is currently attached to a running VM. \ + * **Reserved**: The disk is attached to a stopped-deallocated VM. \ + * **Frozen**: The disk is attached to a VM which is in hibernated state. \ + * **ActiveSAS**: The disk currently has an Active SAS Uri associated with it. \ + * **ActiveSASFrozen**: The disk is attached to a VM in hibernated state and has an active SAS URI associated with it. \ + * **ReadyToUpload**: A disk is ready to be created by upload by requesting a write token. \ + * **ActiveUpload**: A disk is created for upload and a write token has been issued for uploading to it. + */ +export type DiskState = string; + +/** Known values of {@link EncryptionType} that the service accepts. */ +export enum KnownEncryptionType { + /** Disk is encrypted at rest with Platform managed key. It is the default encryption type. This is not a valid encryption type for disk encryption sets. */ + EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey", + /** Disk is encrypted at rest with Customer managed key that can be changed and revoked by a customer. */ + EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", + /** Disk is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and the other key is Platform managed. */ + EncryptionAtRestWithPlatformAndCustomerKeys = "EncryptionAtRestWithPlatformAndCustomerKeys", +} + +/** + * Defines values for EncryptionType. \ + * {@link KnownEncryptionType} can be used interchangeably with EncryptionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **EncryptionAtRestWithPlatformKey**: Disk is encrypted at rest with Platform managed key. It is the default encryption type. This is not a valid encryption type for disk encryption sets. \ + * **EncryptionAtRestWithCustomerKey**: Disk is encrypted at rest with Customer managed key that can be changed and revoked by a customer. \ + * **EncryptionAtRestWithPlatformAndCustomerKeys**: Disk is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and the other key is Platform managed. + */ +export type EncryptionType = string; + +/** Known values of {@link NetworkAccessPolicy} that the service accepts. */ +export enum KnownNetworkAccessPolicy { + /** The disk can be exported or uploaded to from any network. */ + AllowAll = "AllowAll", + /** The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. */ + AllowPrivate = "AllowPrivate", + /** The disk cannot be exported. */ + DenyAll = "DenyAll", +} + +/** + * Defines values for NetworkAccessPolicy. \ + * {@link KnownNetworkAccessPolicy} can be used interchangeably with NetworkAccessPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AllowAll**: The disk can be exported or uploaded to from any network. \ + * **AllowPrivate**: The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. \ + * **DenyAll**: The disk cannot be exported. + */ +export type NetworkAccessPolicy = string; + +/** Known values of {@link DiskSecurityTypes} that the service accepts. */ +export enum KnownDiskSecurityTypes { + /** Trusted Launch provides security features such as secure boot and virtual Trusted Platform Module (vTPM) */ + TrustedLaunch = "TrustedLaunch", + /** Indicates Confidential VM disk with only VM guest state encrypted */ + ConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey", + /** Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a platform managed key */ + ConfidentialVMDiskEncryptedWithPlatformKey = "ConfidentialVM_DiskEncryptedWithPlatformKey", + /** Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a customer managed key */ + ConfidentialVMDiskEncryptedWithCustomerKey = "ConfidentialVM_DiskEncryptedWithCustomerKey", + /** Indicates Confidential VM disk with a ephemeral vTPM. vTPM state is not persisted across VM reboots. */ + ConfidentialVMNonPersistedTPM = "ConfidentialVM_NonPersistedTPM", +} + +/** + * Defines values for DiskSecurityTypes. \ + * {@link KnownDiskSecurityTypes} can be used interchangeably with DiskSecurityTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **TrustedLaunch**: Trusted Launch provides security features such as secure boot and virtual Trusted Platform Module (vTPM) \ + * **ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey**: Indicates Confidential VM disk with only VM guest state encrypted \ + * **ConfidentialVM_DiskEncryptedWithPlatformKey**: Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a platform managed key \ + * **ConfidentialVM_DiskEncryptedWithCustomerKey**: Indicates Confidential VM disk with both OS disk and VM guest state encrypted with a customer managed key \ + * **ConfidentialVM_NonPersistedTPM**: Indicates Confidential VM disk with a ephemeral vTPM. vTPM state is not persisted across VM reboots. + */ +export type DiskSecurityTypes = string; + +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + /** You can generate a SAS URI to access the underlying data of the disk publicly on the internet when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. */ + Enabled = "Enabled", + /** You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. */ + Disabled = "Disabled", +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled**: You can generate a SAS URI to access the underlying data of the disk publicly on the internet when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. \ + * **Disabled**: You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. + */ +export type PublicNetworkAccess = string; + +/** Known values of {@link DataAccessAuthMode} that the service accepts. */ +export enum KnownDataAccessAuthMode { + /** When export\/upload URL is used, the system checks if the user has an identity in Azure Active Directory and has necessary permissions to export\/upload the data. Please refer to aka.ms\/DisksAzureADAuth. */ + AzureActiveDirectory = "AzureActiveDirectory", + /** No additional authentication would be performed when accessing export\/upload URL. */ + None = "None", +} + +/** + * Defines values for DataAccessAuthMode. \ + * {@link KnownDataAccessAuthMode} can be used interchangeably with DataAccessAuthMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AzureActiveDirectory**: When export\/upload URL is used, the system checks if the user has an identity in Azure Active Directory and has necessary permissions to export\/upload the data. Please refer to aka.ms\/DisksAzureADAuth. \ + * **None**: No additional authentication would be performed when accessing export\/upload URL. + */ +export type DataAccessAuthMode = string; + +/** Known values of {@link AvailabilityPolicyDiskDelay} that the service accepts. */ +export enum KnownAvailabilityPolicyDiskDelay { + /** Defaults to behavior without av policy specified, which is VM restart upon slow disk io. */ + None = "None", + /** Upon a disk io failure or slow response, try detaching then reattaching the disk. */ + AutomaticReattach = "AutomaticReattach", +} + +/** + * Defines values for AvailabilityPolicyDiskDelay. \ + * {@link KnownAvailabilityPolicyDiskDelay} can be used interchangeably with AvailabilityPolicyDiskDelay, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: Defaults to behavior without av policy specified, which is VM restart upon slow disk io. \ + * **AutomaticReattach**: Upon a disk io failure or slow response, try detaching then reattaching the disk. + */ +export type AvailabilityPolicyDiskDelay = string; + +/** Known values of {@link DiskStorageAccountTypes} that the service accepts. */ +export enum KnownDiskStorageAccountTypes { + /** Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. */ + StandardLRS = "Standard_LRS", + /** Premium SSD locally redundant storage. Best for production and performance sensitive workloads. */ + PremiumLRS = "Premium_LRS", + /** Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications and dev\/test. */ + StandardSSDLRS = "StandardSSD_LRS", + /** Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. */ + UltraSSDLRS = "UltraSSD_LRS", + /** Premium SSD zone redundant storage. Best for the production workloads that need storage resiliency against zone failures. */ + PremiumZRS = "Premium_ZRS", + /** Standard SSD zone redundant storage. Best for web servers, lightly used enterprise applications and dev\/test that need storage resiliency against zone failures. */ + StandardSSDZRS = "StandardSSD_ZRS", + /** Premium SSD v2 locally redundant storage. Best for production and performance-sensitive workloads that consistently require low latency and high IOPS and throughput. */ + PremiumV2LRS = "PremiumV2_LRS", +} + +/** + * Defines values for DiskStorageAccountTypes. \ + * {@link KnownDiskStorageAccountTypes} can be used interchangeably with DiskStorageAccountTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard_LRS**: Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. \ + * **Premium_LRS**: Premium SSD locally redundant storage. Best for production and performance sensitive workloads. \ + * **StandardSSD_LRS**: Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications and dev\/test. \ + * **UltraSSD_LRS**: Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. \ + * **Premium_ZRS**: Premium SSD zone redundant storage. Best for the production workloads that need storage resiliency against zone failures. \ + * **StandardSSD_ZRS**: Standard SSD zone redundant storage. Best for web servers, lightly used enterprise applications and dev\/test that need storage resiliency against zone failures. \ + * **PremiumV2_LRS**: Premium SSD v2 locally redundant storage. Best for production and performance-sensitive workloads that consistently require low latency and high IOPS and throughput. + */ +export type DiskStorageAccountTypes = string; + +/** Known values of {@link CopyCompletionErrorReason} that the service accepts. */ +export enum KnownCopyCompletionErrorReason { + /** Indicates that the source snapshot was deleted while the background copy of the resource created via CopyStart operation was in progress. */ + CopySourceNotFound = "CopySourceNotFound", +} + +/** + * Defines values for CopyCompletionErrorReason. \ + * {@link KnownCopyCompletionErrorReason} can be used interchangeably with CopyCompletionErrorReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CopySourceNotFound**: Indicates that the source snapshot was deleted while the background copy of the resource created via CopyStart operation was in progress. + */ +export type CopyCompletionErrorReason = string; + +/** Known values of {@link SnapshotAccessState} that the service accepts. */ +export enum KnownSnapshotAccessState { + /** Default value. */ + Unknown = "Unknown", + /** The snapshot cannot be used for restore, copy or download to offline. */ + Pending = "Pending", + /** The snapshot can be used for restore, copy to different region, and download to offline. */ + Available = "Available", + /** The snapshot can be used for restoring disks with fast performance but cannot be copied or downloaded. */ + InstantAccess = "InstantAccess", + /** The snapshot can be used for restoring disks with fast performance, copied and downloaded. */ + AvailableWithInstantAccess = "AvailableWithInstantAccess", +} + +/** + * Defines values for SnapshotAccessState. \ + * {@link KnownSnapshotAccessState} can be used interchangeably with SnapshotAccessState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown**: Default value. \ + * **Pending**: The snapshot cannot be used for restore, copy or download to offline. \ + * **Available**: The snapshot can be used for restore, copy to different region, and download to offline. \ + * **InstantAccess**: The snapshot can be used for restoring disks with fast performance but cannot be copied or downloaded. \ + * **AvailableWithInstantAccess**: The snapshot can be used for restoring disks with fast performance, copied and downloaded. + */ +export type SnapshotAccessState = string; + +/** Known values of {@link SnapshotStorageAccountTypes} that the service accepts. */ +export enum KnownSnapshotStorageAccountTypes { + /** Standard HDD locally redundant storage */ + StandardLRS = "Standard_LRS", + /** Premium SSD locally redundant storage */ + PremiumLRS = "Premium_LRS", + /** Standard zone redundant storage */ + StandardZRS = "Standard_ZRS", +} + +/** + * Defines values for SnapshotStorageAccountTypes. \ + * {@link KnownSnapshotStorageAccountTypes} can be used interchangeably with SnapshotStorageAccountTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard_LRS**: Standard HDD locally redundant storage \ + * **Premium_LRS**: Premium SSD locally redundant storage \ + * **Standard_ZRS**: Standard zone redundant storage + */ +export type SnapshotStorageAccountTypes = string; + +/** Known values of {@link AccessLevel} that the service accepts. */ +export enum KnownAccessLevel { + /** None */ + None = "None", + /** Read */ + Read = "Read", + /** Write */ + Write = "Write", +} + +/** + * Defines values for AccessLevel. \ + * {@link KnownAccessLevel} can be used interchangeably with AccessLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Read** \ + * **Write** + */ +export type AccessLevel = string; + +/** Known values of {@link FileFormat} that the service accepts. */ +export enum KnownFileFormat { + /** A VHD file is a disk image file in the Virtual Hard Disk file format. */ + VHD = "VHD", + /** A VHDX file is a disk image file in the Virtual Hard Disk v2 file format. */ + Vhdx = "VHDX", +} + +/** + * Defines values for FileFormat. \ + * {@link KnownFileFormat} can be used interchangeably with FileFormat, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **VHD**: A VHD file is a disk image file in the Virtual Hard Disk file format. \ + * **VHDX**: A VHDX file is a disk image file in the Virtual Hard Disk v2 file format. + */ +export type FileFormat = string; +/** Defines values for OperatingSystemTypes. */ +export type OperatingSystemTypes = "Windows" | "Linux"; + +/** Optional parameters. */ +export interface DiskAccessesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DiskAccessesListResponse = DiskAccessList; + +/** Optional parameters. */ +export interface DiskAccessesListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type DiskAccessesListByResourceGroupResponse = DiskAccessList; + +/** Optional parameters. */ +export interface DiskAccessesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DiskAccessesGetResponse = DiskAccess; + +/** Optional parameters. */ +export interface DiskAccessesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type DiskAccessesCreateOrUpdateResponse = DiskAccess; + +/** Optional parameters. */ +export interface DiskAccessesUpdateOptionalParams + 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 DiskAccessesUpdateResponse = DiskAccess; + +/** Optional parameters. */ +export interface DiskAccessesDeleteOptionalParams + 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 DiskAccessesListPrivateEndpointConnectionsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listPrivateEndpointConnections operation. */ +export type DiskAccessesListPrivateEndpointConnectionsResponse = + PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface DiskAccessesGetAPrivateEndpointConnectionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAPrivateEndpointConnection operation. */ +export type DiskAccessesGetAPrivateEndpointConnectionResponse = + PrivateEndpointConnection; + +/** Optional parameters. */ +export interface DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams + 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 updateAPrivateEndpointConnection operation. */ +export type DiskAccessesUpdateAPrivateEndpointConnectionResponse = + PrivateEndpointConnection; + +/** Optional parameters. */ +export interface DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams + 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 DiskAccessesGetPrivateLinkResourcesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getPrivateLinkResources operation. */ +export type DiskAccessesGetPrivateLinkResourcesResponse = + PrivateLinkResourceListResult; + +/** Optional parameters. */ +export interface DiskAccessesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type DiskAccessesListNextResponse = DiskAccessList; + +/** Optional parameters. */ +export interface DiskAccessesListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type DiskAccessesListByResourceGroupNextResponse = DiskAccessList; + +/** Optional parameters. */ +export interface DiskAccessesListPrivateEndpointConnectionsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listPrivateEndpointConnectionsNext operation. */ +export type DiskAccessesListPrivateEndpointConnectionsNextResponse = + PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface DiskEncryptionSetsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DiskEncryptionSetsListResponse = DiskEncryptionSetList; + +/** Optional parameters. */ +export interface DiskEncryptionSetsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type DiskEncryptionSetsListByResourceGroupResponse = + DiskEncryptionSetList; + +/** Optional parameters. */ +export interface DiskEncryptionSetsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DiskEncryptionSetsGetResponse = DiskEncryptionSet; + +/** Optional parameters. */ +export interface DiskEncryptionSetsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type DiskEncryptionSetsCreateOrUpdateResponse = DiskEncryptionSet; + +/** Optional parameters. */ +export interface DiskEncryptionSetsUpdateOptionalParams + 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 DiskEncryptionSetsUpdateResponse = DiskEncryptionSet; + +/** Optional parameters. */ +export interface DiskEncryptionSetsDeleteOptionalParams + 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 DiskEncryptionSetsListAssociatedResourcesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAssociatedResources operation. */ +export type DiskEncryptionSetsListAssociatedResourcesResponse = ResourceUriList; + +/** Optional parameters. */ +export interface DiskEncryptionSetsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type DiskEncryptionSetsListNextResponse = DiskEncryptionSetList; + +/** Optional parameters. */ +export interface DiskEncryptionSetsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type DiskEncryptionSetsListByResourceGroupNextResponse = + DiskEncryptionSetList; + +/** Optional parameters. */ +export interface DiskEncryptionSetsListAssociatedResourcesNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAssociatedResourcesNext operation. */ +export type DiskEncryptionSetsListAssociatedResourcesNextResponse = + ResourceUriList; + +/** Optional parameters. */ +export interface DisksListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DisksListResponse = DiskList; + +/** Optional parameters. */ +export interface DisksListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type DisksListByResourceGroupResponse = DiskList; + +/** Optional parameters. */ +export interface DisksGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DisksGetResponse = Disk; + +/** Optional parameters. */ +export interface DisksCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type DisksCreateOrUpdateResponse = Disk; + +/** Optional parameters. */ +export interface DisksUpdateOptionalParams 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 DisksUpdateResponse = Disk; + +/** Optional parameters. */ +export interface DisksDeleteOptionalParams 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 DisksGrantAccessOptionalParams + 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 grantAccess operation. */ +export type DisksGrantAccessResponse = AccessUri; + +/** Optional parameters. */ +export interface DisksRevokeAccessOptionalParams + 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 DisksListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type DisksListNextResponse = DiskList; + +/** Optional parameters. */ +export interface DisksListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type DisksListByResourceGroupNextResponse = DiskList; + +/** Optional parameters. */ +export interface SnapshotsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SnapshotsListResponse = SnapshotList; + +/** Optional parameters. */ +export interface SnapshotsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type SnapshotsListByResourceGroupResponse = SnapshotList; + +/** Optional parameters. */ +export interface SnapshotsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SnapshotsGetResponse = Snapshot; + +/** Optional parameters. */ +export interface SnapshotsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type SnapshotsCreateOrUpdateResponse = Snapshot; + +/** Optional parameters. */ +export interface SnapshotsUpdateOptionalParams + 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 SnapshotsUpdateResponse = Snapshot; + +/** Optional parameters. */ +export interface SnapshotsDeleteOptionalParams + 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 SnapshotsGrantAccessOptionalParams + 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 grantAccess operation. */ +export type SnapshotsGrantAccessResponse = AccessUri; + +/** Optional parameters. */ +export interface SnapshotsRevokeAccessOptionalParams + 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 SnapshotsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type SnapshotsListNextResponse = SnapshotList; + +/** Optional parameters. */ +export interface SnapshotsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type SnapshotsListByResourceGroupNextResponse = SnapshotList; + +/** Optional parameters. */ +export interface DiskRestorePointListByRestorePointOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByRestorePoint operation. */ +export type DiskRestorePointListByRestorePointResponse = DiskRestorePointList; + +/** Optional parameters. */ +export interface DiskRestorePointGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DiskRestorePointGetResponse = DiskRestorePoint; + +/** Optional parameters. */ +export interface DiskRestorePointGrantAccessOptionalParams + 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 grantAccess operation. */ +export type DiskRestorePointGrantAccessResponse = AccessUri; + +/** Optional parameters. */ +export interface DiskRestorePointRevokeAccessOptionalParams + 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 DiskRestorePointListByRestorePointNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByRestorePointNext operation. */ +export type DiskRestorePointListByRestorePointNextResponse = + DiskRestorePointList; + +/** Optional parameters. */ +export interface ComputeDiskClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/compute/arm-compute-disk/src/models/mappers.ts b/sdk/compute/arm-compute-disk/src/models/mappers.ts new file mode 100644 index 000000000000..cdc9ce43ff98 --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/models/mappers.ts @@ -0,0 +1,2690 @@ +// 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 type * as coreClient from "@azure/core-client"; + +export const DiskAccessList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskAccessList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DiskAccess", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + type: { + name: "String", + }, + }, + actionsRequired: { + serializedName: "actionsRequired", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + }, + }, +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String", + }, + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime", + }, + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const ExtendedLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtendedLocation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CloudError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudError", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ApiError", + }, + }, + }, + }, +}; + +export const ApiError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiError", + modelProperties: { + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApiErrorBase", + }, + }, + }, + }, + innererror: { + serializedName: "innererror", + type: { + name: "Composite", + className: "InnerError", + }, + }, + code: { + serializedName: "code", + type: { + name: "String", + }, + }, + target: { + serializedName: "target", + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ApiErrorBase: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiErrorBase", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String", + }, + }, + target: { + serializedName: "target", + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const InnerError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "InnerError", + modelProperties: { + exceptiontype: { + serializedName: "exceptiontype", + type: { + name: "String", + }, + }, + errordetail: { + serializedName: "errordetail", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DiskEncryptionSetList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskEncryptionSetList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DiskEncryptionSet", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const KeyForDiskEncryptionSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeyForDiskEncryptionSet", + modelProperties: { + sourceVault: { + serializedName: "sourceVault", + type: { + name: "Composite", + className: "SourceVault", + }, + }, + keyUrl: { + serializedName: "keyUrl", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SourceVault: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SourceVault", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const EncryptionSetIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EncryptionSetIdentity", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String", + }, + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String", + }, + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserAssignedIdentitiesValue", + }, + }, + }, + }, + }, + }, +}; + +export const UserAssignedIdentitiesValue: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentitiesValue", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String", + }, + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DiskList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Disk", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DiskPurchasePlan: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskPurchasePlan", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + publisher: { + serializedName: "publisher", + required: true, + type: { + name: "String", + }, + }, + product: { + serializedName: "product", + required: true, + type: { + name: "String", + }, + }, + promotionCode: { + serializedName: "promotionCode", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SupportedCapabilities: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SupportedCapabilities", + modelProperties: { + diskControllerTypes: { + serializedName: "diskControllerTypes", + type: { + name: "String", + }, + }, + acceleratedNetwork: { + serializedName: "acceleratedNetwork", + type: { + name: "Boolean", + }, + }, + architecture: { + serializedName: "architecture", + type: { + name: "String", + }, + }, + supportedSecurityOption: { + serializedName: "supportedSecurityOption", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CreationData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CreationData", + modelProperties: { + createOption: { + serializedName: "createOption", + required: true, + type: { + name: "String", + }, + }, + storageAccountId: { + serializedName: "storageAccountId", + type: { + name: "String", + }, + }, + imageReference: { + serializedName: "imageReference", + type: { + name: "Composite", + className: "ImageDiskReference", + }, + }, + galleryImageReference: { + serializedName: "galleryImageReference", + type: { + name: "Composite", + className: "ImageDiskReference", + }, + }, + sourceUri: { + serializedName: "sourceUri", + type: { + name: "String", + }, + }, + sourceResourceId: { + serializedName: "sourceResourceId", + type: { + name: "String", + }, + }, + sourceUniqueId: { + serializedName: "sourceUniqueId", + readOnly: true, + type: { + name: "String", + }, + }, + uploadSizeBytes: { + serializedName: "uploadSizeBytes", + type: { + name: "Number", + }, + }, + logicalSectorSize: { + serializedName: "logicalSectorSize", + type: { + name: "Number", + }, + }, + securityDataUri: { + serializedName: "securityDataUri", + type: { + name: "String", + }, + }, + securityMetadataUri: { + serializedName: "securityMetadataUri", + type: { + name: "String", + }, + }, + performancePlus: { + serializedName: "performancePlus", + type: { + name: "Boolean", + }, + }, + elasticSanResourceId: { + serializedName: "elasticSanResourceId", + type: { + name: "String", + }, + }, + provisionedBandwidthCopySpeed: { + serializedName: "provisionedBandwidthCopySpeed", + type: { + name: "String", + }, + }, + instantAccessDurationMinutes: { + constraints: { + InclusiveMinimum: 1, + }, + serializedName: "instantAccessDurationMinutes", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const ImageDiskReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ImageDiskReference", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + sharedGalleryImageId: { + serializedName: "sharedGalleryImageId", + type: { + name: "String", + }, + }, + communityGalleryImageId: { + serializedName: "communityGalleryImageId", + type: { + name: "String", + }, + }, + lun: { + serializedName: "lun", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const EncryptionSettingsCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EncryptionSettingsCollection", + modelProperties: { + enabled: { + serializedName: "enabled", + required: true, + type: { + name: "Boolean", + }, + }, + encryptionSettings: { + serializedName: "encryptionSettings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EncryptionSettingsElement", + }, + }, + }, + }, + encryptionSettingsVersion: { + serializedName: "encryptionSettingsVersion", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const EncryptionSettingsElement: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EncryptionSettingsElement", + modelProperties: { + diskEncryptionKey: { + serializedName: "diskEncryptionKey", + type: { + name: "Composite", + className: "KeyVaultAndSecretReference", + }, + }, + keyEncryptionKey: { + serializedName: "keyEncryptionKey", + type: { + name: "Composite", + className: "KeyVaultAndKeyReference", + }, + }, + }, + }, +}; + +export const KeyVaultAndSecretReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeyVaultAndSecretReference", + modelProperties: { + sourceVault: { + serializedName: "sourceVault", + type: { + name: "Composite", + className: "SourceVault", + }, + }, + secretUrl: { + serializedName: "secretUrl", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const KeyVaultAndKeyReference: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeyVaultAndKeyReference", + modelProperties: { + sourceVault: { + serializedName: "sourceVault", + type: { + name: "Composite", + className: "SourceVault", + }, + }, + keyUrl: { + serializedName: "keyUrl", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Encryption: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Encryption", + modelProperties: { + diskEncryptionSetId: { + serializedName: "diskEncryptionSetId", + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ShareInfoElement: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ShareInfoElement", + modelProperties: { + vmUri: { + serializedName: "vmUri", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PropertyUpdatesInProgress: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PropertyUpdatesInProgress", + modelProperties: { + targetTier: { + serializedName: "targetTier", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DiskSecurityProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskSecurityProfile", + modelProperties: { + securityType: { + serializedName: "securityType", + type: { + name: "String", + }, + }, + secureVMDiskEncryptionSetId: { + serializedName: "secureVMDiskEncryptionSetId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AvailabilityPolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AvailabilityPolicy", + modelProperties: { + actionOnDiskDelay: { + serializedName: "actionOnDiskDelay", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DiskSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskSku", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + tier: { + serializedName: "tier", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SnapshotList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Snapshot", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CopyCompletionError: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CopyCompletionError", + modelProperties: { + errorCode: { + serializedName: "errorCode", + required: true, + type: { + name: "String", + }, + }, + errorMessage: { + serializedName: "errorMessage", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SnapshotSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotSku", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + tier: { + serializedName: "tier", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DiskAccessUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskAccessUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource", + }, + }, + }, + }, + }, + }, +}; + +export const PrivateLinkResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + 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 DiskEncryptionSetUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskEncryptionSetUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "EncryptionSetIdentity", + }, + }, + encryptionType: { + serializedName: "properties.encryptionType", + type: { + name: "String", + }, + }, + activeKey: { + serializedName: "properties.activeKey", + type: { + name: "Composite", + className: "KeyForDiskEncryptionSet", + }, + }, + rotationToLatestKeyVersionEnabled: { + serializedName: "properties.rotationToLatestKeyVersionEnabled", + type: { + name: "Boolean", + }, + }, + federatedClientId: { + serializedName: "properties.federatedClientId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ResourceUriList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceUriList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DiskUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "DiskSku", + }, + }, + osType: { + serializedName: "properties.osType", + type: { + name: "Enum", + allowedValues: ["Windows", "Linux"], + }, + }, + diskSizeGB: { + serializedName: "properties.diskSizeGB", + type: { + name: "Number", + }, + }, + encryptionSettingsCollection: { + serializedName: "properties.encryptionSettingsCollection", + type: { + name: "Composite", + className: "EncryptionSettingsCollection", + }, + }, + diskIopsReadWrite: { + serializedName: "properties.diskIOPSReadWrite", + type: { + name: "Number", + }, + }, + diskMBpsReadWrite: { + serializedName: "properties.diskMBpsReadWrite", + type: { + name: "Number", + }, + }, + diskIopsReadOnly: { + serializedName: "properties.diskIOPSReadOnly", + type: { + name: "Number", + }, + }, + diskMBpsReadOnly: { + serializedName: "properties.diskMBpsReadOnly", + type: { + name: "Number", + }, + }, + maxShares: { + serializedName: "properties.maxShares", + type: { + name: "Number", + }, + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "Encryption", + }, + }, + networkAccessPolicy: { + serializedName: "properties.networkAccessPolicy", + type: { + name: "String", + }, + }, + diskAccessId: { + serializedName: "properties.diskAccessId", + type: { + name: "String", + }, + }, + tier: { + serializedName: "properties.tier", + type: { + name: "String", + }, + }, + burstingEnabled: { + serializedName: "properties.burstingEnabled", + type: { + name: "Boolean", + }, + }, + purchasePlan: { + serializedName: "properties.purchasePlan", + type: { + name: "Composite", + className: "DiskPurchasePlan", + }, + }, + supportedCapabilities: { + serializedName: "properties.supportedCapabilities", + type: { + name: "Composite", + className: "SupportedCapabilities", + }, + }, + propertyUpdatesInProgress: { + serializedName: "properties.propertyUpdatesInProgress", + type: { + name: "Composite", + className: "PropertyUpdatesInProgress", + }, + }, + supportsHibernation: { + serializedName: "properties.supportsHibernation", + type: { + name: "Boolean", + }, + }, + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + type: { + name: "String", + }, + }, + dataAccessAuthMode: { + serializedName: "properties.dataAccessAuthMode", + type: { + name: "String", + }, + }, + optimizedForFrequentAttach: { + serializedName: "properties.optimizedForFrequentAttach", + type: { + name: "Boolean", + }, + }, + availabilityPolicy: { + serializedName: "properties.availabilityPolicy", + type: { + name: "Composite", + className: "AvailabilityPolicy", + }, + }, + }, + }, +}; + +export const GrantAccessData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GrantAccessData", + modelProperties: { + access: { + serializedName: "access", + required: true, + type: { + name: "String", + }, + }, + durationInSeconds: { + serializedName: "durationInSeconds", + required: true, + type: { + name: "Number", + }, + }, + getSecureVMGuestStateSAS: { + serializedName: "getSecureVMGuestStateSAS", + type: { + name: "Boolean", + }, + }, + fileFormat: { + serializedName: "fileFormat", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AccessUri: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessUri", + modelProperties: { + accessSAS: { + serializedName: "accessSAS", + readOnly: true, + type: { + name: "String", + }, + }, + securityDataAccessSAS: { + serializedName: "securityDataAccessSAS", + readOnly: true, + type: { + name: "String", + }, + }, + securityMetadataAccessSAS: { + serializedName: "securityMetadataAccessSAS", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DiskRestorePointList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskRestorePointList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DiskRestorePoint", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const SnapshotUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "SnapshotSku", + }, + }, + osType: { + serializedName: "properties.osType", + type: { + name: "Enum", + allowedValues: ["Windows", "Linux"], + }, + }, + diskSizeGB: { + serializedName: "properties.diskSizeGB", + type: { + name: "Number", + }, + }, + encryptionSettingsCollection: { + serializedName: "properties.encryptionSettingsCollection", + type: { + name: "Composite", + className: "EncryptionSettingsCollection", + }, + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "Encryption", + }, + }, + networkAccessPolicy: { + serializedName: "properties.networkAccessPolicy", + type: { + name: "String", + }, + }, + diskAccessId: { + serializedName: "properties.diskAccessId", + type: { + name: "String", + }, + }, + supportsHibernation: { + serializedName: "properties.supportsHibernation", + type: { + name: "Boolean", + }, + }, + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + type: { + name: "String", + }, + }, + dataAccessAuthMode: { + serializedName: "properties.dataAccessAuthMode", + type: { + name: "String", + }, + }, + supportedCapabilities: { + serializedName: "properties.supportedCapabilities", + type: { + name: "Composite", + className: "SupportedCapabilities", + }, + }, + snapshotAccessState: { + serializedName: "properties.snapshotAccessState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, +}; + +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 PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...ProxyResource.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 DiskRestorePoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskRestorePoint", + modelProperties: { + ...ProxyResource.type.modelProperties, + timeCreated: { + serializedName: "properties.timeCreated", + readOnly: true, + type: { + name: "DateTime", + }, + }, + sourceResourceId: { + serializedName: "properties.sourceResourceId", + readOnly: true, + type: { + name: "String", + }, + }, + osType: { + serializedName: "properties.osType", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Windows", "Linux"], + }, + }, + hyperVGeneration: { + serializedName: "properties.hyperVGeneration", + type: { + name: "String", + }, + }, + purchasePlan: { + serializedName: "properties.purchasePlan", + type: { + name: "Composite", + className: "DiskPurchasePlan", + }, + }, + supportedCapabilities: { + serializedName: "properties.supportedCapabilities", + type: { + name: "Composite", + className: "SupportedCapabilities", + }, + }, + familyId: { + serializedName: "properties.familyId", + readOnly: true, + type: { + name: "String", + }, + }, + sourceUniqueId: { + serializedName: "properties.sourceUniqueId", + readOnly: true, + type: { + name: "String", + }, + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "Encryption", + }, + }, + supportsHibernation: { + serializedName: "properties.supportsHibernation", + type: { + name: "Boolean", + }, + }, + networkAccessPolicy: { + serializedName: "properties.networkAccessPolicy", + type: { + name: "String", + }, + }, + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + type: { + name: "String", + }, + }, + diskAccessId: { + serializedName: "properties.diskAccessId", + type: { + name: "String", + }, + }, + completionPercent: { + serializedName: "properties.completionPercent", + type: { + name: "Number", + }, + }, + replicationState: { + serializedName: "properties.replicationState", + readOnly: true, + type: { + name: "String", + }, + }, + sourceResourceLocation: { + serializedName: "properties.sourceResourceLocation", + readOnly: true, + type: { + name: "String", + }, + }, + securityProfile: { + serializedName: "properties.securityProfile", + type: { + name: "Composite", + className: "DiskSecurityProfile", + }, + }, + logicalSectorSize: { + serializedName: "properties.logicalSectorSize", + readOnly: true, + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DiskAccess: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskAccess", + modelProperties: { + ...TrackedResource.type.modelProperties, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation", + }, + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + }, + }, + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + timeCreated: { + serializedName: "properties.timeCreated", + readOnly: true, + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const DiskEncryptionSet: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskEncryptionSet", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "EncryptionSetIdentity", + }, + }, + encryptionType: { + serializedName: "properties.encryptionType", + type: { + name: "String", + }, + }, + activeKey: { + serializedName: "properties.activeKey", + type: { + name: "Composite", + className: "KeyForDiskEncryptionSet", + }, + }, + previousKeys: { + serializedName: "properties.previousKeys", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyForDiskEncryptionSet", + }, + }, + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + rotationToLatestKeyVersionEnabled: { + serializedName: "properties.rotationToLatestKeyVersionEnabled", + type: { + name: "Boolean", + }, + }, + lastKeyRotationTimestamp: { + serializedName: "properties.lastKeyRotationTimestamp", + readOnly: true, + type: { + name: "DateTime", + }, + }, + autoKeyRotationError: { + serializedName: "properties.autoKeyRotationError", + type: { + name: "Composite", + className: "ApiError", + }, + }, + federatedClientId: { + serializedName: "properties.federatedClientId", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Disk: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Disk", + modelProperties: { + ...TrackedResource.type.modelProperties, + managedBy: { + serializedName: "managedBy", + readOnly: true, + type: { + name: "String", + }, + }, + managedByExtended: { + serializedName: "managedByExtended", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "DiskSku", + }, + }, + zones: { + serializedName: "zones", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation", + }, + }, + timeCreated: { + serializedName: "properties.timeCreated", + readOnly: true, + type: { + name: "DateTime", + }, + }, + osType: { + serializedName: "properties.osType", + type: { + name: "Enum", + allowedValues: ["Windows", "Linux"], + }, + }, + hyperVGeneration: { + serializedName: "properties.hyperVGeneration", + type: { + name: "String", + }, + }, + purchasePlan: { + serializedName: "properties.purchasePlan", + type: { + name: "Composite", + className: "DiskPurchasePlan", + }, + }, + supportedCapabilities: { + serializedName: "properties.supportedCapabilities", + type: { + name: "Composite", + className: "SupportedCapabilities", + }, + }, + creationData: { + serializedName: "properties.creationData", + type: { + name: "Composite", + className: "CreationData", + }, + }, + diskSizeGB: { + serializedName: "properties.diskSizeGB", + type: { + name: "Number", + }, + }, + diskSizeBytes: { + serializedName: "properties.diskSizeBytes", + readOnly: true, + type: { + name: "Number", + }, + }, + uniqueId: { + serializedName: "properties.uniqueId", + readOnly: true, + type: { + name: "String", + }, + }, + encryptionSettingsCollection: { + serializedName: "properties.encryptionSettingsCollection", + type: { + name: "Composite", + className: "EncryptionSettingsCollection", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + diskIopsReadWrite: { + serializedName: "properties.diskIOPSReadWrite", + type: { + name: "Number", + }, + }, + diskMBpsReadWrite: { + serializedName: "properties.diskMBpsReadWrite", + type: { + name: "Number", + }, + }, + diskIopsReadOnly: { + serializedName: "properties.diskIOPSReadOnly", + type: { + name: "Number", + }, + }, + diskMBpsReadOnly: { + serializedName: "properties.diskMBpsReadOnly", + type: { + name: "Number", + }, + }, + diskState: { + serializedName: "properties.diskState", + readOnly: true, + type: { + name: "String", + }, + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "Encryption", + }, + }, + maxShares: { + serializedName: "properties.maxShares", + type: { + name: "Number", + }, + }, + shareInfo: { + serializedName: "properties.shareInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ShareInfoElement", + }, + }, + }, + }, + networkAccessPolicy: { + serializedName: "properties.networkAccessPolicy", + type: { + name: "String", + }, + }, + diskAccessId: { + serializedName: "properties.diskAccessId", + type: { + name: "String", + }, + }, + burstingEnabledTime: { + serializedName: "properties.burstingEnabledTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + tier: { + serializedName: "properties.tier", + type: { + name: "String", + }, + }, + burstingEnabled: { + serializedName: "properties.burstingEnabled", + type: { + name: "Boolean", + }, + }, + propertyUpdatesInProgress: { + serializedName: "properties.propertyUpdatesInProgress", + type: { + name: "Composite", + className: "PropertyUpdatesInProgress", + }, + }, + supportsHibernation: { + serializedName: "properties.supportsHibernation", + type: { + name: "Boolean", + }, + }, + securityProfile: { + serializedName: "properties.securityProfile", + type: { + name: "Composite", + className: "DiskSecurityProfile", + }, + }, + completionPercent: { + serializedName: "properties.completionPercent", + type: { + name: "Number", + }, + }, + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + type: { + name: "String", + }, + }, + dataAccessAuthMode: { + serializedName: "properties.dataAccessAuthMode", + type: { + name: "String", + }, + }, + optimizedForFrequentAttach: { + serializedName: "properties.optimizedForFrequentAttach", + type: { + name: "Boolean", + }, + }, + lastOwnershipUpdateTime: { + serializedName: "properties.LastOwnershipUpdateTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + availabilityPolicy: { + serializedName: "properties.availabilityPolicy", + type: { + name: "Composite", + className: "AvailabilityPolicy", + }, + }, + }, + }, +}; + +export const Snapshot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Snapshot", + modelProperties: { + ...TrackedResource.type.modelProperties, + managedBy: { + serializedName: "managedBy", + readOnly: true, + type: { + name: "String", + }, + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "SnapshotSku", + }, + }, + extendedLocation: { + serializedName: "extendedLocation", + type: { + name: "Composite", + className: "ExtendedLocation", + }, + }, + timeCreated: { + serializedName: "properties.timeCreated", + readOnly: true, + type: { + name: "DateTime", + }, + }, + osType: { + serializedName: "properties.osType", + type: { + name: "Enum", + allowedValues: ["Windows", "Linux"], + }, + }, + hyperVGeneration: { + serializedName: "properties.hyperVGeneration", + type: { + name: "String", + }, + }, + purchasePlan: { + serializedName: "properties.purchasePlan", + type: { + name: "Composite", + className: "DiskPurchasePlan", + }, + }, + supportedCapabilities: { + serializedName: "properties.supportedCapabilities", + type: { + name: "Composite", + className: "SupportedCapabilities", + }, + }, + creationData: { + serializedName: "properties.creationData", + type: { + name: "Composite", + className: "CreationData", + }, + }, + diskSizeGB: { + serializedName: "properties.diskSizeGB", + type: { + name: "Number", + }, + }, + diskSizeBytes: { + serializedName: "properties.diskSizeBytes", + readOnly: true, + type: { + name: "Number", + }, + }, + diskState: { + serializedName: "properties.diskState", + readOnly: true, + type: { + name: "String", + }, + }, + uniqueId: { + serializedName: "properties.uniqueId", + readOnly: true, + type: { + name: "String", + }, + }, + encryptionSettingsCollection: { + serializedName: "properties.encryptionSettingsCollection", + type: { + name: "Composite", + className: "EncryptionSettingsCollection", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + incremental: { + serializedName: "properties.incremental", + type: { + name: "Boolean", + }, + }, + incrementalSnapshotFamilyId: { + serializedName: "properties.incrementalSnapshotFamilyId", + readOnly: true, + type: { + name: "String", + }, + }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "Encryption", + }, + }, + networkAccessPolicy: { + serializedName: "properties.networkAccessPolicy", + type: { + name: "String", + }, + }, + diskAccessId: { + serializedName: "properties.diskAccessId", + type: { + name: "String", + }, + }, + securityProfile: { + serializedName: "properties.securityProfile", + type: { + name: "Composite", + className: "DiskSecurityProfile", + }, + }, + supportsHibernation: { + serializedName: "properties.supportsHibernation", + type: { + name: "Boolean", + }, + }, + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + type: { + name: "String", + }, + }, + completionPercent: { + serializedName: "properties.completionPercent", + type: { + name: "Number", + }, + }, + copyCompletionError: { + serializedName: "properties.copyCompletionError", + type: { + name: "Composite", + className: "CopyCompletionError", + }, + }, + dataAccessAuthMode: { + serializedName: "properties.dataAccessAuthMode", + type: { + name: "String", + }, + }, + snapshotAccessState: { + serializedName: "properties.snapshotAccessState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DiskAccessesCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskAccessesCreateOrUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DiskAccessesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskAccessesUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DiskAccessesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskAccessesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DiskAccessesUpdateAPrivateEndpointConnectionHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DiskAccessesUpdateAPrivateEndpointConnectionHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const DiskAccessesDeleteAPrivateEndpointConnectionHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DiskAccessesDeleteAPrivateEndpointConnectionHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const DiskEncryptionSetsCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DiskEncryptionSetsCreateOrUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const DiskEncryptionSetsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskEncryptionSetsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DiskEncryptionSetsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskEncryptionSetsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DisksCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DisksCreateOrUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DisksUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DisksUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DisksDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DisksDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DisksGrantAccessHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DisksGrantAccessHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DisksRevokeAccessHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DisksRevokeAccessHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const SnapshotsCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotsCreateOrUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const SnapshotsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const SnapshotsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const SnapshotsGrantAccessHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotsGrantAccessHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const SnapshotsRevokeAccessHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SnapshotsRevokeAccessHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DiskRestorePointGrantAccessHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskRestorePointGrantAccessHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const DiskRestorePointRevokeAccessHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiskRestorePointRevokeAccessHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; diff --git a/sdk/compute/arm-compute-disk/src/models/parameters.ts b/sdk/compute/arm-compute-disk/src/models/parameters.ts new file mode 100644 index 000000000000..283557613fa1 --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/models/parameters.ts @@ -0,0 +1,250 @@ +// 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 type { + OperationParameter, + OperationURLParameter, + OperationQueryParameter, +} from "@azure/core-client"; +import { + DiskAccess as DiskAccessMapper, + DiskAccessUpdate as DiskAccessUpdateMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper, + DiskEncryptionSet as DiskEncryptionSetMapper, + DiskEncryptionSetUpdate as DiskEncryptionSetUpdateMapper, + Disk as DiskMapper, + DiskUpdate as DiskUpdateMapper, + GrantAccessData as GrantAccessDataMapper, + Snapshot as SnapshotMapper, + SnapshotUpdate as SnapshotUpdateMapper, +} from "../models/mappers.js"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String", + }, + }, +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2025-01-02", + isConstant: true, + serializedName: "api-version", + type: { + name: "String", + }, + }, +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + constraints: { + MinLength: 1, + }, + serializedName: "subscriptionId", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1, + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const diskAccessName: OperationURLParameter = { + parameterPath: "diskAccessName", + mapper: { + serializedName: "diskAccessName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const diskAccess: OperationParameter = { + parameterPath: "diskAccess", + mapper: DiskAccessMapper, +}; + +export const diskAccess1: OperationParameter = { + parameterPath: "diskAccess", + mapper: DiskAccessUpdateMapper, +}; + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + serializedName: "privateEndpointConnectionName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const privateEndpointConnection: OperationParameter = { + parameterPath: "privateEndpointConnection", + mapper: PrivateEndpointConnectionMapper, +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const diskEncryptionSetName: OperationURLParameter = { + parameterPath: "diskEncryptionSetName", + mapper: { + serializedName: "diskEncryptionSetName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const diskEncryptionSet: OperationParameter = { + parameterPath: "diskEncryptionSet", + mapper: DiskEncryptionSetMapper, +}; + +export const diskEncryptionSet1: OperationParameter = { + parameterPath: "diskEncryptionSet", + mapper: DiskEncryptionSetUpdateMapper, +}; + +export const diskName: OperationURLParameter = { + parameterPath: "diskName", + mapper: { + serializedName: "diskName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const disk: OperationParameter = { + parameterPath: "disk", + mapper: DiskMapper, +}; + +export const disk1: OperationParameter = { + parameterPath: "disk", + mapper: DiskUpdateMapper, +}; + +export const grantAccessData: OperationParameter = { + parameterPath: "grantAccessData", + mapper: GrantAccessDataMapper, +}; + +export const snapshotName: OperationURLParameter = { + parameterPath: "snapshotName", + mapper: { + serializedName: "snapshotName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const snapshot: OperationParameter = { + parameterPath: "snapshot", + mapper: SnapshotMapper, +}; + +export const snapshot1: OperationParameter = { + parameterPath: "snapshot", + mapper: SnapshotUpdateMapper, +}; + +export const restorePointCollectionName: OperationURLParameter = { + parameterPath: "restorePointCollectionName", + mapper: { + serializedName: "restorePointCollectionName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const vmRestorePointName: OperationURLParameter = { + parameterPath: "vmRestorePointName", + mapper: { + serializedName: "vmRestorePointName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const diskRestorePointName: OperationURLParameter = { + parameterPath: "diskRestorePointName", + mapper: { + serializedName: "diskRestorePointName", + required: true, + type: { + name: "String", + }, + }, +}; diff --git a/sdk/compute/arm-compute-disk/src/operations/diskAccesses.ts b/sdk/compute/arm-compute-disk/src/operations/diskAccesses.ts new file mode 100644 index 000000000000..ac32736be9ed --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operations/diskAccesses.ts @@ -0,0 +1,1259 @@ +// 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { DiskAccesses } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ComputeDiskClient } from "../computeDiskClient.js"; +import type { + SimplePollerLike, + OperationState} from "@azure/core-lro"; +import { + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import type { + DiskAccess, + DiskAccessesListNextOptionalParams, + DiskAccessesListOptionalParams, + DiskAccessesListResponse, + DiskAccessesListByResourceGroupNextOptionalParams, + DiskAccessesListByResourceGroupOptionalParams, + DiskAccessesListByResourceGroupResponse, + PrivateEndpointConnection, + DiskAccessesListPrivateEndpointConnectionsNextOptionalParams, + DiskAccessesListPrivateEndpointConnectionsOptionalParams, + DiskAccessesListPrivateEndpointConnectionsResponse, + DiskAccessesGetOptionalParams, + DiskAccessesGetResponse, + DiskAccessesCreateOrUpdateOptionalParams, + DiskAccessesCreateOrUpdateResponse, + DiskAccessUpdate, + DiskAccessesUpdateOptionalParams, + DiskAccessesUpdateResponse, + DiskAccessesDeleteOptionalParams, + DiskAccessesGetAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetAPrivateEndpointConnectionResponse, + DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + DiskAccessesUpdateAPrivateEndpointConnectionResponse, + DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetPrivateLinkResourcesOptionalParams, + DiskAccessesGetPrivateLinkResourcesResponse, + DiskAccessesListNextResponse, + DiskAccessesListByResourceGroupNextResponse, + DiskAccessesListPrivateEndpointConnectionsNextResponse, +} from "../models/index.js"; + +/// +/** Class containing DiskAccesses operations. */ +export class DiskAccessesImpl implements DiskAccesses { + private readonly client: ComputeDiskClient; + + /** + * Initialize a new instance of the class DiskAccesses class. + * @param client Reference to the service client + */ + constructor(client: ComputeDiskClient) { + this.client = client; + } + + /** + * Lists all the disk access resources under a subscription. + * @param options The options parameters. + */ + public list( + options?: DiskAccessesListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: DiskAccessesListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DiskAccessesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: DiskAccessesListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all the disk access resources under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: DiskAccessesListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: DiskAccessesListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DiskAccessesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: DiskAccessesListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options, + )) { + yield* page; + } + } + + /** + * List information about private endpoint connections under a disk access resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + public listPrivateEndpointConnections( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPrivateEndpointConnectionsPagingAll( + resourceGroupName, + diskAccessName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPrivateEndpointConnectionsPagingPage( + resourceGroupName, + diskAccessName, + options, + settings, + ); + }, + }; + } + + private async *listPrivateEndpointConnectionsPagingPage( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DiskAccessesListPrivateEndpointConnectionsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listPrivateEndpointConnections( + resourceGroupName, + diskAccessName, + options, + ); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listPrivateEndpointConnectionsNext( + resourceGroupName, + diskAccessName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPrivateEndpointConnectionsPagingAll( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPrivateEndpointConnectionsPagingPage( + resourceGroupName, + diskAccessName, + options, + )) { + yield* page; + } + } + + /** + * Lists all the disk access resources under a subscription. + * @param options The options parameters. + */ + private _list( + options?: DiskAccessesListOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Lists all the disk access resources under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: DiskAccessesListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + + /** + * Gets information about a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, diskAccessName, options }, + getOperationSpec, + ); + } + + /** + * Creates or updates a disk access resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options?: DiskAccessesCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskAccessesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, diskAccessName, diskAccess, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + DiskAccessesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a disk access resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options?: DiskAccessesCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + diskAccessName, + diskAccess, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Updates (patches) a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options?: DiskAccessesUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskAccessesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, diskAccessName, diskAccess, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + DiskAccessesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Updates (patches) a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options?: DiskAccessesUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + diskAccessName, + diskAccess, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesDeleteOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, diskAccessName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + diskAccessName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * List information about private endpoint connections under a disk access resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + private _listPrivateEndpointConnections( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, diskAccessName, options }, + listPrivateEndpointConnectionsOperationSpec, + ); + } + + /** + * Gets information about a private endpoint connection under a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + getAPrivateEndpointConnection( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesGetAPrivateEndpointConnectionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + options, + }, + getAPrivateEndpointConnectionOperationSpec, + ); + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to + * create a new private endpoint connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put + * private endpoint connection operation. + * @param options The options parameters. + */ + async beginUpdateAPrivateEndpointConnection( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskAccessesUpdateAPrivateEndpointConnectionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + privateEndpointConnection, + options, + }, + spec: updateAPrivateEndpointConnectionOperationSpec, + }); + const poller = await createHttpPoller< + DiskAccessesUpdateAPrivateEndpointConnectionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to + * create a new private endpoint connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put + * private endpoint connection operation. + * @param options The options parameters. + */ + async beginUpdateAPrivateEndpointConnectionAndWait( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + ): Promise { + const poller = await this.beginUpdateAPrivateEndpointConnection( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + privateEndpointConnection, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + async beginDeleteAPrivateEndpointConnection( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + options, + }, + spec: deleteAPrivateEndpointConnectionOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a private endpoint connection under a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + async beginDeleteAPrivateEndpointConnectionAndWait( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + ): Promise { + const poller = await this.beginDeleteAPrivateEndpointConnection( + resourceGroupName, + diskAccessName, + privateEndpointConnectionName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Gets the private link resources possible under disk access resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + getPrivateLinkResources( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesGetPrivateLinkResourcesOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, diskAccessName, options }, + getPrivateLinkResourcesOperationSpec, + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: DiskAccessesListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DiskAccessesListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, + ); + } + + /** + * ListPrivateEndpointConnectionsNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param nextLink The nextLink from the previous successful call to the ListPrivateEndpointConnections + * method. + * @param options The options parameters. + */ + private _listPrivateEndpointConnectionsNext( + resourceGroupName: string, + diskAccessName: string, + nextLink: string, + options?: DiskAccessesListPrivateEndpointConnectionsNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, diskAccessName, nextLink, options }, + listPrivateEndpointConnectionsNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskAccessList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskAccessList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskAccess, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskAccessName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DiskAccess, + }, + 201: { + bodyMapper: Mappers.DiskAccess, + }, + 202: { + bodyMapper: Mappers.DiskAccess, + }, + 204: { + bodyMapper: Mappers.DiskAccess, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.diskAccess, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskAccessName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DiskAccess, + }, + 201: { + bodyMapper: Mappers.DiskAccess, + }, + 202: { + bodyMapper: Mappers.DiskAccess, + }, + 204: { + bodyMapper: Mappers.DiskAccess, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.diskAccess1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskAccessName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskAccessName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listPrivateEndpointConnectionsOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskAccessName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getAPrivateEndpointConnectionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskAccessName, + Parameters.privateEndpointConnectionName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const updateAPrivateEndpointConnectionOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection, + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection, + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection, + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.privateEndpointConnection, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskAccessName, + Parameters.privateEndpointConnectionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; +const deleteAPrivateEndpointConnectionOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskAccessName, + Parameters.privateEndpointConnectionName, + ], + headerParameters: [Parameters.accept], + serializer, + }; +const getPrivateLinkResourcesOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privatelinkresources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskAccessName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskAccessList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskAccessList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listPrivateEndpointConnectionsNextOperationSpec: coreClient.OperationSpec = + { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskAccessName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, + }; diff --git a/sdk/compute/arm-compute-disk/src/operations/diskEncryptionSets.ts b/sdk/compute/arm-compute-disk/src/operations/diskEncryptionSets.ts new file mode 100644 index 000000000000..cd4cb1b8df6e --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operations/diskEncryptionSets.ts @@ -0,0 +1,908 @@ +// 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { DiskEncryptionSets } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ComputeDiskClient } from "../computeDiskClient.js"; +import type { + SimplePollerLike, + OperationState} from "@azure/core-lro"; +import { + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import type { + DiskEncryptionSet, + DiskEncryptionSetsListNextOptionalParams, + DiskEncryptionSetsListOptionalParams, + DiskEncryptionSetsListResponse, + DiskEncryptionSetsListByResourceGroupNextOptionalParams, + DiskEncryptionSetsListByResourceGroupOptionalParams, + DiskEncryptionSetsListByResourceGroupResponse, + DiskEncryptionSetsListAssociatedResourcesNextOptionalParams, + DiskEncryptionSetsListAssociatedResourcesOptionalParams, + DiskEncryptionSetsListAssociatedResourcesResponse, + DiskEncryptionSetsGetOptionalParams, + DiskEncryptionSetsGetResponse, + DiskEncryptionSetsCreateOrUpdateOptionalParams, + DiskEncryptionSetsCreateOrUpdateResponse, + DiskEncryptionSetUpdate, + DiskEncryptionSetsUpdateOptionalParams, + DiskEncryptionSetsUpdateResponse, + DiskEncryptionSetsDeleteOptionalParams, + DiskEncryptionSetsListNextResponse, + DiskEncryptionSetsListByResourceGroupNextResponse, + DiskEncryptionSetsListAssociatedResourcesNextResponse, +} from "../models/index.js"; + +/// +/** Class containing DiskEncryptionSets operations. */ +export class DiskEncryptionSetsImpl implements DiskEncryptionSets { + private readonly client: ComputeDiskClient; + + /** + * Initialize a new instance of the class DiskEncryptionSets class. + * @param client Reference to the service client + */ + constructor(client: ComputeDiskClient) { + this.client = client; + } + + /** + * Lists all the disk encryption sets under a subscription. + * @param options The options parameters. + */ + public list( + options?: DiskEncryptionSetsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: DiskEncryptionSetsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DiskEncryptionSetsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: DiskEncryptionSetsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all the disk encryption sets under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: DiskEncryptionSetsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: DiskEncryptionSetsListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DiskEncryptionSetsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: DiskEncryptionSetsListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options, + )) { + yield* page; + } + } + + /** + * Lists all resources that are encrypted with this disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + public listAssociatedResources( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listAssociatedResourcesPagingAll( + resourceGroupName, + diskEncryptionSetName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAssociatedResourcesPagingPage( + resourceGroupName, + diskEncryptionSetName, + options, + settings, + ); + }, + }; + } + + private async *listAssociatedResourcesPagingPage( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DiskEncryptionSetsListAssociatedResourcesResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAssociatedResources( + resourceGroupName, + diskEncryptionSetName, + options, + ); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listAssociatedResourcesNext( + resourceGroupName, + diskEncryptionSetName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listAssociatedResourcesPagingAll( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listAssociatedResourcesPagingPage( + resourceGroupName, + diskEncryptionSetName, + options, + )) { + yield* page; + } + } + + /** + * Lists all the disk encryption sets under a subscription. + * @param options The options parameters. + */ + private _list( + options?: DiskEncryptionSetsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Lists all the disk encryption sets under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: DiskEncryptionSetsListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + + /** + * Gets information about a disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, diskEncryptionSetName, options }, + getOperationSpec, + ); + } + + /** + * Creates or updates a disk encryption set + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption + * set operation. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskEncryptionSetsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + DiskEncryptionSetsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a disk encryption set + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption + * set operation. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Updates (patches) a disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk + * encryption set operation. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options?: DiskEncryptionSetsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskEncryptionSetsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + DiskEncryptionSetsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Updates (patches) a disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk + * encryption set operation. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options?: DiskEncryptionSetsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + diskEncryptionSetName, + diskEncryptionSet, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsDeleteOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, diskEncryptionSetName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + diskEncryptionSetName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Lists all resources that are encrypted with this disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + private _listAssociatedResources( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, diskEncryptionSetName, options }, + listAssociatedResourcesOperationSpec, + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: DiskEncryptionSetsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DiskEncryptionSetsListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, + ); + } + + /** + * ListAssociatedResourcesNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param nextLink The nextLink from the previous successful call to the ListAssociatedResources + * method. + * @param options The options parameters. + */ + private _listAssociatedResourcesNext( + resourceGroupName: string, + diskEncryptionSetName: string, + nextLink: string, + options?: DiskEncryptionSetsListAssociatedResourcesNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, diskEncryptionSetName, nextLink, options }, + listAssociatedResourcesNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskEncryptionSetList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskEncryptionSetList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskEncryptionSet, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskEncryptionSetName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DiskEncryptionSet, + }, + 201: { + bodyMapper: Mappers.DiskEncryptionSet, + }, + 202: { + bodyMapper: Mappers.DiskEncryptionSet, + }, + 204: { + bodyMapper: Mappers.DiskEncryptionSet, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.diskEncryptionSet, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskEncryptionSetName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.DiskEncryptionSet, + }, + 201: { + bodyMapper: Mappers.DiskEncryptionSet, + }, + 202: { + bodyMapper: Mappers.DiskEncryptionSet, + }, + 204: { + bodyMapper: Mappers.DiskEncryptionSet, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.diskEncryptionSet1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskEncryptionSetName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskEncryptionSetName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listAssociatedResourcesOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceUriList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskEncryptionSetName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskEncryptionSetList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskEncryptionSetList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listAssociatedResourcesNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ResourceUriList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.diskEncryptionSetName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/compute/arm-compute-disk/src/operations/diskRestorePointOperations.ts b/sdk/compute/arm-compute-disk/src/operations/diskRestorePointOperations.ts new file mode 100644 index 000000000000..46a46380eb92 --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operations/diskRestorePointOperations.ts @@ -0,0 +1,566 @@ +// 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { DiskRestorePointOperations } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ComputeDiskClient } from "../computeDiskClient.js"; +import type { + SimplePollerLike, + OperationState} from "@azure/core-lro"; +import { + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import type { + DiskRestorePoint, + DiskRestorePointListByRestorePointNextOptionalParams, + DiskRestorePointListByRestorePointOptionalParams, + DiskRestorePointListByRestorePointResponse, + DiskRestorePointGetOptionalParams, + DiskRestorePointGetResponse, + GrantAccessData, + DiskRestorePointGrantAccessOptionalParams, + DiskRestorePointGrantAccessResponse, + DiskRestorePointRevokeAccessOptionalParams, + DiskRestorePointListByRestorePointNextResponse, +} from "../models/index.js"; + +/// +/** Class containing DiskRestorePointOperations operations. */ +export class DiskRestorePointOperationsImpl + implements DiskRestorePointOperations +{ + private readonly client: ComputeDiskClient; + + /** + * Initialize a new instance of the class DiskRestorePointOperations class. + * @param client Reference to the service client + */ + constructor(client: ComputeDiskClient) { + this.client = client; + } + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param options The options parameters. + */ + public listByRestorePoint( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + options?: DiskRestorePointListByRestorePointOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByRestorePointPagingAll( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByRestorePointPagingPage( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + options, + settings, + ); + }, + }; + } + + private async *listByRestorePointPagingPage( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + options?: DiskRestorePointListByRestorePointOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DiskRestorePointListByRestorePointResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByRestorePoint( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + options, + ); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByRestorePointNext( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByRestorePointPagingAll( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + options?: DiskRestorePointListByRestorePointOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByRestorePointPagingPage( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + options, + )) { + yield* page; + } + } + + /** + * Lists diskRestorePoints under a vmRestorePoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param options The options parameters. + */ + private _listByRestorePoint( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + options?: DiskRestorePointListByRestorePointOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + options, + }, + listByRestorePointOperationSpec, + ); + } + + /** + * Get disk restorePoint resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the DiskRestorePoint + * @param options The options parameters. + */ + get( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + options, + }, + getOperationSpec, + ); + } + + /** + * Grants access to a diskRestorePoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the DiskRestorePoint + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param options The options parameters. + */ + async beginGrantAccess( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options?: DiskRestorePointGrantAccessOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskRestorePointGrantAccessResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + options, + }, + spec: grantAccessOperationSpec, + }); + const poller = await createHttpPoller< + DiskRestorePointGrantAccessResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Grants access to a diskRestorePoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the DiskRestorePoint + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param options The options parameters. + */ + async beginGrantAccessAndWait( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options?: DiskRestorePointGrantAccessOptionalParams, + ): Promise { + const poller = await this.beginGrantAccess( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + grantAccessData, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Revokes access to a diskRestorePoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the DiskRestorePoint + * @param options The options parameters. + */ + async beginRevokeAccess( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointRevokeAccessOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + options, + }, + spec: revokeAccessOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Revokes access to a diskRestorePoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the DiskRestorePoint + * @param options The options parameters. + */ + async beginRevokeAccessAndWait( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointRevokeAccessOptionalParams, + ): Promise { + const poller = await this.beginRevokeAccess( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + diskRestorePointName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListByRestorePointNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param nextLink The nextLink from the previous successful call to the ListByRestorePoint method. + * @param options The options parameters. + */ + private _listByRestorePointNext( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + nextLink: string, + options?: DiskRestorePointListByRestorePointNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + nextLink, + options, + }, + listByRestorePointNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByRestorePointOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskRestorePointList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.restorePointCollectionName, + Parameters.vmRestorePointName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskRestorePoint, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.restorePointCollectionName, + Parameters.vmRestorePointName, + Parameters.diskRestorePointName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const grantAccessOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AccessUri, + }, + 201: { + bodyMapper: Mappers.AccessUri, + }, + 202: { + bodyMapper: Mappers.AccessUri, + }, + 204: { + bodyMapper: Mappers.AccessUri, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.grantAccessData, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.restorePointCollectionName, + Parameters.vmRestorePointName, + Parameters.diskRestorePointName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const revokeAccessOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.restorePointCollectionName, + Parameters.vmRestorePointName, + Parameters.diskRestorePointName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByRestorePointNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskRestorePointList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.restorePointCollectionName, + Parameters.vmRestorePointName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/compute/arm-compute-disk/src/operations/disks.ts b/sdk/compute/arm-compute-disk/src/operations/disks.ts new file mode 100644 index 000000000000..259fee1e6abe --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operations/disks.ts @@ -0,0 +1,955 @@ +// 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { Disks } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ComputeDiskClient } from "../computeDiskClient.js"; +import type { + SimplePollerLike, + OperationState} from "@azure/core-lro"; +import { + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import type { + Disk, + DisksListNextOptionalParams, + DisksListOptionalParams, + DisksListResponse, + DisksListByResourceGroupNextOptionalParams, + DisksListByResourceGroupOptionalParams, + DisksListByResourceGroupResponse, + DisksGetOptionalParams, + DisksGetResponse, + DisksCreateOrUpdateOptionalParams, + DisksCreateOrUpdateResponse, + DiskUpdate, + DisksUpdateOptionalParams, + DisksUpdateResponse, + DisksDeleteOptionalParams, + GrantAccessData, + DisksGrantAccessOptionalParams, + DisksGrantAccessResponse, + DisksRevokeAccessOptionalParams, + DisksListNextResponse, + DisksListByResourceGroupNextResponse, +} from "../models/index.js"; + +/// +/** Class containing Disks operations. */ +export class DisksImpl implements Disks { + private readonly client: ComputeDiskClient; + + /** + * Initialize a new instance of the class Disks class. + * @param client Reference to the service client + */ + constructor(client: ComputeDiskClient) { + this.client = client; + } + + /** + * Lists all the disks under a subscription. + * @param options The options parameters. + */ + public list( + options?: DisksListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: DisksListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DisksListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: DisksListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists all the disks under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: DisksListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: DisksListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DisksListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: DisksListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options, + )) { + yield* page; + } + } + + /** + * Lists all the disks under a subscription. + * @param options The options parameters. + */ + private _list(options?: DisksListOptionalParams): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Lists all the disks under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: DisksListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + + /** + * Gets information about a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + diskName: string, + options?: DisksGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, diskName, options }, + getOperationSpec, + ); + } + + /** + * Creates or updates a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + diskName: string, + disk: Disk, + options?: DisksCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DisksCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, diskName, disk, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + DisksCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + diskName: string, + disk: Disk, + options?: DisksCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + diskName, + disk, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Updates (patches) a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options?: DisksUpdateOptionalParams, + ): Promise< + SimplePollerLike, DisksUpdateResponse> + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, diskName, disk, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + DisksUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Updates (patches) a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options?: DisksUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + diskName, + disk, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + diskName: string, + options?: DisksDeleteOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, diskName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + diskName: string, + options?: DisksDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete(resourceGroupName, diskName, options); + return poller.pollUntilDone(); + } + + /** + * Grants access to a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param options The options parameters. + */ + async beginGrantAccess( + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options?: DisksGrantAccessOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DisksGrantAccessResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, diskName, grantAccessData, options }, + spec: grantAccessOperationSpec, + }); + const poller = await createHttpPoller< + DisksGrantAccessResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Grants access to a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param options The options parameters. + */ + async beginGrantAccessAndWait( + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options?: DisksGrantAccessOptionalParams, + ): Promise { + const poller = await this.beginGrantAccess( + resourceGroupName, + diskName, + grantAccessData, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Revokes access to a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param options The options parameters. + */ + async beginRevokeAccess( + resourceGroupName: string, + diskName: string, + options?: DisksRevokeAccessOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, diskName, options }, + spec: revokeAccessOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Revokes access to a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param options The options parameters. + */ + async beginRevokeAccessAndWait( + resourceGroupName: string, + diskName: string, + options?: DisksRevokeAccessOptionalParams, + ): Promise { + const poller = await this.beginRevokeAccess( + resourceGroupName, + diskName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: DisksListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: DisksListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Disk, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Disk, + }, + 201: { + bodyMapper: Mappers.Disk, + }, + 202: { + bodyMapper: Mappers.Disk, + }, + 204: { + bodyMapper: Mappers.Disk, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.disk, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Disk, + }, + 201: { + bodyMapper: Mappers.Disk, + }, + 202: { + bodyMapper: Mappers.Disk, + }, + 204: { + bodyMapper: Mappers.Disk, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.disk1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const grantAccessOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AccessUri, + }, + 201: { + bodyMapper: Mappers.AccessUri, + }, + 202: { + bodyMapper: Mappers.AccessUri, + }, + 204: { + bodyMapper: Mappers.AccessUri, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.grantAccessData, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const revokeAccessOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.diskName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiskList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/compute/arm-compute-disk/src/operations/index.ts b/sdk/compute/arm-compute-disk/src/operations/index.ts new file mode 100644 index 000000000000..14692912b1ee --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operations/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +export * from "./diskAccesses.js"; +export * from "./diskEncryptionSets.js"; +export * from "./disks.js"; +export * from "./snapshots.js"; +export * from "./diskRestorePointOperations.js"; diff --git a/sdk/compute/arm-compute-disk/src/operations/snapshots.ts b/sdk/compute/arm-compute-disk/src/operations/snapshots.ts new file mode 100644 index 000000000000..7e29b4f44482 --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operations/snapshots.ts @@ -0,0 +1,964 @@ +// 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 type { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import type { Snapshots } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import type { ComputeDiskClient } from "../computeDiskClient.js"; +import type { + SimplePollerLike, + OperationState} from "@azure/core-lro"; +import { + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import type { + Snapshot, + SnapshotsListNextOptionalParams, + SnapshotsListOptionalParams, + SnapshotsListResponse, + SnapshotsListByResourceGroupNextOptionalParams, + SnapshotsListByResourceGroupOptionalParams, + SnapshotsListByResourceGroupResponse, + SnapshotsGetOptionalParams, + SnapshotsGetResponse, + SnapshotsCreateOrUpdateOptionalParams, + SnapshotsCreateOrUpdateResponse, + SnapshotUpdate, + SnapshotsUpdateOptionalParams, + SnapshotsUpdateResponse, + SnapshotsDeleteOptionalParams, + GrantAccessData, + SnapshotsGrantAccessOptionalParams, + SnapshotsGrantAccessResponse, + SnapshotsRevokeAccessOptionalParams, + SnapshotsListNextResponse, + SnapshotsListByResourceGroupNextResponse, +} from "../models/index.js"; + +/// +/** Class containing Snapshots operations. */ +export class SnapshotsImpl implements Snapshots { + private readonly client: ComputeDiskClient; + + /** + * Initialize a new instance of the class Snapshots class. + * @param client Reference to the service client + */ + constructor(client: ComputeDiskClient) { + this.client = client; + } + + /** + * Lists snapshots under a subscription. + * @param options The options parameters. + */ + public list( + options?: SnapshotsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: SnapshotsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: SnapshotsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: SnapshotsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists snapshots under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: SnapshotsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: SnapshotsListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: SnapshotsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + const page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + const page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: SnapshotsListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options, + )) { + yield* page; + } + } + + /** + * Lists snapshots under a subscription. + * @param options The options parameters. + */ + private _list( + options?: SnapshotsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Lists snapshots under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: SnapshotsListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + + /** + * Gets information about a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, snapshotName, options }, + getOperationSpec, + ); + } + + /** + * Creates or updates a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options?: SnapshotsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SnapshotsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, snapshotName, snapshot, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + SnapshotsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options?: SnapshotsCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + snapshotName, + snapshot, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Updates (patches) a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options?: SnapshotsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SnapshotsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, snapshotName, snapshot, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + SnapshotsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Updates (patches) a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options?: SnapshotsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + snapshotName, + snapshot, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsDeleteOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, snapshotName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + snapshotName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Grants access to a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param options The options parameters. + */ + async beginGrantAccess( + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options?: SnapshotsGrantAccessOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SnapshotsGrantAccessResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, snapshotName, grantAccessData, options }, + spec: grantAccessOperationSpec, + }); + const poller = await createHttpPoller< + SnapshotsGrantAccessResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Grants access to a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param options The options parameters. + */ + async beginGrantAccessAndWait( + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options?: SnapshotsGrantAccessOptionalParams, + ): Promise { + const poller = await this.beginGrantAccess( + resourceGroupName, + snapshotName, + grantAccessData, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Revokes access to a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param options The options parameters. + */ + async beginRevokeAccess( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsRevokeAccessOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, snapshotName, options }, + spec: revokeAccessOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Revokes access to a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param options The options parameters. + */ + async beginRevokeAccessAndWait( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsRevokeAccessOptionalParams, + ): Promise { + const poller = await this.beginRevokeAccess( + resourceGroupName, + snapshotName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: SnapshotsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: SnapshotsListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SnapshotList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SnapshotList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Snapshot, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.snapshotName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Snapshot, + }, + 201: { + bodyMapper: Mappers.Snapshot, + }, + 202: { + bodyMapper: Mappers.Snapshot, + }, + 204: { + bodyMapper: Mappers.Snapshot, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.snapshot, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.snapshotName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.Snapshot, + }, + 201: { + bodyMapper: Mappers.Snapshot, + }, + 202: { + bodyMapper: Mappers.Snapshot, + }, + 204: { + bodyMapper: Mappers.Snapshot, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.snapshot1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.snapshotName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.snapshotName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const grantAccessOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.AccessUri, + }, + 201: { + bodyMapper: Mappers.AccessUri, + }, + 202: { + bodyMapper: Mappers.AccessUri, + }, + 204: { + bodyMapper: Mappers.AccessUri, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.grantAccessData, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.snapshotName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const revokeAccessOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.snapshotName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SnapshotList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SnapshotList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/compute/arm-compute-disk/src/operationsInterfaces/diskAccesses.ts b/sdk/compute/arm-compute-disk/src/operationsInterfaces/diskAccesses.ts new file mode 100644 index 000000000000..517c217ac1db --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operationsInterfaces/diskAccesses.ts @@ -0,0 +1,274 @@ +// 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import type { + DiskAccess, + DiskAccessesListOptionalParams, + DiskAccessesListByResourceGroupOptionalParams, + PrivateEndpointConnection, + DiskAccessesListPrivateEndpointConnectionsOptionalParams, + DiskAccessesGetOptionalParams, + DiskAccessesGetResponse, + DiskAccessesCreateOrUpdateOptionalParams, + DiskAccessesCreateOrUpdateResponse, + DiskAccessUpdate, + DiskAccessesUpdateOptionalParams, + DiskAccessesUpdateResponse, + DiskAccessesDeleteOptionalParams, + DiskAccessesGetAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetAPrivateEndpointConnectionResponse, + DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + DiskAccessesUpdateAPrivateEndpointConnectionResponse, + DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + DiskAccessesGetPrivateLinkResourcesOptionalParams, + DiskAccessesGetPrivateLinkResourcesResponse, +} from "../models/index.js"; + +/// +/** Interface representing a DiskAccesses. */ +export interface DiskAccesses { + /** + * Lists all the disk access resources under a subscription. + * @param options The options parameters. + */ + list( + options?: DiskAccessesListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists all the disk access resources under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DiskAccessesListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List information about private endpoint connections under a disk access resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + listPrivateEndpointConnections( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets information about a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesGetOptionalParams, + ): Promise; + /** + * Creates or updates a disk access resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options?: DiskAccessesCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskAccessesCreateOrUpdateResponse + > + >; + /** + * Creates or updates a disk access resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Put disk access operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccess, + options?: DiskAccessesCreateOrUpdateOptionalParams, + ): Promise; + /** + * Updates (patches) a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options?: DiskAccessesUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskAccessesUpdateResponse + > + >; + /** + * Updates (patches) a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param diskAccess disk access object supplied in the body of the Patch disk access operation. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + diskAccessName: string, + diskAccess: DiskAccessUpdate, + options?: DiskAccessesUpdateOptionalParams, + ): Promise; + /** + * Deletes a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesDeleteOptionalParams, + ): Promise, void>>; + /** + * Deletes a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesDeleteOptionalParams, + ): Promise; + /** + * Gets information about a private endpoint connection under a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + getAPrivateEndpointConnection( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesGetAPrivateEndpointConnectionOptionalParams, + ): Promise; + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to + * create a new private endpoint connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put + * private endpoint connection operation. + * @param options The options parameters. + */ + beginUpdateAPrivateEndpointConnection( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskAccessesUpdateAPrivateEndpointConnectionResponse + > + >; + /** + * Approve or reject a private endpoint connection under disk access resource, this can't be used to + * create a new private endpoint connection. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection private endpoint connection object supplied in the body of the Put + * private endpoint connection operation. + * @param options The options parameters. + */ + beginUpdateAPrivateEndpointConnectionAndWait( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + privateEndpointConnection: PrivateEndpointConnection, + options?: DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, + ): Promise; + /** + * Deletes a private endpoint connection under a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + beginDeleteAPrivateEndpointConnection( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + ): Promise, void>>; + /** + * Deletes a private endpoint connection under a disk access resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + beginDeleteAPrivateEndpointConnectionAndWait( + resourceGroupName: string, + diskAccessName: string, + privateEndpointConnectionName: string, + options?: DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, + ): Promise; + /** + * Gets the private link resources possible under disk access resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskAccessName The name of the disk access resource that is being created. The name can't be + * changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, + * 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + getPrivateLinkResources( + resourceGroupName: string, + diskAccessName: string, + options?: DiskAccessesGetPrivateLinkResourcesOptionalParams, + ): Promise; +} diff --git a/sdk/compute/arm-compute-disk/src/operationsInterfaces/diskEncryptionSets.ts b/sdk/compute/arm-compute-disk/src/operationsInterfaces/diskEncryptionSets.ts new file mode 100644 index 000000000000..084d175390ac --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operationsInterfaces/diskEncryptionSets.ts @@ -0,0 +1,169 @@ +// 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import type { + DiskEncryptionSet, + DiskEncryptionSetsListOptionalParams, + DiskEncryptionSetsListByResourceGroupOptionalParams, + DiskEncryptionSetsListAssociatedResourcesOptionalParams, + DiskEncryptionSetsGetOptionalParams, + DiskEncryptionSetsGetResponse, + DiskEncryptionSetsCreateOrUpdateOptionalParams, + DiskEncryptionSetsCreateOrUpdateResponse, + DiskEncryptionSetUpdate, + DiskEncryptionSetsUpdateOptionalParams, + DiskEncryptionSetsUpdateResponse, + DiskEncryptionSetsDeleteOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a DiskEncryptionSets. */ +export interface DiskEncryptionSets { + /** + * Lists all the disk encryption sets under a subscription. + * @param options The options parameters. + */ + list( + options?: DiskEncryptionSetsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists all the disk encryption sets under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DiskEncryptionSetsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists all resources that are encrypted with this disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + listAssociatedResources( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets information about a disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsGetOptionalParams, + ): Promise; + /** + * Creates or updates a disk encryption set + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption + * set operation. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskEncryptionSetsCreateOrUpdateResponse + > + >; + /** + * Creates or updates a disk encryption set + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Put disk encryption + * set operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSet, + options?: DiskEncryptionSetsCreateOrUpdateOptionalParams, + ): Promise; + /** + * Updates (patches) a disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk + * encryption set operation. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options?: DiskEncryptionSetsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskEncryptionSetsUpdateResponse + > + >; + /** + * Updates (patches) a disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param diskEncryptionSet disk encryption set object supplied in the body of the Patch disk + * encryption set operation. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + diskEncryptionSetName: string, + diskEncryptionSet: DiskEncryptionSetUpdate, + options?: DiskEncryptionSetsUpdateOptionalParams, + ): Promise; + /** + * Deletes a disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsDeleteOptionalParams, + ): Promise, void>>; + /** + * Deletes a disk encryption set. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name + * can't be changed after the disk encryption set is created. Supported characters for the name are + * a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + diskEncryptionSetName: string, + options?: DiskEncryptionSetsDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/compute/arm-compute-disk/src/operationsInterfaces/diskRestorePointOperations.ts b/sdk/compute/arm-compute-disk/src/operationsInterfaces/diskRestorePointOperations.ts new file mode 100644 index 000000000000..b5cbbba03908 --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operationsInterfaces/diskRestorePointOperations.ts @@ -0,0 +1,126 @@ +// 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import type { + DiskRestorePoint, + DiskRestorePointListByRestorePointOptionalParams, + DiskRestorePointGetOptionalParams, + DiskRestorePointGetResponse, + GrantAccessData, + DiskRestorePointGrantAccessOptionalParams, + DiskRestorePointGrantAccessResponse, + DiskRestorePointRevokeAccessOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a DiskRestorePointOperations. */ +export interface DiskRestorePointOperations { + /** + * Lists diskRestorePoints under a vmRestorePoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param options The options parameters. + */ + listByRestorePoint( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + options?: DiskRestorePointListByRestorePointOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get disk restorePoint resource + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the DiskRestorePoint + * @param options The options parameters. + */ + get( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointGetOptionalParams, + ): Promise; + /** + * Grants access to a diskRestorePoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the DiskRestorePoint + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param options The options parameters. + */ + beginGrantAccess( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options?: DiskRestorePointGrantAccessOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DiskRestorePointGrantAccessResponse + > + >; + /** + * Grants access to a diskRestorePoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the DiskRestorePoint + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param options The options parameters. + */ + beginGrantAccessAndWait( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + grantAccessData: GrantAccessData, + options?: DiskRestorePointGrantAccessOptionalParams, + ): Promise; + /** + * Revokes access to a diskRestorePoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the DiskRestorePoint + * @param options The options parameters. + */ + beginRevokeAccess( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointRevokeAccessOptionalParams, + ): Promise, void>>; + /** + * Revokes access to a diskRestorePoint. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param restorePointCollectionName The name of the restore point collection that the disk restore + * point belongs. + * @param vmRestorePointName The name of the vm restore point that the disk disk restore point belongs. + * @param diskRestorePointName The name of the DiskRestorePoint + * @param options The options parameters. + */ + beginRevokeAccessAndWait( + resourceGroupName: string, + restorePointCollectionName: string, + vmRestorePointName: string, + diskRestorePointName: string, + options?: DiskRestorePointRevokeAccessOptionalParams, + ): Promise; +} diff --git a/sdk/compute/arm-compute-disk/src/operationsInterfaces/disks.ts b/sdk/compute/arm-compute-disk/src/operationsInterfaces/disks.ts new file mode 100644 index 000000000000..400ab8813520 --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operationsInterfaces/disks.ts @@ -0,0 +1,211 @@ +// 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import type { + Disk, + DisksListOptionalParams, + DisksListByResourceGroupOptionalParams, + DisksGetOptionalParams, + DisksGetResponse, + DisksCreateOrUpdateOptionalParams, + DisksCreateOrUpdateResponse, + DiskUpdate, + DisksUpdateOptionalParams, + DisksUpdateResponse, + DisksDeleteOptionalParams, + GrantAccessData, + DisksGrantAccessOptionalParams, + DisksGrantAccessResponse, + DisksRevokeAccessOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a Disks. */ +export interface Disks { + /** + * Lists all the disks under a subscription. + * @param options The options parameters. + */ + list(options?: DisksListOptionalParams): PagedAsyncIterableIterator; + /** + * Lists all the disks under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: DisksListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets information about a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + diskName: string, + options?: DisksGetOptionalParams, + ): Promise; + /** + * Creates or updates a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + diskName: string, + disk: Disk, + options?: DisksCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DisksCreateOrUpdateResponse + > + >; + /** + * Creates or updates a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param disk Disk object supplied in the body of the Put disk operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + diskName: string, + disk: Disk, + options?: DisksCreateOrUpdateOptionalParams, + ): Promise; + /** + * Updates (patches) a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options?: DisksUpdateOptionalParams, + ): Promise< + SimplePollerLike, DisksUpdateResponse> + >; + /** + * Updates (patches) a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param disk Disk object supplied in the body of the Patch disk operation. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + diskName: string, + disk: DiskUpdate, + options?: DisksUpdateOptionalParams, + ): Promise; + /** + * Deletes a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + diskName: string, + options?: DisksDeleteOptionalParams, + ): Promise, void>>; + /** + * Deletes a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + diskName: string, + options?: DisksDeleteOptionalParams, + ): Promise; + /** + * Grants access to a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param options The options parameters. + */ + beginGrantAccess( + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options?: DisksGrantAccessOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + DisksGrantAccessResponse + > + >; + /** + * Grants access to a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get disk access operation. + * @param options The options parameters. + */ + beginGrantAccessAndWait( + resourceGroupName: string, + diskName: string, + grantAccessData: GrantAccessData, + options?: DisksGrantAccessOptionalParams, + ): Promise; + /** + * Revokes access to a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param options The options parameters. + */ + beginRevokeAccess( + resourceGroupName: string, + diskName: string, + options?: DisksRevokeAccessOptionalParams, + ): Promise, void>>; + /** + * Revokes access to a disk. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskName The name of the managed disk that is being created. The name can't be changed after + * the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name + * length is 80 characters. + * @param options The options parameters. + */ + beginRevokeAccessAndWait( + resourceGroupName: string, + diskName: string, + options?: DisksRevokeAccessOptionalParams, + ): Promise; +} diff --git a/sdk/compute/arm-compute-disk/src/operationsInterfaces/index.ts b/sdk/compute/arm-compute-disk/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..14692912b1ee --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operationsInterfaces/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +export * from "./diskAccesses.js"; +export * from "./diskEncryptionSets.js"; +export * from "./disks.js"; +export * from "./snapshots.js"; +export * from "./diskRestorePointOperations.js"; diff --git a/sdk/compute/arm-compute-disk/src/operationsInterfaces/snapshots.ts b/sdk/compute/arm-compute-disk/src/operationsInterfaces/snapshots.ts new file mode 100644 index 000000000000..b40b455b4773 --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/operationsInterfaces/snapshots.ts @@ -0,0 +1,216 @@ +// 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 type { PagedAsyncIterableIterator } from "@azure/core-paging"; +import type { SimplePollerLike, OperationState } from "@azure/core-lro"; +import type { + Snapshot, + SnapshotsListOptionalParams, + SnapshotsListByResourceGroupOptionalParams, + SnapshotsGetOptionalParams, + SnapshotsGetResponse, + SnapshotsCreateOrUpdateOptionalParams, + SnapshotsCreateOrUpdateResponse, + SnapshotUpdate, + SnapshotsUpdateOptionalParams, + SnapshotsUpdateResponse, + SnapshotsDeleteOptionalParams, + GrantAccessData, + SnapshotsGrantAccessOptionalParams, + SnapshotsGrantAccessResponse, + SnapshotsRevokeAccessOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a Snapshots. */ +export interface Snapshots { + /** + * Lists snapshots under a subscription. + * @param options The options parameters. + */ + list( + options?: SnapshotsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists snapshots under a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: SnapshotsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets information about a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsGetOptionalParams, + ): Promise; + /** + * Creates or updates a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options?: SnapshotsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SnapshotsCreateOrUpdateResponse + > + >; + /** + * Creates or updates a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Put disk operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + snapshotName: string, + snapshot: Snapshot, + options?: SnapshotsCreateOrUpdateOptionalParams, + ): Promise; + /** + * Updates (patches) a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options?: SnapshotsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SnapshotsUpdateResponse + > + >; + /** + * Updates (patches) a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param snapshot Snapshot object supplied in the body of the Patch snapshot operation. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + snapshotName: string, + snapshot: SnapshotUpdate, + options?: SnapshotsUpdateOptionalParams, + ): Promise; + /** + * Deletes a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsDeleteOptionalParams, + ): Promise, void>>; + /** + * Deletes a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsDeleteOptionalParams, + ): Promise; + /** + * Grants access to a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param options The options parameters. + */ + beginGrantAccess( + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options?: SnapshotsGrantAccessOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SnapshotsGrantAccessResponse + > + >; + /** + * Grants access to a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param grantAccessData Access data object supplied in the body of the get snapshot access operation. + * @param options The options parameters. + */ + beginGrantAccessAndWait( + resourceGroupName: string, + snapshotName: string, + grantAccessData: GrantAccessData, + options?: SnapshotsGrantAccessOptionalParams, + ): Promise; + /** + * Revokes access to a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param options The options parameters. + */ + beginRevokeAccess( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsRevokeAccessOptionalParams, + ): Promise, void>>; + /** + * Revokes access to a snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param snapshotName The name of the snapshot that is being created. The name can't be changed after + * the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name + * length is 80 characters. + * @param options The options parameters. + */ + beginRevokeAccessAndWait( + resourceGroupName: string, + snapshotName: string, + options?: SnapshotsRevokeAccessOptionalParams, + ): Promise; +} diff --git a/sdk/compute/arm-compute-disk/src/pagingHelper.ts b/sdk/compute/arm-compute-disk/src/pagingHelper.ts new file mode 100644 index 000000000000..bf4e4d1fcda7 --- /dev/null +++ b/sdk/compute/arm-compute-disk/src/pagingHelper.ts @@ -0,0 +1,37 @@ +// 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 interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined, +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/compute/arm-compute-disk/test/sampleTest.spec.ts b/sdk/compute/arm-compute-disk/test/sampleTest.spec.ts new file mode 100644 index 000000000000..cf1ada9f9280 --- /dev/null +++ b/sdk/compute/arm-compute-disk/test/sampleTest.spec.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RecorderStartOptions } from "@azure-tools/test-recorder"; +import { Recorder } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +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 () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/compute/arm-compute-disk/test/snippets.spec.ts b/sdk/compute/arm-compute-disk/test/snippets.spec.ts new file mode 100644 index 000000000000..0ae699113767 --- /dev/null +++ b/sdk/compute/arm-compute-disk/test/snippets.spec.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ComputeDiskClient } from "../src/index.js"; +import { + DefaultAzureCredential, + InteractiveBrowserCredential, +} from "@azure/identity"; +import { setLogLevel } from "@azure/logger"; +import { describe, it } from "vitest"; + +describe("snippets", () => { + it("ReadmeSampleCreateClient_Node", async () => { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new ComputeDiskClient( + new DefaultAzureCredential(), + subscriptionId, + ); + }); + + it("ReadmeSampleCreateClient_Browser", async () => { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", + }); + const client = new ComputeDiskClient(credential, subscriptionId); + }); + + it("SetLogLevel", async () => { + setLogLevel("info"); + }); +}); diff --git a/sdk/compute/arm-compute-disk/tsconfig.browser.config.json b/sdk/compute/arm-compute-disk/tsconfig.browser.config.json new file mode 100644 index 000000000000..85d80c4abc54 --- /dev/null +++ b/sdk/compute/arm-compute-disk/tsconfig.browser.config.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.browser.base.json", + "compilerOptions": { + "paths": { + "@azure/arm-compute-disk": ["./dist/browser/index.d.ts"], + "@azure/arm-compute-disk/*": ["./dist/browser/*"], + "$internal/*": ["./dist/browser/*"] + } + } +} diff --git a/sdk/compute/arm-compute-disk/tsconfig.json b/sdk/compute/arm-compute-disk/tsconfig.json new file mode 100644 index 000000000000..a6c78ba925f3 --- /dev/null +++ b/sdk/compute/arm-compute-disk/tsconfig.json @@ -0,0 +1,13 @@ +{ + "references": [ + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.test.json" + }, + { + "path": "./tsconfig.snippets.json" + } + ] +} \ No newline at end of file diff --git a/sdk/compute/arm-compute-disk/tsconfig.snippets.json b/sdk/compute/arm-compute-disk/tsconfig.snippets.json new file mode 100644 index 000000000000..6f3148b5ed97 --- /dev/null +++ b/sdk/compute/arm-compute-disk/tsconfig.snippets.json @@ -0,0 +1,3 @@ +{ + "extends": ["../../../tsconfig.snippets.base.json"] +} diff --git a/sdk/compute/arm-compute-disk/tsconfig.src.json b/sdk/compute/arm-compute-disk/tsconfig.src.json new file mode 100644 index 000000000000..bae70752dd38 --- /dev/null +++ b/sdk/compute/arm-compute-disk/tsconfig.src.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.lib.json" +} diff --git a/sdk/compute/arm-compute-disk/tsconfig.test.json b/sdk/compute/arm-compute-disk/tsconfig.test.json new file mode 100644 index 000000000000..42798ad68913 --- /dev/null +++ b/sdk/compute/arm-compute-disk/tsconfig.test.json @@ -0,0 +1,14 @@ +{ + "references": [ + { + "path": "./tsconfig.test.node.json" + }, + { + "path": "./tsconfig.browser.config.json" + } + ], + "compilerOptions": { + "composite": true + }, + "files": [] +} diff --git a/sdk/compute/arm-compute-disk/tsconfig.test.node.json b/sdk/compute/arm-compute-disk/tsconfig.test.node.json new file mode 100644 index 000000000000..96d0ebc4d6a6 --- /dev/null +++ b/sdk/compute/arm-compute-disk/tsconfig.test.node.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.test.node.base.json", + "compilerOptions": { + "paths": { + "@azure/arm-compute-disk": ["./src/index.ts"], + "@azure/arm-compute-disk/*": ["./src/*"], + "$internal/*": ["./src/*"] + } + } +} diff --git a/sdk/compute/arm-compute-disk/vitest.browser.config.ts b/sdk/compute/arm-compute-disk/vitest.browser.config.ts new file mode 100644 index 000000000000..72964f281efe --- /dev/null +++ b/sdk/compute/arm-compute-disk/vitest.browser.config.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import viteConfig from "../../../vitest.browser.shared.config.ts"; + +export default viteConfig; diff --git a/sdk/compute/arm-compute-disk/vitest.config.ts b/sdk/compute/arm-compute-disk/vitest.config.ts new file mode 100644 index 000000000000..0dfa15cc4498 --- /dev/null +++ b/sdk/compute/arm-compute-disk/vitest.config.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import viteConfig from "../../../vitest.shared.config.ts"; + +export default viteConfig; diff --git a/sdk/compute/arm-compute-disk/vitest.esm.config.ts b/sdk/compute/arm-compute-disk/vitest.esm.config.ts new file mode 100644 index 000000000000..5e9735e9b144 --- /dev/null +++ b/sdk/compute/arm-compute-disk/vitest.esm.config.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig(vitestConfig, vitestEsmConfig); diff --git a/sdk/compute/ci.mgmt.yml b/sdk/compute/ci.mgmt.yml index 663861db5c36..b7838af98725 100644 --- a/sdk/compute/ci.mgmt.yml +++ b/sdk/compute/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -15,6 +15,7 @@ trigger: - sdk/compute/arm-compute-profile-2020-09-01-hybrid - sdk/compute/arm-compute-rest - sdk/compute/arm-computerecommender + - sdk/compute/arm-compute-disk pr: branches: include: @@ -31,6 +32,7 @@ pr: - sdk/compute/arm-compute-profile-2020-09-01-hybrid - sdk/compute/arm-compute-rest - sdk/compute/arm-computerecommender + - sdk/compute/arm-compute-disk extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -44,3 +46,5 @@ extends: safeName: azurerestarmcompute - name: azure-arm-computerecommender safeName: azurearmcomputerecommender + - name: azure-arm-compute-disk + safeName: azurearmcomputedisk