diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 2c8adae82d70..a794f2f6a458 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4695,7 +4695,7 @@ packages: dependencies: semver: 7.5.1 shelljs: 0.8.5 - typescript: 5.2.0-dev.20230622 + typescript: 5.2.0-dev.20230623 dev: false /duplexer3/0.1.5: @@ -10149,8 +10149,8 @@ packages: hasBin: true dev: false - /typescript/5.2.0-dev.20230622: - resolution: {integrity: sha512-rVTuiLuyezBKAEAvkvDRvO/tA+nk5DXwnWk3vpKXzDtuv7JJ22iBPkehusg9m5AQ6To+ZJ7+mFJ+mNE6yPr9zQ==} + /typescript/5.2.0-dev.20230623: + resolution: {integrity: sha512-IduDyLpZBJFdoFuHAXj0QfHwkT6GXtkki03deolpXnPG4R+wiVZGIyyzdS0lfVbFCVejcINPxxBs7ce6E5mp+A==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -13586,7 +13586,7 @@ packages: dev: false file:projects/arm-elasticsan.tgz: - resolution: {integrity: sha512-wuPQXjMzsKDQRD9gt9YardeUOLib6zETTVhEHuCgM4rZH+T+yFfQcOV49OHf+sSweHiBeHun/54D87Tl7+1t3g==, tarball: file:projects/arm-elasticsan.tgz} + resolution: {integrity: sha512-mJahvWqbrYDPLUpN6GCn1f/kDTymrTGbJHC4aTaxFRO7t6CEtIoIiMbvoDJpZK84FScxsYheZzBwhXNXtpPPYA==, tarball: file:projects/arm-elasticsan.tgz} name: '@rush-temp/arm-elasticsan' version: 0.0.0 dependencies: @@ -13601,7 +13601,7 @@ packages: chai: 4.3.7 cross-env: 7.0.3 dotenv: 16.0.3 - mkdirp: 1.0.4 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 diff --git a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md index 6ce6c512f5a3..dbb4e0db9f8c 100644 --- a/sdk/elasticsans/arm-elasticsan/CHANGELOG.md +++ b/sdk/elasticsans/arm-elasticsan/CHANGELOG.md @@ -1,15 +1,62 @@ # Release History - -## 1.0.0-beta.2 (2023-01-10) - + +## 1.0.0-beta.2 (2023-06-23) + **Features** --  Exposes `getContinuationToken` helper function to extract continuation token - -**Bugs Fixed** + - Added operation group PrivateEndpoinConnections + - Added operation group PrivateEndpointConnections + - Added operation group PrivateLinkResources + - Added Interface ElasticSanCreateParameter + - Added Interface ElasticSansDeleteHeaders + - Added Interface ElasticSansUpdateHeaders + - Added Interface ErrorDetail + - Added Interface PrivateEndpoinConnectionsDeleteHeaders + - Added Interface PrivateEndpoinConnectionsDeleteOptionalParams + - Added Interface PrivateEndpoint + - Added Interface PrivateEndpointConnection + - Added Interface PrivateEndpointConnectionList + - Added Interface PrivateEndpointConnectionsCreateOptionalParams + - Added Interface PrivateEndpointConnectionsGetOptionalParams + - Added Interface PrivateEndpointConnectionsListOptionalParams + - Added Interface PrivateLinkResource + - Added Interface PrivateLinkResourceListResult + - Added Interface PrivateLinkResourcesListByElasticSanOptionalParams + - Added Interface PrivateLinkServiceConnectionState + - Added Interface ResourceAutoGenerated + - Added Interface VolumeCreateParameter + - Added Interface VolumeGroupsDeleteHeaders + - Added Interface VolumeGroupsUpdateHeaders + - Added Interface VolumesDeleteHeaders + - Added Interface VolumesUpdateHeaders + - Added Type Alias PrivateEndpointConnectionsCreateResponse + - Added Type Alias PrivateEndpointConnectionsGetResponse + - Added Type Alias PrivateEndpointConnectionsListResponse + - Added Type Alias PrivateEndpointServiceConnectionStatus + - Added Type Alias PrivateLinkResourcesListByElasticSanResponse + - Added Type Alias PublicNetworkAccess + - Interface ElasticSan has a new optional parameter privateEndpointConnections + - Interface ElasticSan has a new optional parameter publicNetworkAccess + - Interface ElasticSanUpdate has a new optional parameter publicNetworkAccess + - Interface ErrorResponse has a new optional parameter error + - Interface VolumeGroup has a new optional parameter privateEndpointConnections + - Added Enum KnownPrivateEndpointServiceConnectionStatus + - Added Enum KnownPublicNetworkAccess + - Added function getContinuationToken -- A series of small bug fixs relevant to authentication and apiVersion policy +**Breaking Changes** + - Operation ElasticSans.beginCreate has a new signature + - Operation ElasticSans.beginCreateAndWait has a new signature + - Operation Volumes.beginCreate has a new signature + - Operation Volumes.beginCreateAndWait has a new signature + - Interface ErrorResponse no longer has parameter additionalInfo + - Interface ErrorResponse no longer has parameter code + - Interface ErrorResponse no longer has parameter details + - Interface ErrorResponse no longer has parameter message + - Interface ErrorResponse no longer has parameter target + + ## 1.0.0-beta.1 (2022-10-21) The package of @azure/arm-elasticsan is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/elasticsans/arm-elasticsan/_meta.json b/sdk/elasticsans/arm-elasticsan/_meta.json index f69b405fbbf3..005ca33d9fc3 100644 --- a/sdk/elasticsans/arm-elasticsan/_meta.json +++ b/sdk/elasticsans/arm-elasticsan/_meta.json @@ -1,8 +1,8 @@ { - "commit": "38e580acd81dbb904d048a23d805dd58b8699d93", + "commit": "3fe139353762e9f8f55f7610299970fd43de1338", "readme": "specification/elasticsan/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\elasticsan\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.6.20221226.1 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --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/elasticsan/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", - "use": "@autorest/typescript@6.0.0-rc.6.20221226.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.1", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/elasticsans/arm-elasticsan/package.json b/sdk/elasticsans/arm-elasticsan/package.json index 614b269de4d2..7abbc59e1cfc 100644 --- a/sdk/elasticsans/arm-elasticsan/package.json +++ b/sdk/elasticsans/arm-elasticsan/package.json @@ -8,10 +8,10 @@ "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.3", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -33,7 +33,7 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-elasticsan?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/elasticsans/arm-elasticsan" +} \ No newline at end of file diff --git a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md index 7452f47f5a02..faa35b59bf92 100644 --- a/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md +++ b/sdk/elasticsans/arm-elasticsan/review/arm-elasticsan.api.md @@ -6,9 +6,9 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; // @public export type CreatedByType = string; @@ -16,10 +16,12 @@ export type CreatedByType = string; // @public export interface ElasticSan extends TrackedResource { availabilityZones?: string[]; - baseSizeTiB: number; - extendedCapacitySizeTiB: number; + baseSizeTiB?: number; + extendedCapacitySizeTiB?: number; + readonly privateEndpointConnections?: PrivateEndpointConnectionList; readonly provisioningState?: ProvisioningStates; - sku: Sku; + publicNetworkAccess?: PublicNetworkAccess; + sku?: Sku; readonly systemData?: SystemData; readonly totalIops?: number; readonly totalMBps?: number; @@ -28,10 +30,14 @@ export interface ElasticSan extends TrackedResource { readonly volumeGroupCount?: number; } +// @public +export interface ElasticSanCreateParameter extends ElasticSan { +} + // @public export interface ElasticSanList { readonly nextLink?: string; - value: ElasticSan[]; + value?: ElasticSan[]; } // @public (undocumented) @@ -46,6 +52,12 @@ export class ElasticSanManagement extends coreClient.ServiceClient { // (undocumented) operations: Operations; // (undocumented) + privateEndpoinConnections: PrivateEndpoinConnections; + // (undocumented) + privateEndpointConnections: PrivateEndpointConnections; + // (undocumented) + privateLinkResources: PrivateLinkResources; + // (undocumented) skus: Skus; // (undocumented) subscriptionId: string; @@ -85,11 +97,11 @@ export interface ElasticSanRPOperation { // @public export interface ElasticSans { - beginCreate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): Promise, ElasticSansCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, parameters: ElasticSan, options?: ElasticSansCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): Promise, void>>; + beginCreate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanCreateParameter, options?: ElasticSansCreateOptionalParams): Promise, ElasticSansCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanCreateParameter, options?: ElasticSansCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): Promise, ElasticSansUpdateResponse>>; + beginUpdate(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): Promise, ElasticSansUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams): Promise; get(resourceGroupName: string, elasticSanName: string, options?: ElasticSansGetOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: ElasticSansListByResourceGroupOptionalParams): PagedAsyncIterableIterator; @@ -105,6 +117,12 @@ export interface ElasticSansCreateOptionalParams extends coreClient.OperationOpt // @public export type ElasticSansCreateResponse = ElasticSan; +// @public +export interface ElasticSansDeleteHeaders { + // (undocumented) + location?: string; +} + // @public export interface ElasticSansDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -146,6 +164,12 @@ export interface ElasticSansListBySubscriptionOptionalParams extends coreClient. // @public export type ElasticSansListBySubscriptionResponse = ElasticSanList; +// @public +export interface ElasticSansUpdateHeaders { + // (undocumented) + location?: string; +} + // @public export interface ElasticSansUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -159,6 +183,7 @@ export type ElasticSansUpdateResponse = ElasticSan; export interface ElasticSanUpdate { baseSizeTiB?: number; extendedCapacitySizeTiB?: number; + publicNetworkAccess?: PublicNetworkAccess; tags?: { [propertyName: string]: string; }; @@ -174,19 +199,19 @@ export interface ErrorAdditionalInfo { } // @public -export interface ErrorModel { - error?: ErrorResponse; -} - -// @public -export interface ErrorResponse { +export interface ErrorDetail { readonly additionalInfo?: ErrorAdditionalInfo[]; readonly code?: string; - readonly details?: ErrorResponse[]; + readonly details?: ErrorDetail[]; readonly message?: string; readonly target?: string; } +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + // @public export function getContinuationToken(page: unknown): string | undefined; @@ -224,6 +249,14 @@ export enum KnownOperationalStatus { Updating = "Updating" } +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + Approved = "Approved", + Failed = "Failed", + Pending = "Pending", + Rejected = "Rejected" +} + // @public export enum KnownProvisioningStates { Canceled = "Canceled", @@ -236,6 +269,12 @@ export enum KnownProvisioningStates { Updating = "Updating" } +// @public +export enum KnownPublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled" +} + // @public export enum KnownSkuName { PremiumLRS = "Premium_LRS", @@ -273,9 +312,115 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption // @public export type OperationsListResponse = ElasticSanOperationListResult; +// @public +export interface PrivateEndpoinConnections { + beginDelete(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpoinConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpoinConnectionsDeleteOptionalParams): Promise; +} + +// @public +export interface PrivateEndpoinConnectionsDeleteHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface PrivateEndpoinConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export interface PrivateEndpointConnection extends Resource { + groupIds?: any[]; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + readonly provisioningState?: ProvisioningStates; +} + +// @public +export interface PrivateEndpointConnectionList { + readonly nextLink?: string; + value?: PrivateEndpointConnection[]; +} + +// @public +export interface PrivateEndpointConnections { + beginCreate(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise, PrivateEndpointConnectionsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionsCreateOptionalParams): Promise; + get(resourceGroupName: string, elasticSanName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + list(resourceGroupName: string, elasticSanName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateEndpointConnectionsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +// @public +export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionList; + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export interface PrivateLinkResource extends ResourceAutoGenerated { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +} + +// @public +export interface PrivateLinkResourceListResult { + readonly nextLink?: string; + value?: PrivateLinkResource[]; +} + +// @public +export interface PrivateLinkResources { + listByElasticSan(resourceGroupName: string, elasticSanName: string, options?: PrivateLinkResourcesListByElasticSanOptionalParams): Promise; +} + +// @public +export interface PrivateLinkResourcesListByElasticSanOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateLinkResourcesListByElasticSanResponse = PrivateLinkResourceListResult; + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + // @public export type ProvisioningStates = string; +// @public +export type PublicNetworkAccess = string; + // @public export interface Resource { readonly id?: string; @@ -286,6 +431,14 @@ export interface Resource { readonly type?: string; } +// @public +export interface ResourceAutoGenerated { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + // @public export interface Sku { name: SkuName; @@ -381,10 +534,15 @@ export interface Volume extends Resource { readonly volumeId?: string; } +// @public +export interface VolumeCreateParameter extends Volume { +} + // @public export interface VolumeGroup extends Resource { encryption?: EncryptionType; networkAcls?: NetworkRuleSet; + readonly privateEndpointConnections?: PrivateEndpointConnectionList; protocolType?: StorageTargetType; readonly provisioningState?: ProvisioningStates; readonly systemData?: SystemData; @@ -393,16 +551,16 @@ export interface VolumeGroup extends Resource { // @public export interface VolumeGroupList { readonly nextLink?: string; - value: VolumeGroup[]; + value?: VolumeGroup[]; } // @public export interface VolumeGroups { - beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): Promise, VolumeGroupsCreateResponse>>; + beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): Promise, VolumeGroupsCreateResponse>>; beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): Promise, VolumeGroupsUpdateResponse>>; + beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): Promise, VolumeGroupsUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams): Promise; get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsGetOptionalParams): Promise; listByElasticSan(resourceGroupName: string, elasticSanName: string, options?: VolumeGroupsListByElasticSanOptionalParams): PagedAsyncIterableIterator; @@ -417,6 +575,12 @@ export interface VolumeGroupsCreateOptionalParams extends coreClient.OperationOp // @public export type VolumeGroupsCreateResponse = VolumeGroup; +// @public +export interface VolumeGroupsDeleteHeaders { + // (undocumented) + location?: string; +} + // @public export interface VolumeGroupsDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -444,6 +608,12 @@ export interface VolumeGroupsListByElasticSanOptionalParams extends coreClient.O // @public export type VolumeGroupsListByElasticSanResponse = VolumeGroupList; +// @public +export interface VolumeGroupsUpdateHeaders { + // (undocumented) + location?: string; +} + // @public export interface VolumeGroupsUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -466,16 +636,16 @@ export interface VolumeGroupUpdate { // @public export interface VolumeList { readonly nextLink?: string; - value: Volume[]; + value?: Volume[]; } // @public export interface Volumes { - beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): Promise, VolumesCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: Volume, options?: VolumesCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise, void>>; + beginCreate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeCreateParameter, options?: VolumesCreateOptionalParams): Promise, VolumesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeCreateParameter, options?: VolumesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): Promise, VolumesUpdateResponse>>; + beginUpdate(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): Promise, VolumesUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams): Promise; get(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, volumeName: string, options?: VolumesGetOptionalParams): Promise; listByVolumeGroup(resourceGroupName: string, elasticSanName: string, volumeGroupName: string, options?: VolumesListByVolumeGroupOptionalParams): PagedAsyncIterableIterator; @@ -490,6 +660,12 @@ export interface VolumesCreateOptionalParams extends coreClient.OperationOptions // @public export type VolumesCreateResponse = Volume; +// @public +export interface VolumesDeleteHeaders { + // (undocumented) + location?: string; +} + // @public export interface VolumesDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -517,6 +693,12 @@ export interface VolumesListByVolumeGroupOptionalParams extends coreClient.Opera // @public export type VolumesListByVolumeGroupResponse = VolumeList; +// @public +export interface VolumesUpdateHeaders { + // (undocumented) + location?: string; +} + // @public export interface VolumesUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; diff --git a/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts index edc5ac0b78f7..38de5c5d9ef2 100644 --- a/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts +++ b/sdk/elasticsans/arm-elasticsan/src/elasticSanManagement.ts @@ -19,14 +19,20 @@ import { SkusImpl, ElasticSansImpl, VolumeGroupsImpl, - VolumesImpl + VolumesImpl, + PrivateEndpointConnectionsImpl, + PrivateEndpoinConnectionsImpl, + PrivateLinkResourcesImpl } from "./operations"; import { Operations, Skus, ElasticSans, VolumeGroups, - Volumes + Volumes, + PrivateEndpointConnections, + PrivateEndpoinConnections, + PrivateLinkResources } from "./operationsInterfaces"; import { ElasticSanManagementOptionalParams } from "./models"; @@ -115,12 +121,15 @@ export class ElasticSanManagement extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-11-20-preview"; + this.apiVersion = options.apiVersion || "2022-12-01-preview"; this.operations = new OperationsImpl(this); this.skus = new SkusImpl(this); this.elasticSans = new ElasticSansImpl(this); this.volumeGroups = new VolumeGroupsImpl(this); this.volumes = new VolumesImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.privateEndpoinConnections = new PrivateEndpoinConnectionsImpl(this); + this.privateLinkResources = new PrivateLinkResourcesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -157,4 +166,7 @@ export class ElasticSanManagement extends coreClient.ServiceClient { elasticSans: ElasticSans; volumeGroups: VolumeGroups; volumes: Volumes; + privateEndpointConnections: PrivateEndpointConnections; + privateEndpoinConnections: PrivateEndpoinConnections; + privateLinkResources: PrivateLinkResources; } diff --git a/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts b/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts +++ b/sdk/elasticsans/arm-elasticsan/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; } diff --git a/sdk/elasticsans/arm-elasticsan/src/models/index.ts b/sdk/elasticsans/arm-elasticsan/src/models/index.ts index 445e60454a70..7f01dbd0d08a 100644 --- a/sdk/elasticsans/arm-elasticsan/src/models/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/models/index.ts @@ -44,14 +44,14 @@ export interface ElasticSanOperationDisplay { description: string; } -/** The resource management error response. */ -export interface ErrorModel { - /** RP error response. */ - error?: ErrorResponse; +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; } -/** The resource management error response. */ -export interface ErrorResponse { +/** The error detail. */ +export interface ErrorDetail { /** * The error code. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -71,7 +71,7 @@ export interface ErrorResponse { * The error details. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: ErrorResponse[]; + readonly details?: ErrorDetail[]; /** * The error additional info. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -161,7 +161,7 @@ export interface SKUCapability { /** List of Elastic Sans */ export interface ElasticSanList { /** An array of Elastic San objects. */ - value: ElasticSan[]; + value?: ElasticSan[]; /** * URI to fetch the next section of the paginated response. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -177,20 +177,34 @@ export interface Sku { tier?: SkuTier; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; +/** List of Private Endpoints */ +export interface PrivateEndpointConnectionList { + /** An array of Private Endpoint Connection objects. */ + value?: PrivateEndpointConnection[]; + /** + * URI to fetch the next section of the paginated response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Response for PrivateEndpoint */ +export interface PrivateEndpoint { + /** + * The ARM identifier for Private Endpoint + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; +} + +/** Response for Private Link Service Connection state */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; } /** The resource model definition. */ @@ -214,6 +228,22 @@ export interface Resource { tags?: { [propertyName: string]: string }; } +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + /** Response for ElasticSan update request. */ export interface ElasticSanUpdate { /** Update tags */ @@ -222,12 +252,14 @@ export interface ElasticSanUpdate { baseSizeTiB?: number; /** Extended size of the Elastic San appliance in TiB. */ extendedCapacitySizeTiB?: number; + /** Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ + publicNetworkAccess?: PublicNetworkAccess; } /** List of Volume Groups */ export interface VolumeGroupList { /** An array of Volume Groups objects. */ - value: VolumeGroup[]; + value?: VolumeGroup[]; /** * URI to fetch the next section of the paginated response. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -311,7 +343,7 @@ export interface VolumeUpdate { /** List of Volumes */ export interface VolumeList { /** An array of Volume objects. */ - value: Volume[]; + value?: Volume[]; /** * URI to fetch the next section of the paginated response. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -319,6 +351,56 @@ export interface VolumeList { readonly nextLink?: string; } +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** Array of private link resources */ + value?: PrivateLinkResource[]; + /** + * URI to fetch the next section of the paginated response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface ResourceAutoGenerated { + /** + * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Response for PrivateEndpoint Connection object */ +export interface PrivateEndpointConnection extends Resource { + /** + * Provisioning State of Private Endpoint connection resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningStates; + /** Private Endpoint resource */ + privateEndpoint?: PrivateEndpoint; + /** Private Link Service Connection State. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** List of resources private endpoint is mapped */ + groupIds?: any[]; +} + /** The resource model definition for a ARM tracked top level resource. */ export interface TrackedResource extends Resource { /** The geo-location where the resource lives. */ @@ -343,6 +425,11 @@ export interface VolumeGroup extends Resource { encryption?: EncryptionType; /** A collection of rules governing the accessibility from specific network locations. */ networkAcls?: NetworkRuleSet; + /** + * The list of Private Endpoint Connections. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnectionList; } /** Response for Volume request. */ @@ -368,6 +455,22 @@ export interface Volume extends Resource { readonly storageTarget?: IscsiTargetInfo; } +/** A private link resource */ +export interface PrivateLinkResource extends ResourceAutoGenerated { + /** + * The private link resource group id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupId?: string; + /** + * The private link resource required member names. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredMembers?: string[]; + /** The private link resource Private link DNS zone name. */ + requiredZoneNames?: string[]; +} + /** Response for ElasticSan request. */ export interface ElasticSan extends TrackedResource { /** @@ -376,7 +479,7 @@ export interface ElasticSan extends TrackedResource { */ readonly systemData?: SystemData; /** resource sku */ - sku: Sku; + sku?: Sku; /** Logical zone for Elastic San resource; example: ["1"]. */ availabilityZones?: string[]; /** @@ -385,9 +488,9 @@ export interface ElasticSan extends TrackedResource { */ readonly provisioningState?: ProvisioningStates; /** Base size of the Elastic San appliance in TiB. */ - baseSizeTiB: number; + baseSizeTiB?: number; /** Extended size of the Elastic San appliance in TiB. */ - extendedCapacitySizeTiB: number; + extendedCapacitySizeTiB?: number; /** * Total size of the provisioned Volumes in GiB. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -413,6 +516,54 @@ export interface ElasticSan extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly totalSizeTiB?: number; + /** + * The list of Private Endpoint Connections. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnectionList; + /** Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. */ + publicNetworkAccess?: PublicNetworkAccess; +} + +/** Response for Volume request. */ +export interface VolumeCreateParameter extends Volume {} + +/** Input Parameter for ElasticSan request. */ +export interface ElasticSanCreateParameter extends ElasticSan {} + +/** Defines headers for ElasticSans_update operation. */ +export interface ElasticSansUpdateHeaders { + location?: string; +} + +/** Defines headers for ElasticSans_delete operation. */ +export interface ElasticSansDeleteHeaders { + location?: string; +} + +/** Defines headers for VolumeGroups_update operation. */ +export interface VolumeGroupsUpdateHeaders { + location?: string; +} + +/** Defines headers for VolumeGroups_delete operation. */ +export interface VolumeGroupsDeleteHeaders { + location?: string; +} + +/** Defines headers for Volumes_update operation. */ +export interface VolumesUpdateHeaders { + location?: string; +} + +/** Defines headers for Volumes_delete operation. */ +export interface VolumesDeleteHeaders { + location?: string; +} + +/** Defines headers for PrivateEndpoinConnections_delete operation. */ +export interface PrivateEndpoinConnectionsDeleteHeaders { + location?: string; } /** Known values of {@link SkuName} that the service accepts. */ @@ -484,6 +635,48 @@ export enum KnownProvisioningStates { */ export type ProvisioningStates = string; +/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Failed */ + Failed = "Failed", + /** Rejected */ + Rejected = "Rejected" +} + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Failed** \ + * **Rejected** + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** Known values of {@link PublicNetworkAccess} that the service accepts. */ +export enum KnownPublicNetworkAccess { + /** Enabled */ + Enabled = "Enabled", + /** Disabled */ + Disabled = "Disabled" +} + +/** + * Defines values for PublicNetworkAccess. \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled** \ + * **Disabled** + */ +export type PublicNetworkAccess = string; + /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { /** User */ @@ -775,6 +968,48 @@ export interface VolumesListByVolumeGroupNextOptionalParams /** Contains response data for the listByVolumeGroupNext operation. */ export type VolumesListByVolumeGroupNextResponse = VolumeList; +/** Optional parameters. */ +export interface PrivateEndpointConnectionsCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type PrivateEndpointConnectionsCreateResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionList; + +/** Optional parameters. */ +export interface PrivateEndpoinConnectionsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByElasticSanOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByElasticSan operation. */ +export type PrivateLinkResourcesListByElasticSanResponse = PrivateLinkResourceListResult; + /** Optional parameters. */ export interface ElasticSanManagementOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts b/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts index 38f580a3bd57..80399886250c 100644 --- a/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts +++ b/sdk/elasticsans/arm-elasticsan/src/models/mappers.ts @@ -103,26 +103,26 @@ export const ElasticSanOperationDisplay: coreClient.CompositeMapper = { } }; -export const ErrorModel: coreClient.CompositeMapper = { +export const ErrorResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorModel", + className: "ErrorResponse", modelProperties: { error: { serializedName: "error", type: { name: "Composite", - className: "ErrorResponse" + className: "ErrorDetail" } } } } }; -export const ErrorResponse: coreClient.CompositeMapper = { +export const ErrorDetail: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorResponse", + className: "ErrorDetail", modelProperties: { code: { serializedName: "code", @@ -153,7 +153,7 @@ export const ErrorResponse: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorResponse" + className: "ErrorDetail" } } } @@ -346,7 +346,6 @@ export const ElasticSanList: coreClient.CompositeMapper = { modelProperties: { value: { serializedName: "value", - required: true, type: { name: "Sequence", element: { @@ -390,45 +389,71 @@ export const Sku: coreClient.CompositeMapper = { } }; -export const SystemData: coreClient.CompositeMapper = { +export const PrivateEndpointConnectionList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "PrivateEndpointConnectionList", modelProperties: { - createdBy: { - serializedName: "createdBy", + value: { + serializedName: "value", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } } }, - createdByType: { - serializedName: "createdByType", + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { name: "String" } - }, - createdAt: { - serializedName: "createdAt", + } + } + } +}; + +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, type: { - name: "DateTime" + name: "String" } - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + } + } + } +}; + +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", type: { name: "String" } }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + description: { + serializedName: "description", type: { name: "String" } }, - lastModifiedAt: { - serializedName: "lastModifiedAt", + actionsRequired: { + serializedName: "actionsRequired", type: { - name: "DateTime" + name: "String" } } } @@ -472,6 +497,51 @@ export const Resource: coreClient.CompositeMapper = { } }; +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + export const ElasticSanUpdate: coreClient.CompositeMapper = { type: { name: "Composite", @@ -495,6 +565,12 @@ export const ElasticSanUpdate: coreClient.CompositeMapper = { type: { name: "Number" } + }, + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + type: { + name: "String" + } } } } @@ -507,7 +583,6 @@ export const VolumeGroupList: coreClient.CompositeMapper = { modelProperties: { value: { serializedName: "value", - required: true, type: { name: "Sequence", element: { @@ -718,7 +793,6 @@ export const VolumeList: coreClient.CompositeMapper = { modelProperties: { value: { serializedName: "value", - required: true, type: { name: "Sequence", element: { @@ -740,6 +814,113 @@ export const VolumeList: coreClient.CompositeMapper = { } }; +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ResourceAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceAutoGenerated", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...Resource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + groupIds: { + serializedName: "properties.groupIds", + type: { + name: "Sequence", + element: { + type: { + name: "any" + } + } + } + } + } + } +}; + export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -794,6 +975,13 @@ export const VolumeGroup: coreClient.CompositeMapper = { name: "Composite", className: "NetworkRuleSet" } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + type: { + name: "Composite", + className: "PrivateEndpointConnectionList" + } } } } @@ -843,6 +1031,46 @@ export const Volume: coreClient.CompositeMapper = { } }; +export const PrivateLinkResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + ...ResourceAutoGenerated.type.modelProperties, + groupId: { + serializedName: "properties.groupId", + readOnly: true, + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "properties.requiredMembers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "properties.requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + export const ElasticSan: coreClient.CompositeMapper = { type: { name: "Composite", @@ -883,14 +1111,12 @@ export const ElasticSan: coreClient.CompositeMapper = { }, baseSizeTiB: { serializedName: "properties.baseSizeTiB", - required: true, type: { name: "Number" } }, extendedCapacitySizeTiB: { serializedName: "properties.extendedCapacitySizeTiB", - required: true, type: { name: "Number" } @@ -929,6 +1155,144 @@ export const ElasticSan: coreClient.CompositeMapper = { type: { name: "Number" } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + type: { + name: "Composite", + className: "PrivateEndpointConnectionList" + } + }, + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", + type: { + name: "String" + } + } + } + } +}; + +export const VolumeCreateParameter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeCreateParameter", + modelProperties: { + ...Volume.type.modelProperties + } + } +}; + +export const ElasticSanCreateParameter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSanCreateParameter", + modelProperties: { + ...ElasticSan.type.modelProperties + } + } +}; + +export const ElasticSansUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSansUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ElasticSansDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ElasticSansDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VolumeGroupsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroupsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VolumeGroupsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumeGroupsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VolumesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumesUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const VolumesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "VolumesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpoinConnectionsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoinConnectionsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } } } } diff --git a/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts b/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts index ec72b4d23c3a..0d71e3fd4bad 100644 --- a/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts +++ b/sdk/elasticsans/arm-elasticsan/src/models/parameters.ts @@ -12,12 +12,13 @@ import { OperationQueryParameter } from "@azure/core-client"; import { - ElasticSan as ElasticSanMapper, + ElasticSanCreateParameter as ElasticSanCreateParameterMapper, ElasticSanUpdate as ElasticSanUpdateMapper, VolumeGroup as VolumeGroupMapper, VolumeGroupUpdate as VolumeGroupUpdateMapper, - Volume as VolumeMapper, - VolumeUpdate as VolumeUpdateMapper + VolumeCreateParameter as VolumeCreateParameterMapper, + VolumeUpdate as VolumeUpdateMapper, + PrivateEndpointConnection as PrivateEndpointConnectionMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -47,7 +48,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-11-20-preview", + defaultValue: "2022-12-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -84,7 +85,6 @@ export const resourceGroupName: OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { constraints: { - Pattern: new RegExp("^[-\\w\\._]*[0-9A-Za-z]$"), MaxLength: 90, MinLength: 1 }, @@ -110,7 +110,7 @@ export const contentType: OperationParameter = { export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: ElasticSanMapper + mapper: ElasticSanCreateParameterMapper }; export const elasticSanName: OperationURLParameter = { @@ -174,7 +174,7 @@ export const parameters3: OperationParameter = { export const parameters4: OperationParameter = { parameterPath: "parameters", - mapper: VolumeMapper + mapper: VolumeCreateParameterMapper }; export const volumeName: OperationURLParameter = { @@ -197,3 +197,19 @@ export const parameters5: OperationParameter = { parameterPath: "parameters", mapper: VolumeUpdateMapper }; + +export const parameters6: OperationParameter = { + parameterPath: "parameters", + mapper: PrivateEndpointConnectionMapper +}; + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + serializedName: "privateEndpointConnectionName", + required: true, + type: { + name: "String" + } + } +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts b/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts index 1ffcd918cf3d..96808c45970f 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operations/elasticSans.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ElasticSanManagement } from "../elasticSanManagement"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { ElasticSan, ElasticSansListBySubscriptionNextOptionalParams, @@ -23,6 +27,7 @@ import { ElasticSansListByResourceGroupNextOptionalParams, ElasticSansListByResourceGroupOptionalParams, ElasticSansListByResourceGroupResponse, + ElasticSanCreateParameter, ElasticSansCreateOptionalParams, ElasticSansCreateResponse, ElasticSanUpdate, @@ -209,11 +214,11 @@ export class ElasticSansImpl implements ElasticSans { async beginCreate( resourceGroupName: string, elasticSanName: string, - parameters: ElasticSan, + parameters: ElasticSanCreateParameter, options?: ElasticSansCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ElasticSansCreateResponse > > { @@ -223,7 +228,7 @@ export class ElasticSansImpl implements ElasticSans { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -256,15 +261,18 @@ export class ElasticSansImpl implements ElasticSans { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, elasticSanName, parameters, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, elasticSanName, parameters, options }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + ElasticSansCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -280,7 +288,7 @@ export class ElasticSansImpl implements ElasticSans { async beginCreateAndWait( resourceGroupName: string, elasticSanName: string, - parameters: ElasticSan, + parameters: ElasticSanCreateParameter, options?: ElasticSansCreateOptionalParams ): Promise { const poller = await this.beginCreate( @@ -305,8 +313,8 @@ export class ElasticSansImpl implements ElasticSans { parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ElasticSansUpdateResponse > > { @@ -316,7 +324,7 @@ export class ElasticSansImpl implements ElasticSans { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -349,15 +357,18 @@ export class ElasticSansImpl implements ElasticSans { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, elasticSanName, parameters, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, elasticSanName, parameters, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + ElasticSansUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -395,14 +406,14 @@ export class ElasticSansImpl implements ElasticSans { resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -435,15 +446,15 @@ export class ElasticSansImpl implements ElasticSans { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, elasticSanName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, elasticSanName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -529,7 +540,7 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ElasticSanList }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], @@ -546,7 +557,7 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ElasticSanList }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], @@ -576,7 +587,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ElasticSan }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters, @@ -609,7 +620,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ElasticSan }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters1, @@ -634,7 +645,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], @@ -656,7 +667,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ElasticSan }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], @@ -677,7 +688,7 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ElasticSanList }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, urlParameters: [ @@ -696,7 +707,7 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ElasticSanList }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, urlParameters: [ diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/index.ts b/sdk/elasticsans/arm-elasticsan/src/operations/index.ts index 75c3aa932129..1955ca863e46 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operations/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operations/index.ts @@ -11,3 +11,6 @@ export * from "./skus"; export * from "./elasticSans"; export * from "./volumeGroups"; export * from "./volumes"; +export * from "./privateEndpointConnections"; +export * from "./privateEndpoinConnections"; +export * from "./privateLinkResources"; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts b/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts index 742f2e5dee24..99c9832682ad 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operations/operations.ts @@ -93,7 +93,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ElasticSanOperationListResult }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpoinConnections.ts b/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpoinConnections.ts new file mode 100644 index 000000000000..3ca12dc28bcb --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpoinConnections.ts @@ -0,0 +1,154 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PrivateEndpoinConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ElasticSanManagement } from "../elasticSanManagement"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { PrivateEndpoinConnectionsDeleteOptionalParams } from "../models"; + +/** Class containing PrivateEndpoinConnections operations. */ +export class PrivateEndpoinConnectionsImpl + implements PrivateEndpoinConnections { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class PrivateEndpoinConnections class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpoinConnectionsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + options + }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpoinConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts b/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..12b992292e6b --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/privateEndpointConnections.ts @@ -0,0 +1,332 @@ +/* + * 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 { PrivateEndpointConnections } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ElasticSanManagement } from "../elasticSanManagement"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + PrivateEndpointConnection, + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsListResponse, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsCreateResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse +} from "../models"; + +/// +/** Class containing PrivateEndpointConnections operations. */ +export class PrivateEndpointConnectionsImpl + implements PrivateEndpointConnections { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class PrivateEndpointConnections class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, elasticSanName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + elasticSanName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + _settings?: PageSettings + ): AsyncIterableIterator { + let result: PrivateEndpointConnectionsListResponse; + result = await this._list(resourceGroupName, elasticSanName, options); + yield result.value || []; + } + + private async *listPagingAll( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + elasticSanName, + options + )) { + yield* page; + } + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval object. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PrivateEndpointConnectionsCreateResponse + > + > { + 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, + elasticSanName, + privateEndpointConnectionName, + parameters, + options + }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval object. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + elasticSanName, + privateEndpointConnectionName, + options + }, + getOperationSpec + ); + } + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, options }, + listOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 204: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts b/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..cc8ec2b5c43b --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operations/privateLinkResources.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PrivateLinkResources } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ElasticSanManagement } from "../elasticSanManagement"; +import { + PrivateLinkResourcesListByElasticSanOptionalParams, + PrivateLinkResourcesListByElasticSanResponse +} from "../models"; + +/** Class containing PrivateLinkResources operations. */ +export class PrivateLinkResourcesImpl implements PrivateLinkResources { + private readonly client: ElasticSanManagement; + + /** + * Initialize a new instance of the class PrivateLinkResources class. + * @param client Reference to the service client + */ + constructor(client: ElasticSanManagement) { + this.client = client; + } + + /** + * Gets the private link resources that need to be created for a elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + listByElasticSan( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateLinkResourcesListByElasticSanOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, elasticSanName, options }, + listByElasticSanOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByElasticSanOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateLinkResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.elasticSanName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts b/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts index 523f5fac207e..542f7cf746fa 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operations/skus.ts @@ -91,7 +91,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SkuInformationList }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion, Parameters.filter], diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts index 78b778a11144..9908eda3da9b 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operations/volumeGroups.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ElasticSanManagement } from "../elasticSanManagement"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { VolumeGroup, VolumeGroupsListByElasticSanNextOptionalParams, @@ -160,8 +164,8 @@ export class VolumeGroupsImpl implements VolumeGroups { parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, VolumeGroupsCreateResponse > > { @@ -171,7 +175,7 @@ export class VolumeGroupsImpl implements VolumeGroups { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -204,21 +208,24 @@ export class VolumeGroupsImpl implements VolumeGroups { }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, elasticSanName, volumeGroupName, parameters, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + VolumeGroupsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -264,8 +271,8 @@ export class VolumeGroupsImpl implements VolumeGroups { parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, VolumeGroupsUpdateResponse > > { @@ -275,7 +282,7 @@ export class VolumeGroupsImpl implements VolumeGroups { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -308,21 +315,24 @@ export class VolumeGroupsImpl implements VolumeGroups { }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, elasticSanName, volumeGroupName, parameters, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + VolumeGroupsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -365,14 +375,14 @@ export class VolumeGroupsImpl implements VolumeGroups { elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -405,15 +415,15 @@ export class VolumeGroupsImpl implements VolumeGroups { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, elasticSanName, volumeGroupName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, elasticSanName, volumeGroupName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -491,7 +501,7 @@ const listByElasticSanOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.VolumeGroupList }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], @@ -522,7 +532,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.VolumeGroup }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters2, @@ -556,7 +566,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.VolumeGroup }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters3, @@ -582,7 +592,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], @@ -605,7 +615,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.VolumeGroup }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], @@ -627,7 +637,7 @@ const listByElasticSanNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.VolumeGroupList }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, urlParameters: [ diff --git a/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts b/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts index e9440e979ef6..0aa7234e8cc7 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operations/volumes.ts @@ -13,13 +13,18 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ElasticSanManagement } from "../elasticSanManagement"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Volume, VolumesListByVolumeGroupNextOptionalParams, VolumesListByVolumeGroupOptionalParams, VolumesListByVolumeGroupResponse, + VolumeCreateParameter, VolumesCreateOptionalParams, VolumesCreateResponse, VolumeUpdate, @@ -151,10 +156,13 @@ export class VolumesImpl implements Volumes { elasticSanName: string, volumeGroupName: string, volumeName: string, - parameters: Volume, + parameters: VolumeCreateParameter, options?: VolumesCreateOptionalParams ): Promise< - PollerLike, VolumesCreateResponse> + SimplePollerLike< + OperationState, + VolumesCreateResponse + > > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -162,7 +170,7 @@ export class VolumesImpl implements Volumes { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -195,9 +203,9 @@ export class VolumesImpl implements Volumes { }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, elasticSanName, volumeGroupName, @@ -205,12 +213,15 @@ export class VolumesImpl implements Volumes { parameters, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + VolumesCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -230,7 +241,7 @@ export class VolumesImpl implements Volumes { elasticSanName: string, volumeGroupName: string, volumeName: string, - parameters: Volume, + parameters: VolumeCreateParameter, options?: VolumesCreateOptionalParams ): Promise { const poller = await this.beginCreate( @@ -261,7 +272,10 @@ export class VolumesImpl implements Volumes { parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams ): Promise< - PollerLike, VolumesUpdateResponse> + SimplePollerLike< + OperationState, + VolumesUpdateResponse + > > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -269,7 +283,7 @@ export class VolumesImpl implements Volumes { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -302,9 +316,9 @@ export class VolumesImpl implements Volumes { }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, elasticSanName, volumeGroupName, @@ -312,12 +326,15 @@ export class VolumesImpl implements Volumes { parameters, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + VolumesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -365,14 +382,14 @@ export class VolumesImpl implements Volumes { volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -405,21 +422,21 @@ export class VolumesImpl implements Volumes { }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, elasticSanName, volumeGroupName, volumeName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -538,7 +555,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Volume }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters4, @@ -573,7 +590,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Volume }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters5, @@ -600,7 +617,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], @@ -624,7 +641,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.Volume }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], @@ -648,7 +665,7 @@ const listByVolumeGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.VolumeList }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, queryParameters: [Parameters.apiVersion], @@ -670,7 +687,7 @@ const listByVolumeGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.VolumeList }, default: { - bodyMapper: Mappers.ErrorModel + bodyMapper: Mappers.ErrorResponse } }, urlParameters: [ diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts index c4ffc1b81409..431fc0603ce1 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/elasticSans.ts @@ -7,11 +7,12 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { ElasticSan, ElasticSansListBySubscriptionOptionalParams, ElasticSansListByResourceGroupOptionalParams, + ElasticSanCreateParameter, ElasticSansCreateOptionalParams, ElasticSansCreateResponse, ElasticSanUpdate, @@ -51,11 +52,11 @@ export interface ElasticSans { beginCreate( resourceGroupName: string, elasticSanName: string, - parameters: ElasticSan, + parameters: ElasticSanCreateParameter, options?: ElasticSansCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ElasticSansCreateResponse > >; @@ -69,7 +70,7 @@ export interface ElasticSans { beginCreateAndWait( resourceGroupName: string, elasticSanName: string, - parameters: ElasticSan, + parameters: ElasticSanCreateParameter, options?: ElasticSansCreateOptionalParams ): Promise; /** @@ -85,8 +86,8 @@ export interface ElasticSans { parameters: ElasticSanUpdate, options?: ElasticSansUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, ElasticSansUpdateResponse > >; @@ -113,7 +114,7 @@ export interface ElasticSans { resourceGroupName: string, elasticSanName: string, options?: ElasticSansDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Delete a Elastic San. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts index 75c3aa932129..1955ca863e46 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/index.ts @@ -11,3 +11,6 @@ export * from "./skus"; export * from "./elasticSans"; export * from "./volumeGroups"; export * from "./volumes"; +export * from "./privateEndpointConnections"; +export * from "./privateEndpoinConnections"; +export * from "./privateLinkResources"; diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpoinConnections.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpoinConnections.ts new file mode 100644 index 000000000000..00143e864b42 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpoinConnections.ts @@ -0,0 +1,40 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { PrivateEndpoinConnectionsDeleteOptionalParams } from "../models"; + +/** Interface representing a PrivateEndpoinConnections. */ +export interface PrivateEndpoinConnections { + /** + * Deletes the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpoinConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpoinConnectionsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts new file mode 100644 index 000000000000..a8b236ef1956 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateEndpointConnections.ts @@ -0,0 +1,82 @@ +/* + * 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 { + PrivateEndpointConnection, + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsCreateOptionalParams, + PrivateEndpointConnectionsCreateResponse, + PrivateEndpointConnectionsGetOptionalParams, + PrivateEndpointConnectionsGetResponse +} from "../models"; + +/// +/** Interface representing a PrivateEndpointConnections. */ +export interface PrivateEndpointConnections { + /** + * List all Private Endpoint Connections associated with the Elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateEndpointConnectionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Update the state of specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval object. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PrivateEndpointConnectionsCreateResponse + > + >; + /** + * Update the state of specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval object. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsCreateOptionalParams + ): Promise; + /** + * Gets the specified private endpoint connection associated with the Elastic San + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + elasticSanName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts new file mode 100644 index 000000000000..e0c8f6478694 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/privateLinkResources.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + PrivateLinkResourcesListByElasticSanOptionalParams, + PrivateLinkResourcesListByElasticSanResponse +} from "../models"; + +/** Interface representing a PrivateLinkResources. */ +export interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a elastic San. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param options The options parameters. + */ + listByElasticSan( + resourceGroupName: string, + elasticSanName: string, + options?: PrivateLinkResourcesListByElasticSanOptionalParams + ): Promise; +} diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts index c8430eee2609..6048463395f2 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumeGroups.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { VolumeGroup, VolumeGroupsListByElasticSanOptionalParams, @@ -50,8 +50,8 @@ export interface VolumeGroups { parameters: VolumeGroup, options?: VolumeGroupsCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, VolumeGroupsCreateResponse > >; @@ -85,8 +85,8 @@ export interface VolumeGroups { parameters: VolumeGroupUpdate, options?: VolumeGroupsUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, VolumeGroupsUpdateResponse > >; @@ -117,7 +117,7 @@ export interface VolumeGroups { elasticSanName: string, volumeGroupName: string, options?: VolumeGroupsDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Delete an VolumeGroup. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts index a6bd659e778d..2c8d7f3d6177 100644 --- a/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts +++ b/sdk/elasticsans/arm-elasticsan/src/operationsInterfaces/volumes.ts @@ -7,10 +7,11 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Volume, VolumesListByVolumeGroupOptionalParams, + VolumeCreateParameter, VolumesCreateOptionalParams, VolumesCreateResponse, VolumeUpdate, @@ -51,10 +52,13 @@ export interface Volumes { elasticSanName: string, volumeGroupName: string, volumeName: string, - parameters: Volume, + parameters: VolumeCreateParameter, options?: VolumesCreateOptionalParams ): Promise< - PollerLike, VolumesCreateResponse> + SimplePollerLike< + OperationState, + VolumesCreateResponse + > >; /** * Create a Volume. @@ -70,7 +74,7 @@ export interface Volumes { elasticSanName: string, volumeGroupName: string, volumeName: string, - parameters: Volume, + parameters: VolumeCreateParameter, options?: VolumesCreateOptionalParams ): Promise; /** @@ -90,7 +94,10 @@ export interface Volumes { parameters: VolumeUpdate, options?: VolumesUpdateOptionalParams ): Promise< - PollerLike, VolumesUpdateResponse> + SimplePollerLike< + OperationState, + VolumesUpdateResponse + > >; /** * Update an Volume. @@ -123,7 +130,7 @@ export interface Volumes { volumeGroupName: string, volumeName: string, options?: VolumesDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Delete an Volume. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/elasticsans/arm-elasticsan/test/sampleTest.ts b/sdk/elasticsans/arm-elasticsan/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/elasticsans/arm-elasticsan/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/elasticsans/arm-elasticsan/tsconfig.json b/sdk/elasticsans/arm-elasticsan/tsconfig.json index a25947875abf..3e6ae96443f3 100644 --- a/sdk/elasticsans/arm-elasticsan/tsconfig.json +++ b/sdk/elasticsans/arm-elasticsan/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-elasticsan": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"