From 4c7750cfac8cb1da5f5200d5cbae4cb8ad48322d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 26 Sep 2024 15:26:21 +0000 Subject: [PATCH] CodeGen from PR 30504 in Azure/azure-rest-api-specs Merge a1838a32bc5dfe359d45b6d8e20cbf62dc779ba1 into 0ea6f3e87651c19268983f3cc7411e21b1aed343 --- common/config/rush/pnpm-lock.yaml | 8 +- sdk/compute/arm-compute/CHANGELOG.md | 64 +- sdk/compute/arm-compute/_meta.json | 8 +- sdk/compute/arm-compute/package.json | 21 +- .../arm-compute/review/arm-compute.api.md | 274 +++++++ .../src/computeManagementClient.ts | 12 +- sdk/compute/arm-compute/src/models/index.ts | 383 ++++++++- sdk/compute/arm-compute/src/models/mappers.ts | 588 ++++++++++++++ .../arm-compute/src/models/parameters.ts | 105 ++- ...galleryInVMAccessControlProfileVersions.ts | 762 ++++++++++++++++++ .../galleryInVMAccessControlProfiles.ts | 688 ++++++++++++++++ .../arm-compute/src/operations/index.ts | 2 + ...galleryInVMAccessControlProfileVersions.ts | 204 +++++ .../galleryInVMAccessControlProfiles.ts | 174 ++++ .../src/operationsInterfaces/index.ts | 2 + sdk/compute/arm-compute/test/sampleTest.ts | 43 + sdk/compute/arm-compute/tsconfig.json | 10 +- 17 files changed, 3300 insertions(+), 48 deletions(-) create mode 100644 sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfileVersions.ts create mode 100644 sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfiles.ts create mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfileVersions.ts create mode 100644 sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfiles.ts create mode 100644 sdk/compute/arm-compute/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 0c39bffa5ee4..aca6c4e17d08 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13609,7 +13609,7 @@ packages: dev: false file:projects/arm-compute-1.tgz: - resolution: {integrity: sha512-ltoqytPE1QVwr7Sob5PjXXoDsknShksZFG9vsodvBaEPOHz+3m3/LPQe1AZrhBRnbb6XWOeaDkSZnDkbfTZ86A==, tarball: file:projects/arm-compute-1.tgz} + resolution: {integrity: sha512-q7ZNp8T1O0obOch9s8Ghk+PEffombkTm70PePDEn4yQ9ec2ryJCu/fzcqXjlR7gbQh6329ttaS3qzMjRyeX+5Q==, tarball: file:projects/arm-compute-1.tgz} name: '@rush-temp/arm-compute-1' version: 0.0.0 dependencies: @@ -13629,10 +13629,10 @@ packages: mkdirp: 3.0.1 mocha: 10.7.3 rimraf: 5.0.10 - ts-node: 10.9.2(@types/node@18.19.50)(typescript@5.6.2) + ts-node: 10.9.2(@types/node@18.19.50)(typescript@5.5.4) tslib: 2.7.0 tsx: 4.19.1 - typescript: 5.6.2 + typescript: 5.5.4 uglify-js: 3.19.3 transitivePeerDependencies: - '@swc/core' @@ -16732,7 +16732,7 @@ packages: dev: false file:projects/arm-mongocluster.tgz: - resolution: {integrity: sha512-5qfO0a31+swfnXGpyq3cmrbZ8Bj0tsLzx4frzixKRWNYsjpj3dbGiuLoIQDzcaw7mADeSVcXqduGOLAPxhtsdw==, tarball: file:projects/arm-mongocluster.tgz} + resolution: {integrity: sha512-EU8WPXxVnF2TP9sFdHD+Fhu0oD4WBj2gtulPY6pw393PtU2cp7IyaeETiBLyH2xxw4WRCyX1pjtNxADgOWpq1g==, tarball: file:projects/arm-mongocluster.tgz} name: '@rush-temp/arm-mongocluster' version: 0.0.0 dependencies: diff --git a/sdk/compute/arm-compute/CHANGELOG.md b/sdk/compute/arm-compute/CHANGELOG.md index dc8b08a3c947..1c41d83f653c 100644 --- a/sdk/compute/arm-compute/CHANGELOG.md +++ b/sdk/compute/arm-compute/CHANGELOG.md @@ -1,15 +1,59 @@ # Release History - -## 22.1.1 (Unreleased) - + +## 22.2.0 (2024-09-26) + ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group GalleryInVMAccessControlProfiles + - Added operation group GalleryInVMAccessControlProfileVersions + - Added Interface AccessControlRules + - Added Interface AccessControlRulesIdentity + - Added Interface AccessControlRulesPrivilege + - Added Interface AccessControlRulesRole + - Added Interface AccessControlRulesRoleAssignment + - Added Interface GalleryInVMAccessControlProfile + - Added Interface GalleryInVMAccessControlProfileList + - Added Interface GalleryInVMAccessControlProfileProperties + - Added Interface GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams + - Added Interface GalleryInVMAccessControlProfilesDeleteHeaders + - Added Interface GalleryInVMAccessControlProfilesDeleteOptionalParams + - Added Interface GalleryInVMAccessControlProfilesGetOptionalParams + - Added Interface GalleryInVMAccessControlProfilesListByGalleryNextOptionalParams + - Added Interface GalleryInVMAccessControlProfilesListByGalleryOptionalParams + - Added Interface GalleryInVMAccessControlProfilesUpdateOptionalParams + - Added Interface GalleryInVMAccessControlProfileUpdate + - Added Interface GalleryInVMAccessControlProfileVersion + - Added Interface GalleryInVMAccessControlProfileVersionList + - Added Interface GalleryInVMAccessControlProfileVersionProperties + - Added Interface GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams + - Added Interface GalleryInVMAccessControlProfileVersionsDeleteHeaders + - Added Interface GalleryInVMAccessControlProfileVersionsDeleteOptionalParams + - Added Interface GalleryInVMAccessControlProfileVersionsGetOptionalParams + - Added Interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextOptionalParams + - Added Interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams + - Added Interface GalleryInVMAccessControlProfileVersionsUpdateOptionalParams + - Added Interface GalleryInVMAccessControlProfileVersionUpdate + - Added Interface GalleryResourceProfilePropertiesBase + - Added Interface GalleryResourceProfileVersionPropertiesBase + - Added Type Alias AccessControlRulesMode + - Added Type Alias EndpointAccess + - Added Type Alias EndpointTypes + - Added Type Alias GalleryInVMAccessControlProfilesCreateOrUpdateResponse + - Added Type Alias GalleryInVMAccessControlProfilesDeleteResponse + - Added Type Alias GalleryInVMAccessControlProfilesGetResponse + - Added Type Alias GalleryInVMAccessControlProfilesListByGalleryNextResponse + - Added Type Alias GalleryInVMAccessControlProfilesListByGalleryResponse + - Added Type Alias GalleryInVMAccessControlProfilesUpdateResponse + - Added Type Alias GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse + - Added Type Alias GalleryInVMAccessControlProfileVersionsDeleteResponse + - Added Type Alias GalleryInVMAccessControlProfileVersionsGetResponse + - Added Type Alias GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextResponse + - Added Type Alias GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileResponse + - Added Type Alias GalleryInVMAccessControlProfileVersionsUpdateResponse + - Added Enum KnownAccessControlRulesMode + - Added Enum KnownEndpointAccess + + ## 22.1.0 (2024-08-12) ### Features Added @@ -579,7 +623,7 @@ ## 17.3.1 (2022-04-06) -### Features Added +**features** - Bug fix diff --git a/sdk/compute/arm-compute/_meta.json b/sdk/compute/arm-compute/_meta.json index 08483ff528c8..8adebb55cd78 100644 --- a/sdk/compute/arm-compute/_meta.json +++ b/sdk/compute/arm-compute/_meta.json @@ -1,8 +1,8 @@ { - "commit": "3cef1bf0125458cc60dfb9e644e6bc28b787beab", + "commit": "04f655b05d39622d6c7b50bb73551172e32cdebd", "readme": "specification/compute/resource-manager/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\compute\\resource-manager\\readme.md --use=@autorest/typescript@6.0.23 --generate-sample=true", + "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/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.11", - "use": "@autorest/typescript@6.0.23" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.14", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/compute/arm-compute/package.json b/sdk/compute/arm-compute/package.json index 1394d30b110d..5cebc01696fd 100644 --- a/sdk/compute/arm-compute/package.json +++ b/sdk/compute/arm-compute/package.json @@ -3,13 +3,13 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ComputeManagementClient.", - "version": "22.1.1", + "version": "22.2.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/core-lro": "^2.5.4", - "@azure/abort-controller": "^1.0.0", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.6.0", @@ -30,12 +30,12 @@ "devDependencies": { "@microsoft/api-extractor": "^7.31.1", "mkdirp": "^3.0.1", - "typescript": "~5.6.2", + "typescript": "~5.5.3", "uglify-js": "^3.4.9", "rimraf": "^5.0.0", "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", + "@azure/identity": "^4.2.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.1.0", "mocha": "^10.0.0", @@ -45,7 +45,6 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/arm-network": "^32.2.0", "ts-node": "^10.0.0" }, "repository": { @@ -107,13 +106,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute" +} \ No newline at end of file diff --git a/sdk/compute/arm-compute/review/arm-compute.api.md b/sdk/compute/arm-compute/review/arm-compute.api.md index d9f1a58260a2..91eb12ce12cd 100644 --- a/sdk/compute/arm-compute/review/arm-compute.api.md +++ b/sdk/compute/arm-compute/review/arm-compute.api.md @@ -10,6 +10,47 @@ import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { SimplePollerLike } from '@azure/core-lro'; +// @public +export interface AccessControlRules { + identities?: AccessControlRulesIdentity[]; + privileges?: AccessControlRulesPrivilege[]; + roleAssignments?: AccessControlRulesRoleAssignment[]; + roles?: AccessControlRulesRole[]; +} + +// @public +export interface AccessControlRulesIdentity { + exePath?: string; + groupName?: string; + name: string; + processName?: string; + userName?: string; +} + +// @public +export type AccessControlRulesMode = string; + +// @public +export interface AccessControlRulesPrivilege { + name: string; + path: string; + queryParameters?: { + [propertyName: string]: string; + }; +} + +// @public +export interface AccessControlRulesRole { + name: string; + privileges: string[]; +} + +// @public +export interface AccessControlRulesRoleAssignment { + identities: string[]; + role: string; +} + // @public export type AccessLevel = string; @@ -1126,6 +1167,10 @@ export class ComputeManagementClient extends coreClient.ServiceClient { // (undocumented) galleryImageVersions: GalleryImageVersions; // (undocumented) + galleryInVMAccessControlProfiles: GalleryInVMAccessControlProfiles; + // (undocumented) + galleryInVMAccessControlProfileVersions: GalleryInVMAccessControlProfileVersions; + // (undocumented) gallerySharingProfile: GallerySharingProfile; // (undocumented) images: Images; @@ -2211,6 +2256,12 @@ export interface EncryptionSettingsElement { // @public export type EncryptionType = string; +// @public +export type EndpointAccess = string; + +// @public +export type EndpointTypes = "WireServer" | "IMDS"; + // @public export interface EventGridAndResourceGraph { enable?: boolean; @@ -2828,6 +2879,202 @@ export interface GalleryImageVersionUpdate extends UpdateResourceDefinition { storageProfile?: GalleryImageVersionStorageProfile; } +// @public +export interface GalleryInVMAccessControlProfile extends Resource { + properties?: GalleryInVMAccessControlProfileProperties; +} + +// @public +export interface GalleryInVMAccessControlProfileList { + nextLink?: string; + value: GalleryInVMAccessControlProfile[]; +} + +// @public +export interface GalleryInVMAccessControlProfileProperties extends GalleryResourceProfilePropertiesBase { + applicableHostEndpoint: EndpointTypes; + description?: string; + osType: OperatingSystemTypes; +} + +// @public +export interface GalleryInVMAccessControlProfiles { + beginCreateOrUpdate(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams): Promise, GalleryInVMAccessControlProfilesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfilesDeleteOptionalParams): Promise, GalleryInVMAccessControlProfilesDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfilesDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, options?: GalleryInVMAccessControlProfilesUpdateOptionalParams): Promise, GalleryInVMAccessControlProfilesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, options?: GalleryInVMAccessControlProfilesUpdateOptionalParams): Promise; + get(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfilesGetOptionalParams): Promise; + listByGallery(resourceGroupName: string, galleryName: string, options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GalleryInVMAccessControlProfilesCreateOrUpdateResponse = GalleryInVMAccessControlProfile; + +// @public +export interface GalleryInVMAccessControlProfilesDeleteHeaders { + // (undocumented) + azureAsyncOperation?: string; + // (undocumented) + location?: string; +} + +// @public +export interface GalleryInVMAccessControlProfilesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GalleryInVMAccessControlProfilesDeleteResponse = GalleryInVMAccessControlProfilesDeleteHeaders; + +// @public +export interface GalleryInVMAccessControlProfilesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GalleryInVMAccessControlProfilesGetResponse = GalleryInVMAccessControlProfile; + +// @public +export interface GalleryInVMAccessControlProfilesListByGalleryNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GalleryInVMAccessControlProfilesListByGalleryNextResponse = GalleryInVMAccessControlProfileList; + +// @public +export interface GalleryInVMAccessControlProfilesListByGalleryOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GalleryInVMAccessControlProfilesListByGalleryResponse = GalleryInVMAccessControlProfileList; + +// @public +export interface GalleryInVMAccessControlProfilesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GalleryInVMAccessControlProfilesUpdateResponse = GalleryInVMAccessControlProfile; + +// @public +export interface GalleryInVMAccessControlProfileUpdate extends UpdateResourceDefinition { + properties?: GalleryInVMAccessControlProfileProperties; +} + +// @public +export interface GalleryInVMAccessControlProfileVersion extends Resource { + defaultAccess?: EndpointAccess; + excludeFromLatest?: boolean; + mode?: AccessControlRulesMode; + readonly provisioningState?: GalleryProvisioningState; + readonly publishedDate?: Date; + readonly replicationStatus?: ReplicationStatus; + rules?: AccessControlRules; + targetLocations?: TargetRegion[]; +} + +// @public +export interface GalleryInVMAccessControlProfileVersionList { + nextLink?: string; + value: GalleryInVMAccessControlProfileVersion[]; +} + +// @public +export interface GalleryInVMAccessControlProfileVersionProperties extends GalleryResourceProfileVersionPropertiesBase { + defaultAccess: EndpointAccess; + mode: AccessControlRulesMode; + rules?: AccessControlRules; +} + +// @public +export interface GalleryInVMAccessControlProfileVersions { + beginCreateOrUpdate(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams): Promise, GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams): Promise, GalleryInVMAccessControlProfileVersionsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams): Promise, GalleryInVMAccessControlProfileVersionsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams): Promise; + get(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, inVMAccessControlProfileVersionName: string, options?: GalleryInVMAccessControlProfileVersionsGetOptionalParams): Promise; + listByGalleryInVMAccessControlProfile(resourceGroupName: string, galleryName: string, inVMAccessControlProfileName: string, options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse = GalleryInVMAccessControlProfileVersion; + +// @public +export interface GalleryInVMAccessControlProfileVersionsDeleteHeaders { + // (undocumented) + azureAsyncOperation?: string; + // (undocumented) + location?: string; +} + +// @public +export interface GalleryInVMAccessControlProfileVersionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GalleryInVMAccessControlProfileVersionsDeleteResponse = GalleryInVMAccessControlProfileVersionsDeleteHeaders; + +// @public +export interface GalleryInVMAccessControlProfileVersionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GalleryInVMAccessControlProfileVersionsGetResponse = GalleryInVMAccessControlProfileVersion; + +// @public +export interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextResponse = GalleryInVMAccessControlProfileVersionList; + +// @public +export interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileResponse = GalleryInVMAccessControlProfileVersionList; + +// @public +export interface GalleryInVMAccessControlProfileVersionsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GalleryInVMAccessControlProfileVersionsUpdateResponse = GalleryInVMAccessControlProfileVersion; + +// @public +export interface GalleryInVMAccessControlProfileVersionUpdate extends UpdateResourceDefinition { + defaultAccess?: EndpointAccess; + excludeFromLatest?: boolean; + mode?: AccessControlRulesMode; + readonly provisioningState?: GalleryProvisioningState; + readonly publishedDate?: Date; + readonly replicationStatus?: ReplicationStatus; + rules?: AccessControlRules; + targetLocations?: TargetRegion[]; +} + // @public export interface GalleryList { nextLink?: string; @@ -2841,6 +3088,20 @@ export interface GalleryOSDiskImage extends GalleryDiskImage { // @public export type GalleryProvisioningState = string; +// @public +export interface GalleryResourceProfilePropertiesBase { + readonly provisioningState?: GalleryProvisioningState; +} + +// @public +export interface GalleryResourceProfileVersionPropertiesBase { + excludeFromLatest?: boolean; + readonly provisioningState?: GalleryProvisioningState; + readonly publishedDate?: Date; + readonly replicationStatus?: ReplicationStatus; + targetLocations?: TargetRegion[]; +} + // @public export type GallerySharingPermissionTypes = string; @@ -3143,6 +3404,13 @@ export interface KeyVaultSecretReference { sourceVault: SubResource; } +// @public +export enum KnownAccessControlRulesMode { + Audit = "Audit", + Disabled = "Disabled", + Enforce = "Enforce" +} + // @public export enum KnownAccessLevel { None = "None", @@ -3367,6 +3635,12 @@ export enum KnownEncryptionType { EncryptionAtRestWithPlatformKey = "EncryptionAtRestWithPlatformKey" } +// @public +export enum KnownEndpointAccess { + Allow = "Allow", + Deny = "Deny" +} + // @public export enum KnownExecutionState { Canceled = "Canceled", diff --git a/sdk/compute/arm-compute/src/computeManagementClient.ts b/sdk/compute/arm-compute/src/computeManagementClient.ts index c266e72e2ce4..3454fbf0810e 100644 --- a/sdk/compute/arm-compute/src/computeManagementClient.ts +++ b/sdk/compute/arm-compute/src/computeManagementClient.ts @@ -48,6 +48,8 @@ import { GalleryApplicationsImpl, GalleryApplicationVersionsImpl, GallerySharingProfileImpl, + GalleryInVMAccessControlProfilesImpl, + GalleryInVMAccessControlProfileVersionsImpl, SharedGalleriesImpl, SharedGalleryImagesImpl, SharedGalleryImageVersionsImpl, @@ -99,6 +101,8 @@ import { GalleryApplications, GalleryApplicationVersions, GallerySharingProfile, + GalleryInVMAccessControlProfiles, + GalleryInVMAccessControlProfileVersions, SharedGalleries, SharedGalleryImages, SharedGalleryImageVersions, @@ -145,7 +149,7 @@ export class ComputeManagementClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-compute/22.1.1`; + const packageDetails = `azsdk-js-arm-compute/22.2.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -245,6 +249,10 @@ export class ComputeManagementClient extends coreClient.ServiceClient { this.galleryApplications = new GalleryApplicationsImpl(this); this.galleryApplicationVersions = new GalleryApplicationVersionsImpl(this); this.gallerySharingProfile = new GallerySharingProfileImpl(this); + this.galleryInVMAccessControlProfiles = + new GalleryInVMAccessControlProfilesImpl(this); + this.galleryInVMAccessControlProfileVersions = + new GalleryInVMAccessControlProfileVersionsImpl(this); this.sharedGalleries = new SharedGalleriesImpl(this); this.sharedGalleryImages = new SharedGalleryImagesImpl(this); this.sharedGalleryImageVersions = new SharedGalleryImageVersionsImpl(this); @@ -300,6 +308,8 @@ export class ComputeManagementClient extends coreClient.ServiceClient { galleryApplications: GalleryApplications; galleryApplicationVersions: GalleryApplicationVersions; gallerySharingProfile: GallerySharingProfile; + galleryInVMAccessControlProfiles: GalleryInVMAccessControlProfiles; + galleryInVMAccessControlProfileVersions: GalleryInVMAccessControlProfileVersions; sharedGalleries: SharedGalleries; sharedGalleryImages: SharedGalleryImages; sharedGalleryImageVersions: SharedGalleryImageVersions; diff --git a/sdk/compute/arm-compute/src/models/index.ts b/sdk/compute/arm-compute/src/models/index.ts index 4097b9dd04c9..1013bde00615 100644 --- a/sdk/compute/arm-compute/src/models/index.ts +++ b/sdk/compute/arm-compute/src/models/index.ts @@ -1709,7 +1709,7 @@ export interface DataDisk { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly diskMBpsReadWrite?: number; - /** Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. */ + /** Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview**. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. */ detachOption?: DiskDetachOptionTypes; /** Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**. */ deleteOption?: DiskDeleteOptionTypes; @@ -4133,6 +4133,106 @@ export interface SharingUpdate { groups?: SharingProfileGroup[]; } +/** The properties of a gallery ResourceProfile. */ +export interface GalleryResourceProfilePropertiesBase { + /** + * The provisioning state, which only appears in the response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: GalleryProvisioningState; +} + +/** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ +export interface AccessControlRules { + /** A list of privileges. */ + privileges?: AccessControlRulesPrivilege[]; + /** A list of roles. */ + roles?: AccessControlRulesRole[]; + /** A list of identities. */ + identities?: AccessControlRulesIdentity[]; + /** A list of role assignments. */ + roleAssignments?: AccessControlRulesRoleAssignment[]; +} + +/** The properties of an Access Control Rule Privilege. */ +export interface AccessControlRulesPrivilege { + /** The name of the privilege. */ + name: string; + /** The HTTP path corresponding to the privilege. */ + path: string; + /** The query parameters to match in the path. */ + queryParameters?: { [propertyName: string]: string }; +} + +/** The properties of an Access Control Rule Role. */ +export interface AccessControlRulesRole { + /** The name of the role. */ + name: string; + /** A list of privileges needed by this role. */ + privileges: string[]; +} + +/** The properties of an Access Control Rule Identity. */ +export interface AccessControlRulesIdentity { + /** The name of the identity. */ + name: string; + /** The username corresponding to this identity. */ + userName?: string; + /** The groupName corresponding to this identity. */ + groupName?: string; + /** The path to the executable. */ + exePath?: string; + /** The process name of the executable. */ + processName?: string; +} + +/** The properties of an Access Control Rule RoleAssignment. */ +export interface AccessControlRulesRoleAssignment { + /** The name of the role. */ + role: string; + /** A list of identities that can access the privileges defined by the role. */ + identities: string[]; +} + +/** The properties of a gallery ResourceProfile version. */ +export interface GalleryResourceProfileVersionPropertiesBase { + /** The target regions where the Resource Profile version is going to be replicated to. This property is updatable. */ + targetLocations?: TargetRegion[]; + /** If set to true, Virtual Machines deployed from the latest version of the Resource Profile won't use this Profile version. */ + excludeFromLatest?: boolean; + /** + * The timestamp for when the Resource Profile Version is published. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publishedDate?: Date; + /** + * The provisioning state, which only appears in the response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: GalleryProvisioningState; + /** + * This is the replication status of the gallery image version. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly replicationStatus?: ReplicationStatus; +} + +/** The List Gallery InVMAccessControlProfiles operation response. */ +export interface GalleryInVMAccessControlProfileList { + /** A list of Gallery InVMAccessControlProfiles. */ + value: GalleryInVMAccessControlProfile[]; + /** The uri to fetch the next page of inVMAccessControlProfiles in the gallery. Call ListNext() with this to fetch the next page of gallery inVMAccessControlProfiles. */ + nextLink?: string; +} + +/** The List Gallery InVMAccessControlProfile Versions operation response. */ +export interface GalleryInVMAccessControlProfileVersionList { + /** A list of Gallery InVMAccessControlProfile Versions. */ + value: GalleryInVMAccessControlProfileVersion[]; + /** The uri to fetch the next page of inVMAccessControlProfile versions. Call ListNext() with this to fetch the next page of gallery inVMAccessControlProfile versions. */ + nextLink?: string; +} + /** The List Shared Galleries operation response. */ export interface SharedGalleryList { /** A list of shared galleries. */ @@ -6003,7 +6103,7 @@ export interface GalleryImage extends Resource { readonly provisioningState?: GalleryProvisioningState; /** A list of gallery image features. */ features?: GalleryImageFeature[]; - /** The architecture of the image. Applicable to OS disks only. */ + /** CPU architecture supported by an OS disk. */ architecture?: Architecture; } @@ -6065,6 +6165,41 @@ export interface GalleryApplicationVersion extends Resource { readonly replicationStatus?: ReplicationStatus; } +/** Specifies information about the gallery inVMAccessControlProfile that you want to create or update. */ +export interface GalleryInVMAccessControlProfile extends Resource { + /** Describes the properties of a gallery inVMAccessControlProfile. */ + properties?: GalleryInVMAccessControlProfileProperties; +} + +/** Specifies information about the gallery inVMAccessControlProfile version that you want to create or update. */ +export interface GalleryInVMAccessControlProfileVersion extends Resource { + /** The target regions where the Resource Profile version is going to be replicated to. This property is updatable. */ + targetLocations?: TargetRegion[]; + /** If set to true, Virtual Machines deployed from the latest version of the Resource Profile won't use this Profile version. */ + excludeFromLatest?: boolean; + /** + * The timestamp for when the Resource Profile Version is published. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publishedDate?: Date; + /** + * The provisioning state, which only appears in the response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: GalleryProvisioningState; + /** + * This is the replication status of the gallery image version. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly replicationStatus?: ReplicationStatus; + /** This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. */ + mode?: AccessControlRulesMode; + /** This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. */ + defaultAccess?: EndpointAccess; + /** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ + rules?: AccessControlRules; +} + /** Describes a Virtual Machine Scale Set. */ export interface VirtualMachineScaleSetUpdate extends UpdateResource { /** The virtual machine scale set sku. */ @@ -6672,7 +6807,7 @@ export interface GalleryImageUpdate extends UpdateResourceDefinition { readonly provisioningState?: GalleryProvisioningState; /** A list of gallery image features. */ features?: GalleryImageFeature[]; - /** The architecture of the image. Applicable to OS disks only. */ + /** CPU architecture supported by an OS disk. */ architecture?: Architecture; } @@ -6735,6 +6870,43 @@ export interface GalleryApplicationVersionUpdate readonly replicationStatus?: ReplicationStatus; } +/** Specifies information about the gallery inVMAccessControlProfile that you want to update. */ +export interface GalleryInVMAccessControlProfileUpdate + extends UpdateResourceDefinition { + /** Describes the properties of a gallery inVMAccessControlProfile. */ + properties?: GalleryInVMAccessControlProfileProperties; +} + +/** Specifies information about the gallery inVMAccessControlProfile version that you want to update. */ +export interface GalleryInVMAccessControlProfileVersionUpdate + extends UpdateResourceDefinition { + /** The target regions where the Resource Profile version is going to be replicated to. This property is updatable. */ + targetLocations?: TargetRegion[]; + /** If set to true, Virtual Machines deployed from the latest version of the Resource Profile won't use this Profile version. */ + excludeFromLatest?: boolean; + /** + * The timestamp for when the Resource Profile Version is published. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publishedDate?: Date; + /** + * The provisioning state, which only appears in the response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: GalleryProvisioningState; + /** + * This is the replication status of the gallery image version. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly replicationStatus?: ReplicationStatus; + /** This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. */ + mode?: AccessControlRulesMode; + /** This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. */ + defaultAccess?: EndpointAccess; + /** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ + rules?: AccessControlRules; +} + /** The publishing profile of a gallery image Version. */ export interface GalleryImageVersionPublishingProfile extends GalleryArtifactPublishingProfileBase {} @@ -6812,6 +6984,28 @@ export interface GalleryImageVersionSafetyProfile export interface GalleryApplicationVersionSafetyProfile extends GalleryArtifactSafetyProfileBase {} +/** Describes the properties of a gallery inVMAccessControlProfile. */ +export interface GalleryInVMAccessControlProfileProperties + extends GalleryResourceProfilePropertiesBase { + /** The description of this gallery inVMAccessControlProfile resources. This property is updatable. */ + description?: string; + /** This property allows you to specify the OS type of the VMs/VMSS for which this profile can be used against. Possible values are: 'Windows' or 'Linux' */ + osType: OperatingSystemTypes; + /** This property allows you to specify the Endpoint type for which this profile is defining the access control for. Possible values are: 'WireServer' or 'IMDS' */ + applicableHostEndpoint: EndpointTypes; +} + +/** Describes the properties of an inVMAccessControlProfile version. */ +export interface GalleryInVMAccessControlProfileVersionProperties + extends GalleryResourceProfileVersionPropertiesBase { + /** This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. */ + mode: AccessControlRulesMode; + /** This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values are: 'Allow', 'Deny'. */ + defaultAccess: EndpointAccess; + /** This is the Access Control Rules specification for an inVMAccessControlProfile version. */ + rules?: AccessControlRules; +} + /** Base information about the shared gallery resource in pir. */ export interface PirSharedGalleryResource extends PirResource { /** The unique id of this shared gallery. */ @@ -6857,7 +7051,7 @@ export interface CommunityGalleryImage extends PirCommunityGalleryResource { features?: GalleryImageFeature[]; /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ purchasePlan?: ImagePurchasePlan; - /** The architecture of the image. Applicable to OS disks only. */ + /** CPU architecture supported by an OS disk. */ architecture?: Architecture; /** Privacy statement URI for the current community gallery image. */ privacyStatementUri?: string; @@ -6942,7 +7136,7 @@ export interface SharedGalleryImage extends PirSharedGalleryResource { features?: GalleryImageFeature[]; /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ purchasePlan?: ImagePurchasePlan; - /** The architecture of the image. Applicable to OS disks only. */ + /** CPU architecture supported by an OS disk. */ architecture?: Architecture; /** Privacy statement uri for the current community gallery image. */ privacyStatementUri?: string; @@ -6996,6 +7190,18 @@ export interface DedicatedHostsRedeployHeaders { location?: string; } +/** Defines headers for GalleryInVMAccessControlProfiles_delete operation. */ +export interface GalleryInVMAccessControlProfilesDeleteHeaders { + location?: string; + azureAsyncOperation?: string; +} + +/** Defines headers for GalleryInVMAccessControlProfileVersions_delete operation. */ +export interface GalleryInVMAccessControlProfileVersionsDeleteHeaders { + location?: string; + azureAsyncOperation?: string; +} + /** Known values of {@link RepairAction} that the service accepts. */ export enum KnownRepairAction { /** Replace */ @@ -9663,6 +9869,45 @@ export enum KnownSharingUpdateOperationTypes { */ export type SharingUpdateOperationTypes = string; +/** Known values of {@link AccessControlRulesMode} that the service accepts. */ +export enum KnownAccessControlRulesMode { + /** Audit */ + Audit = "Audit", + /** Enforce */ + Enforce = "Enforce", + /** Disabled */ + Disabled = "Disabled", +} + +/** + * Defines values for AccessControlRulesMode. \ + * {@link KnownAccessControlRulesMode} can be used interchangeably with AccessControlRulesMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Audit** \ + * **Enforce** \ + * **Disabled** + */ +export type AccessControlRulesMode = string; + +/** Known values of {@link EndpointAccess} that the service accepts. */ +export enum KnownEndpointAccess { + /** Allow */ + Allow = "Allow", + /** Deny */ + Deny = "Deny", +} + +/** + * Defines values for EndpointAccess. \ + * {@link KnownEndpointAccess} can be used interchangeably with EndpointAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Allow** \ + * **Deny** + */ +export type EndpointAccess = string; + /** Known values of {@link SharedToValues} that the service accepts. */ export enum KnownSharedToValues { /** Tenant */ @@ -9827,6 +10072,8 @@ export type GalleryApplicationCustomActionParameterType = | "String" | "ConfigurationDataBlob" | "LogOutputBlob"; +/** Defines values for EndpointTypes. */ +export type EndpointTypes = "WireServer" | "IMDS"; /** Optional parameters. */ export interface OperationsListOptionalParams @@ -12550,6 +12797,132 @@ export interface GallerySharingProfileUpdateOptionalParams /** Contains response data for the update operation. */ export type GallerySharingProfileUpdateResponse = SharingUpdate; +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams + 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 GalleryInVMAccessControlProfilesCreateOrUpdateResponse = + GalleryInVMAccessControlProfile; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfilesUpdateOptionalParams + 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 GalleryInVMAccessControlProfilesUpdateResponse = + GalleryInVMAccessControlProfile; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfilesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type GalleryInVMAccessControlProfilesGetResponse = + GalleryInVMAccessControlProfile; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfilesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type GalleryInVMAccessControlProfilesDeleteResponse = + GalleryInVMAccessControlProfilesDeleteHeaders; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfilesListByGalleryOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByGallery operation. */ +export type GalleryInVMAccessControlProfilesListByGalleryResponse = + GalleryInVMAccessControlProfileList; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfilesListByGalleryNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByGalleryNext operation. */ +export type GalleryInVMAccessControlProfilesListByGalleryNextResponse = + GalleryInVMAccessControlProfileList; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams + 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 GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse = + GalleryInVMAccessControlProfileVersion; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfileVersionsUpdateOptionalParams + 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 GalleryInVMAccessControlProfileVersionsUpdateResponse = + GalleryInVMAccessControlProfileVersion; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfileVersionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type GalleryInVMAccessControlProfileVersionsGetResponse = + GalleryInVMAccessControlProfileVersion; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfileVersionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type GalleryInVMAccessControlProfileVersionsDeleteResponse = + GalleryInVMAccessControlProfileVersionsDeleteHeaders; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByGalleryInVMAccessControlProfile operation. */ +export type GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileResponse = + GalleryInVMAccessControlProfileVersionList; + +/** Optional parameters. */ +export interface GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByGalleryInVMAccessControlProfileNext operation. */ +export type GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextResponse = + GalleryInVMAccessControlProfileVersionList; + /** Optional parameters. */ export interface SharedGalleriesListOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/compute/arm-compute/src/models/mappers.ts b/sdk/compute/arm-compute/src/models/mappers.ts index fde041ec9ae2..01e08aaeebe8 100644 --- a/sdk/compute/arm-compute/src/models/mappers.ts +++ b/sdk/compute/arm-compute/src/models/mappers.ts @@ -10947,6 +10947,312 @@ export const SharingUpdate: coreClient.CompositeMapper = { }, }; +export const GalleryResourceProfilePropertiesBase: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GalleryResourceProfilePropertiesBase", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const AccessControlRules: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessControlRules", + modelProperties: { + privileges: { + serializedName: "privileges", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessControlRulesPrivilege", + }, + }, + }, + }, + roles: { + serializedName: "roles", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessControlRulesRole", + }, + }, + }, + }, + identities: { + serializedName: "identities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessControlRulesIdentity", + }, + }, + }, + }, + roleAssignments: { + serializedName: "roleAssignments", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessControlRulesRoleAssignment", + }, + }, + }, + }, + }, + }, +}; + +export const AccessControlRulesPrivilege: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessControlRulesPrivilege", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + path: { + serializedName: "path", + required: true, + type: { + name: "String", + }, + }, + queryParameters: { + serializedName: "queryParameters", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + }, + }, +}; + +export const AccessControlRulesRole: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessControlRulesRole", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + privileges: { + serializedName: "privileges", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const AccessControlRulesIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessControlRulesIdentity", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + userName: { + serializedName: "userName", + type: { + name: "String", + }, + }, + groupName: { + serializedName: "groupName", + type: { + name: "String", + }, + }, + exePath: { + serializedName: "exePath", + type: { + name: "String", + }, + }, + processName: { + serializedName: "processName", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AccessControlRulesRoleAssignment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessControlRulesRoleAssignment", + modelProperties: { + role: { + serializedName: "role", + required: true, + type: { + name: "String", + }, + }, + identities: { + serializedName: "identities", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const GalleryResourceProfileVersionPropertiesBase: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GalleryResourceProfileVersionPropertiesBase", + modelProperties: { + targetLocations: { + serializedName: "targetLocations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TargetRegion", + }, + }, + }, + }, + excludeFromLatest: { + serializedName: "excludeFromLatest", + type: { + name: "Boolean", + }, + }, + publishedDate: { + serializedName: "publishedDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + replicationStatus: { + serializedName: "replicationStatus", + type: { + name: "Composite", + className: "ReplicationStatus", + }, + }, + }, + }, + }; + +export const GalleryInVMAccessControlProfileList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfileList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfile", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const GalleryInVMAccessControlProfileVersionList: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfileVersionList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfileVersion", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, + }; + export const SharedGalleryList: coreClient.CompositeMapper = { type: { name: "Composite", @@ -15654,6 +15960,92 @@ export const GalleryApplicationVersion: coreClient.CompositeMapper = { }, }; +export const GalleryInVMAccessControlProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfile", + modelProperties: { + ...Resource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfileProperties", + }, + }, + }, + }, +}; + +export const GalleryInVMAccessControlProfileVersion: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfileVersion", + modelProperties: { + ...Resource.type.modelProperties, + targetLocations: { + serializedName: "properties.targetLocations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TargetRegion", + }, + }, + }, + }, + excludeFromLatest: { + serializedName: "properties.excludeFromLatest", + type: { + name: "Boolean", + }, + }, + publishedDate: { + serializedName: "properties.publishedDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + replicationStatus: { + serializedName: "properties.replicationStatus", + type: { + name: "Composite", + className: "ReplicationStatus", + }, + }, + mode: { + serializedName: "properties.mode", + type: { + name: "String", + }, + }, + defaultAccess: { + serializedName: "properties.defaultAccess", + type: { + name: "String", + }, + }, + rules: { + serializedName: "properties.rules", + type: { + name: "Composite", + className: "AccessControlRules", + }, + }, + }, + }, + }; + export const VirtualMachineScaleSetUpdate: coreClient.CompositeMapper = { type: { name: "Composite", @@ -17402,6 +17794,93 @@ export const GalleryApplicationVersionUpdate: coreClient.CompositeMapper = { }, }; +export const GalleryInVMAccessControlProfileUpdate: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfileUpdate", + modelProperties: { + ...UpdateResourceDefinition.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfileProperties", + }, + }, + }, + }, + }; + +export const GalleryInVMAccessControlProfileVersionUpdate: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfileVersionUpdate", + modelProperties: { + ...UpdateResourceDefinition.type.modelProperties, + targetLocations: { + serializedName: "properties.targetLocations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TargetRegion", + }, + }, + }, + }, + excludeFromLatest: { + serializedName: "properties.excludeFromLatest", + type: { + name: "Boolean", + }, + }, + publishedDate: { + serializedName: "properties.publishedDate", + readOnly: true, + type: { + name: "DateTime", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + replicationStatus: { + serializedName: "properties.replicationStatus", + type: { + name: "Composite", + className: "ReplicationStatus", + }, + }, + mode: { + serializedName: "properties.mode", + type: { + name: "String", + }, + }, + defaultAccess: { + serializedName: "properties.defaultAccess", + type: { + name: "String", + }, + }, + rules: { + serializedName: "properties.rules", + type: { + name: "Composite", + className: "AccessControlRules", + }, + }, + }, + }, + }; + export const GalleryImageVersionPublishingProfile: coreClient.CompositeMapper = { type: { @@ -17616,6 +18095,71 @@ export const GalleryApplicationVersionSafetyProfile: coreClient.CompositeMapper }, }; +export const GalleryInVMAccessControlProfileProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfileProperties", + modelProperties: { + ...GalleryResourceProfilePropertiesBase.type.modelProperties, + description: { + serializedName: "description", + type: { + name: "String", + }, + }, + osType: { + serializedName: "osType", + required: true, + type: { + name: "Enum", + allowedValues: ["Windows", "Linux"], + }, + }, + applicableHostEndpoint: { + serializedName: "applicableHostEndpoint", + required: true, + type: { + name: "Enum", + allowedValues: ["WireServer", "IMDS"], + }, + }, + }, + }, + }; + +export const GalleryInVMAccessControlProfileVersionProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfileVersionProperties", + modelProperties: { + ...GalleryResourceProfileVersionPropertiesBase.type.modelProperties, + mode: { + serializedName: "mode", + required: true, + type: { + name: "String", + }, + }, + defaultAccess: { + serializedName: "defaultAccess", + required: true, + type: { + name: "String", + }, + }, + rules: { + serializedName: "rules", + type: { + name: "Composite", + className: "AccessControlRules", + }, + }, + }, + }, + }; + export const PirSharedGalleryResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -18202,3 +18746,47 @@ export const DedicatedHostsRedeployHeaders: coreClient.CompositeMapper = { }, }, }; + +export const GalleryInVMAccessControlProfilesDeleteHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfilesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const GalleryInVMAccessControlProfileVersionsDeleteHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GalleryInVMAccessControlProfileVersionsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + }, + }, + }; diff --git a/sdk/compute/arm-compute/src/models/parameters.ts b/sdk/compute/arm-compute/src/models/parameters.ts index 9db43162f04a..c09a1f67a2b5 100644 --- a/sdk/compute/arm-compute/src/models/parameters.ts +++ b/sdk/compute/arm-compute/src/models/parameters.ts @@ -79,6 +79,10 @@ import { GalleryApplicationVersion as GalleryApplicationVersionMapper, GalleryApplicationVersionUpdate as GalleryApplicationVersionUpdateMapper, SharingUpdate as SharingUpdateMapper, + GalleryInVMAccessControlProfile as GalleryInVMAccessControlProfileMapper, + GalleryInVMAccessControlProfileUpdate as GalleryInVMAccessControlProfileUpdateMapper, + GalleryInVMAccessControlProfileVersion as GalleryInVMAccessControlProfileVersionMapper, + GalleryInVMAccessControlProfileVersionUpdate as GalleryInVMAccessControlProfileVersionUpdateMapper, CloudService as CloudServiceMapper, CloudServiceUpdate as CloudServiceUpdateMapper, RoleInstances as RoleInstancesMapper, @@ -1169,7 +1173,7 @@ export const galleryName: OperationURLParameter = { export const apiVersion3: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-07-03", + defaultValue: "2024-03-03", isConstant: true, serializedName: "api-version", type: { @@ -1302,6 +1306,105 @@ export const sharingUpdate: OperationParameter = { mapper: SharingUpdateMapper, }; +export const galleryInVMAccessControlProfile: OperationParameter = { + parameterPath: "galleryInVMAccessControlProfile", + mapper: GalleryInVMAccessControlProfileMapper, +}; + +export const galleryName1: OperationURLParameter = { + parameterPath: "galleryName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]+([_]?[a-zA-Z0-9]+)*$"), + }, + serializedName: "galleryName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const inVMAccessControlProfileName: OperationURLParameter = { + parameterPath: "inVMAccessControlProfileName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]+([-._]?[a-zA-Z0-9]+)*$"), + MaxLength: 80, + }, + serializedName: "inVMAccessControlProfileName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const galleryInVMAccessControlProfile1: OperationParameter = { + parameterPath: "galleryInVMAccessControlProfile", + mapper: GalleryInVMAccessControlProfileUpdateMapper, +}; + +export const inVMAccessControlProfileName1: OperationURLParameter = { + parameterPath: "inVMAccessControlProfileName", + mapper: { + serializedName: "inVMAccessControlProfileName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const galleryInVMAccessControlProfileVersion: OperationParameter = { + parameterPath: "galleryInVMAccessControlProfileVersion", + mapper: GalleryInVMAccessControlProfileVersionMapper, +}; + +export const inVMAccessControlProfileVersionName: OperationURLParameter = { + parameterPath: "inVMAccessControlProfileVersionName", + mapper: { + constraints: { + Pattern: new RegExp("^[0-9]+\\.[0-9]+\\.[0-9]+$"), + }, + serializedName: "inVMAccessControlProfileVersionName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const galleryInVMAccessControlProfileVersion1: OperationParameter = { + parameterPath: "galleryInVMAccessControlProfileVersion", + mapper: GalleryInVMAccessControlProfileVersionUpdateMapper, +}; + +export const inVMAccessControlProfileVersionName1: OperationURLParameter = { + parameterPath: "inVMAccessControlProfileVersionName", + mapper: { + serializedName: "inVMAccessControlProfileVersionName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const inVMAccessControlProfileName2: OperationURLParameter = { + parameterPath: "inVMAccessControlProfileName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]+([-._]?[a-zA-Z0-9]+)*$"), + }, + serializedName: "inVMAccessControlProfileName", + required: true, + type: { + name: "String", + }, + }, +}; + export const sharedTo: OperationQueryParameter = { parameterPath: ["options", "sharedTo"], mapper: { diff --git a/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfileVersions.ts b/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfileVersions.ts new file mode 100644 index 000000000000..f6f2a932bcee --- /dev/null +++ b/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfileVersions.ts @@ -0,0 +1,762 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { GalleryInVMAccessControlProfileVersions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ComputeManagementClient } from "../computeManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + GalleryInVMAccessControlProfileVersion, + GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextOptionalParams, + GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileResponse, + GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse, + GalleryInVMAccessControlProfileVersionUpdate, + GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsUpdateResponse, + GalleryInVMAccessControlProfileVersionsGetOptionalParams, + GalleryInVMAccessControlProfileVersionsGetResponse, + GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + GalleryInVMAccessControlProfileVersionsDeleteResponse, + GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextResponse, +} from "../models"; + +/// +/** Class containing GalleryInVMAccessControlProfileVersions operations. */ +export class GalleryInVMAccessControlProfileVersionsImpl + implements GalleryInVMAccessControlProfileVersions +{ + private readonly client: ComputeManagementClient; + + /** + * Initialize a new instance of the class GalleryInVMAccessControlProfileVersions class. + * @param client Reference to the service client + */ + constructor(client: ComputeManagementClient) { + this.client = client; + } + + /** + * List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile from which the + * inVMAccessControlProfile versions are to be listed. + * @param options The options parameters. + */ + public listByGalleryInVMAccessControlProfile( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByGalleryInVMAccessControlProfilePagingAll( + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + 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.listByGalleryInVMAccessControlProfilePagingPage( + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + options, + settings, + ); + }, + }; + } + + private async *listByGalleryInVMAccessControlProfilePagingPage( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByGalleryInVMAccessControlProfile( + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByGalleryInVMAccessControlProfileNext( + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByGalleryInVMAccessControlProfilePagingAll( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByGalleryInVMAccessControlProfilePagingPage( + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + options, + )) { + yield* page; + } + } + + /** + * Create or update a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version is to be created. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be created. Needs to follow semantic version name pattern: The allowed characters are digit and + * period. Digits must be within the range of a 32-bit integer. Format: + * .. + * @param galleryInVMAccessControlProfileVersion Parameters supplied to the create or update gallery + * inVMAccessControlProfile version operation. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse + > + > { + 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, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Create or update a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version is to be created. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be created. Needs to follow semantic version name pattern: The allowed characters are digit and + * period. Digits must be within the range of a 32-bit integer. Format: + * .. + * @param galleryInVMAccessControlProfileVersion Parameters supplied to the create or update gallery + * inVMAccessControlProfile version operation. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version is to be updated. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be updated. Needs to follow semantic version name pattern: The allowed characters are digit and + * period. Digits must be within the range of a 32-bit integer. Format: + * .. + * @param galleryInVMAccessControlProfileVersion Parameters supplied to the update gallery + * inVMAccessControlProfile version operation. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfileVersionsUpdateResponse + > + > { + 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, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + GalleryInVMAccessControlProfileVersionsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Update a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version is to be updated. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be updated. Needs to follow semantic version name pattern: The allowed characters are digit and + * period. Digits must be within the range of a 32-bit integer. Format: + * .. + * @param galleryInVMAccessControlProfileVersion Parameters supplied to the update gallery + * inVMAccessControlProfile version operation. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + galleryInVMAccessControlProfileVersion, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Retrieves information about a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version resides. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be retrieved. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + options, + }, + getOperationSpec, + ); + } + + /** + * Delete a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version resides. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be deleted. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfileVersionsDeleteResponse + > + > { + 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, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + GalleryInVMAccessControlProfileVersionsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Delete a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version resides. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be deleted. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + inVMAccessControlProfileVersionName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile from which the + * inVMAccessControlProfile versions are to be listed. + * @param options The options parameters. + */ + private _listByGalleryInVMAccessControlProfile( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, galleryName, inVMAccessControlProfileName, options }, + listByGalleryInVMAccessControlProfileOperationSpec, + ); + } + + /** + * ListByGalleryInVMAccessControlProfileNext + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile from which the + * inVMAccessControlProfile versions are to be listed. + * @param nextLink The nextLink from the previous successful call to the + * ListByGalleryInVMAccessControlProfile method. + * @param options The options parameters. + */ + private _listByGalleryInVMAccessControlProfileNext( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + nextLink: string, + options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + nextLink, + options, + }, + listByGalleryInVMAccessControlProfileNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, + }, + 201: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, + }, + 202: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, + }, + 204: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.galleryInVMAccessControlProfileVersion, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.galleryName1, + Parameters.inVMAccessControlProfileName, + Parameters.inVMAccessControlProfileVersionName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, + }, + 201: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, + }, + 202: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, + }, + 204: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.galleryInVMAccessControlProfileVersion1, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.galleryName, + Parameters.inVMAccessControlProfileName1, + Parameters.inVMAccessControlProfileVersionName1, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileVersion, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.galleryName, + Parameters.inVMAccessControlProfileName1, + Parameters.inVMAccessControlProfileVersionName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: + Mappers.GalleryInVMAccessControlProfileVersionsDeleteHeaders, + }, + 201: { + headersMapper: + Mappers.GalleryInVMAccessControlProfileVersionsDeleteHeaders, + }, + 202: { + headersMapper: + Mappers.GalleryInVMAccessControlProfileVersionsDeleteHeaders, + }, + 204: { + headersMapper: + Mappers.GalleryInVMAccessControlProfileVersionsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.galleryName, + Parameters.inVMAccessControlProfileName1, + Parameters.inVMAccessControlProfileVersionName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByGalleryInVMAccessControlProfileOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileVersionList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.galleryName1, + Parameters.inVMAccessControlProfileName2, + ], + headerParameters: [Parameters.accept], + serializer, + }; +const listByGalleryInVMAccessControlProfileNextOperationSpec: coreClient.OperationSpec = + { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileVersionList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.galleryName1, + Parameters.inVMAccessControlProfileName2, + ], + headerParameters: [Parameters.accept], + serializer, + }; diff --git a/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfiles.ts b/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfiles.ts new file mode 100644 index 000000000000..6b5fc5b9d509 --- /dev/null +++ b/sdk/compute/arm-compute/src/operations/galleryInVMAccessControlProfiles.ts @@ -0,0 +1,688 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { GalleryInVMAccessControlProfiles } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ComputeManagementClient } from "../computeManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + GalleryInVMAccessControlProfile, + GalleryInVMAccessControlProfilesListByGalleryNextOptionalParams, + GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + GalleryInVMAccessControlProfilesListByGalleryResponse, + GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfilesCreateOrUpdateResponse, + GalleryInVMAccessControlProfileUpdate, + GalleryInVMAccessControlProfilesUpdateOptionalParams, + GalleryInVMAccessControlProfilesUpdateResponse, + GalleryInVMAccessControlProfilesGetOptionalParams, + GalleryInVMAccessControlProfilesGetResponse, + GalleryInVMAccessControlProfilesDeleteOptionalParams, + GalleryInVMAccessControlProfilesDeleteResponse, + GalleryInVMAccessControlProfilesListByGalleryNextResponse, +} from "../models"; + +/// +/** Class containing GalleryInVMAccessControlProfiles operations. */ +export class GalleryInVMAccessControlProfilesImpl + implements GalleryInVMAccessControlProfiles +{ + private readonly client: ComputeManagementClient; + + /** + * Initialize a new instance of the class GalleryInVMAccessControlProfiles class. + * @param client Reference to the service client + */ + constructor(client: ComputeManagementClient) { + this.client = client; + } + + /** + * List gallery inVMAccessControlProfiles in a gallery. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the InVMAccessControlProfiles are + * to be listed. + * @param options The options parameters. + */ + public listByGallery( + resourceGroupName: string, + galleryName: string, + options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByGalleryPagingAll( + resourceGroupName, + galleryName, + 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.listByGalleryPagingPage( + resourceGroupName, + galleryName, + options, + settings, + ); + }, + }; + } + + private async *listByGalleryPagingPage( + resourceGroupName: string, + galleryName: string, + options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: GalleryInVMAccessControlProfilesListByGalleryResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByGallery( + resourceGroupName, + galleryName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByGalleryNext( + resourceGroupName, + galleryName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByGalleryPagingAll( + resourceGroupName: string, + galleryName: string, + options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByGalleryPagingPage( + resourceGroupName, + galleryName, + options, + )) { + yield* page; + } + } + + /** + * Create or update a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the InVMAccessControlProfile is to + * be created. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be created + * or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed + * in the middle. The maximum length is 80 characters. + * @param galleryInVMAccessControlProfile Parameters supplied to the create or update gallery + * inVMAccessControlProfile operation. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfilesCreateOrUpdateResponse + > + > { + 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, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + GalleryInVMAccessControlProfilesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Create or update a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the InVMAccessControlProfile is to + * be created. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be created + * or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed + * in the middle. The maximum length is 80 characters. + * @param galleryInVMAccessControlProfile Parameters supplied to the create or update gallery + * inVMAccessControlProfile operation. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the InVMAccessControlProfile is to + * be updated. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be updated. + * The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + * middle. The maximum length is 80 characters. + * @param galleryInVMAccessControlProfile Parameters supplied to the update gallery + * inVMAccessControlProfile operation. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfilesUpdateResponse + > + > { + 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, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + GalleryInVMAccessControlProfilesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Update a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the InVMAccessControlProfile is to + * be updated. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be updated. + * The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + * middle. The maximum length is 80 characters. + * @param galleryInVMAccessControlProfile Parameters supplied to the update gallery + * inVMAccessControlProfile operation. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + galleryInVMAccessControlProfile, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Retrieves information about a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the InVMAccessControlProfiles are + * to be retrieved. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be + * retrieved. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, galleryName, inVMAccessControlProfileName, options }, + getOperationSpec, + ); + } + + /** + * Delete a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName he name of the Shared Image Gallery in which the InVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be deleted. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfilesDeleteResponse + > + > { + 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, + galleryName, + inVMAccessControlProfileName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + GalleryInVMAccessControlProfilesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Delete a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName he name of the Shared Image Gallery in which the InVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be deleted. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + galleryName, + inVMAccessControlProfileName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * List gallery inVMAccessControlProfiles in a gallery. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the InVMAccessControlProfiles are + * to be listed. + * @param options The options parameters. + */ + private _listByGallery( + resourceGroupName: string, + galleryName: string, + options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, galleryName, options }, + listByGalleryOperationSpec, + ); + } + + /** + * ListByGalleryNext + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the InVMAccessControlProfiles are + * to be listed. + * @param nextLink The nextLink from the previous successful call to the ListByGallery method. + * @param options The options parameters. + */ + private _listByGalleryNext( + resourceGroupName: string, + galleryName: string, + nextLink: string, + options?: GalleryInVMAccessControlProfilesListByGalleryNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, galleryName, nextLink, options }, + listByGalleryNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.GalleryInVMAccessControlProfile, + }, + 201: { + bodyMapper: Mappers.GalleryInVMAccessControlProfile, + }, + 202: { + bodyMapper: Mappers.GalleryInVMAccessControlProfile, + }, + 204: { + bodyMapper: Mappers.GalleryInVMAccessControlProfile, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.galleryInVMAccessControlProfile, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.galleryName1, + Parameters.inVMAccessControlProfileName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.GalleryInVMAccessControlProfile, + }, + 201: { + bodyMapper: Mappers.GalleryInVMAccessControlProfile, + }, + 202: { + bodyMapper: Mappers.GalleryInVMAccessControlProfile, + }, + 204: { + bodyMapper: Mappers.GalleryInVMAccessControlProfile, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + requestBody: Parameters.galleryInVMAccessControlProfile1, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.galleryName, + Parameters.inVMAccessControlProfileName1, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GalleryInVMAccessControlProfile, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.galleryName, + Parameters.inVMAccessControlProfileName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.GalleryInVMAccessControlProfilesDeleteHeaders, + }, + 201: { + headersMapper: Mappers.GalleryInVMAccessControlProfilesDeleteHeaders, + }, + 202: { + headersMapper: Mappers.GalleryInVMAccessControlProfilesDeleteHeaders, + }, + 204: { + headersMapper: Mappers.GalleryInVMAccessControlProfilesDeleteHeaders, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.galleryName, + Parameters.inVMAccessControlProfileName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByGalleryOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.galleryName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByGalleryNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GalleryInVMAccessControlProfileList, + }, + default: { + bodyMapper: Mappers.CloudError, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.resourceGroupName, + Parameters.galleryName1, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/compute/arm-compute/src/operations/index.ts b/sdk/compute/arm-compute/src/operations/index.ts index 502684dc464f..7fddfc4fe689 100644 --- a/sdk/compute/arm-compute/src/operations/index.ts +++ b/sdk/compute/arm-compute/src/operations/index.ts @@ -44,6 +44,8 @@ export * from "./galleryImageVersions"; export * from "./galleryApplications"; export * from "./galleryApplicationVersions"; export * from "./gallerySharingProfile"; +export * from "./galleryInVMAccessControlProfiles"; +export * from "./galleryInVMAccessControlProfileVersions"; export * from "./sharedGalleries"; export * from "./sharedGalleryImages"; export * from "./sharedGalleryImageVersions"; diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfileVersions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfileVersions.ts new file mode 100644 index 000000000000..0f8c89f8ee15 --- /dev/null +++ b/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfileVersions.ts @@ -0,0 +1,204 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + GalleryInVMAccessControlProfileVersion, + GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse, + GalleryInVMAccessControlProfileVersionUpdate, + GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + GalleryInVMAccessControlProfileVersionsUpdateResponse, + GalleryInVMAccessControlProfileVersionsGetOptionalParams, + GalleryInVMAccessControlProfileVersionsGetResponse, + GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + GalleryInVMAccessControlProfileVersionsDeleteResponse, +} from "../models"; + +/// +/** Interface representing a GalleryInVMAccessControlProfileVersions. */ +export interface GalleryInVMAccessControlProfileVersions { + /** + * List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile from which the + * inVMAccessControlProfile versions are to be listed. + * @param options The options parameters. + */ + listByGalleryInVMAccessControlProfile( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfileVersionsListByGalleryInVMAccessControlProfileOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Create or update a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version is to be created. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be created. Needs to follow semantic version name pattern: The allowed characters are digit and + * period. Digits must be within the range of a 32-bit integer. Format: + * .. + * @param galleryInVMAccessControlProfileVersion Parameters supplied to the create or update gallery + * inVMAccessControlProfile version operation. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfileVersionsCreateOrUpdateResponse + > + >; + /** + * Create or update a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version is to be created. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be created. Needs to follow semantic version name pattern: The allowed characters are digit and + * period. Digits must be within the range of a 32-bit integer. Format: + * .. + * @param galleryInVMAccessControlProfileVersion Parameters supplied to the create or update gallery + * inVMAccessControlProfile version operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersion, + options?: GalleryInVMAccessControlProfileVersionsCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version is to be updated. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be updated. Needs to follow semantic version name pattern: The allowed characters are digit and + * period. Digits must be within the range of a 32-bit integer. Format: + * .. + * @param galleryInVMAccessControlProfileVersion Parameters supplied to the update gallery + * inVMAccessControlProfile version operation. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfileVersionsUpdateResponse + > + >; + /** + * Update a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version is to be updated. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be updated. Needs to follow semantic version name pattern: The allowed characters are digit and + * period. Digits must be within the range of a 32-bit integer. Format: + * .. + * @param galleryInVMAccessControlProfileVersion Parameters supplied to the update gallery + * inVMAccessControlProfile version operation. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + galleryInVMAccessControlProfileVersion: GalleryInVMAccessControlProfileVersionUpdate, + options?: GalleryInVMAccessControlProfileVersionsUpdateOptionalParams, + ): Promise; + /** + * Retrieves information about a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version resides. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be retrieved. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsGetOptionalParams, + ): Promise; + /** + * Delete a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version resides. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be deleted. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfileVersionsDeleteResponse + > + >; + /** + * Delete a gallery inVMAccessControlProfile version. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the inVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile in which the + * inVMAccessControlProfile version resides. + * @param inVMAccessControlProfileVersionName The name of the gallery inVMAccessControlProfile version + * to be deleted. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + inVMAccessControlProfileVersionName: string, + options?: GalleryInVMAccessControlProfileVersionsDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfiles.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfiles.ts new file mode 100644 index 000000000000..08e2b356f848 --- /dev/null +++ b/sdk/compute/arm-compute/src/operationsInterfaces/galleryInVMAccessControlProfiles.ts @@ -0,0 +1,174 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + GalleryInVMAccessControlProfile, + GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + GalleryInVMAccessControlProfilesCreateOrUpdateResponse, + GalleryInVMAccessControlProfileUpdate, + GalleryInVMAccessControlProfilesUpdateOptionalParams, + GalleryInVMAccessControlProfilesUpdateResponse, + GalleryInVMAccessControlProfilesGetOptionalParams, + GalleryInVMAccessControlProfilesGetResponse, + GalleryInVMAccessControlProfilesDeleteOptionalParams, + GalleryInVMAccessControlProfilesDeleteResponse, +} from "../models"; + +/// +/** Interface representing a GalleryInVMAccessControlProfiles. */ +export interface GalleryInVMAccessControlProfiles { + /** + * List gallery inVMAccessControlProfiles in a gallery. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the InVMAccessControlProfiles are + * to be listed. + * @param options The options parameters. + */ + listByGallery( + resourceGroupName: string, + galleryName: string, + options?: GalleryInVMAccessControlProfilesListByGalleryOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Create or update a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the InVMAccessControlProfile is to + * be created. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be created + * or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed + * in the middle. The maximum length is 80 characters. + * @param galleryInVMAccessControlProfile Parameters supplied to the create or update gallery + * inVMAccessControlProfile operation. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfilesCreateOrUpdateResponse + > + >; + /** + * Create or update a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the InVMAccessControlProfile is to + * be created. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be created + * or updated. The allowed characters are alphabets and numbers with dots, dashes, and periods allowed + * in the middle. The maximum length is 80 characters. + * @param galleryInVMAccessControlProfile Parameters supplied to the create or update gallery + * inVMAccessControlProfile operation. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfile, + options?: GalleryInVMAccessControlProfilesCreateOrUpdateOptionalParams, + ): Promise; + /** + * Update a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the InVMAccessControlProfile is to + * be updated. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be updated. + * The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + * middle. The maximum length is 80 characters. + * @param galleryInVMAccessControlProfile Parameters supplied to the update gallery + * inVMAccessControlProfile operation. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfilesUpdateResponse + > + >; + /** + * Update a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the InVMAccessControlProfile is to + * be updated. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be updated. + * The allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the + * middle. The maximum length is 80 characters. + * @param galleryInVMAccessControlProfile Parameters supplied to the update gallery + * inVMAccessControlProfile operation. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + galleryInVMAccessControlProfile: GalleryInVMAccessControlProfileUpdate, + options?: GalleryInVMAccessControlProfilesUpdateOptionalParams, + ): Promise; + /** + * Retrieves information about a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery from which the InVMAccessControlProfiles are + * to be retrieved. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be + * retrieved. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesGetOptionalParams, + ): Promise; + /** + * Delete a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName he name of the Shared Image Gallery in which the InVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be deleted. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GalleryInVMAccessControlProfilesDeleteResponse + > + >; + /** + * Delete a gallery inVMAccessControlProfile. + * @param resourceGroupName The name of the resource group. + * @param galleryName he name of the Shared Image Gallery in which the InVMAccessControlProfile + * resides. + * @param inVMAccessControlProfileName The name of the gallery inVMAccessControlProfile to be deleted. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + galleryName: string, + inVMAccessControlProfileName: string, + options?: GalleryInVMAccessControlProfilesDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/index.ts b/sdk/compute/arm-compute/src/operationsInterfaces/index.ts index 502684dc464f..7fddfc4fe689 100644 --- a/sdk/compute/arm-compute/src/operationsInterfaces/index.ts +++ b/sdk/compute/arm-compute/src/operationsInterfaces/index.ts @@ -44,6 +44,8 @@ export * from "./galleryImageVersions"; export * from "./galleryApplications"; export * from "./galleryApplicationVersions"; export * from "./gallerySharingProfile"; +export * from "./galleryInVMAccessControlProfiles"; +export * from "./galleryInVMAccessControlProfileVersions"; export * from "./sharedGalleries"; export * from "./sharedGalleryImages"; export * from "./sharedGalleryImageVersions"; diff --git a/sdk/compute/arm-compute/test/sampleTest.ts b/sdk/compute/arm-compute/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/compute/arm-compute/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env, +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/compute/arm-compute/tsconfig.json b/sdk/compute/arm-compute/tsconfig.json index b84abc8423ab..3e6ae96443f3 100644 --- a/sdk/compute/arm-compute/tsconfig.json +++ b/sdk/compute/arm-compute/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-compute": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"