diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 5603c042c148..56943e78fec8 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -734,6 +734,7 @@ packages: /@azure/ai-form-recognizer/3.1.0-beta.3: resolution: {integrity: sha512-+4QtFKNyxAmdqpcYjuAtmWKm/MuOe9kZsbpS9jA9h0YHzngNj5gc67AA4egV9BXOq9x+1phjYTNC/rxiOUr1uQ==} engines: {node: '>=8.0.0'} + deprecated: Please migrate to a supported (non-beta) version of this package dependencies: '@azure/core-auth': 1.4.0 '@azure/core-http': 1.2.6 @@ -11273,7 +11274,7 @@ packages: dev: false file:projects/arm-databox.tgz: - resolution: {integrity: sha512-cSpN/j/KLv/pHkvk/DIbWoHlSxNgNjKRsmpV06Lr30DeInDovE+dpuqcQZ9CSz4lI7aRK0JWszBrqMRYs3FYyw==, tarball: file:projects/arm-databox.tgz} + resolution: {integrity: sha512-/Yl31bWy5Lo4d2h8ET2nXmwrkr/ZfNgHi13yvD/SLzQNN1iJ4D7ZNT68Sb6pxk3GGyECUgInDOppBf9Xjx7MCw==, tarball: file:projects/arm-databox.tgz} name: '@rush-temp/arm-databox' version: 0.0.0 dependencies: @@ -11287,7 +11288,8 @@ packages: '@types/node': 14.18.38 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.5 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 diff --git a/sdk/databox/arm-databox/CHANGELOG.md b/sdk/databox/arm-databox/CHANGELOG.md index 5ea6213a7470..5e4135f27434 100644 --- a/sdk/databox/arm-databox/CHANGELOG.md +++ b/sdk/databox/arm-databox/CHANGELOG.md @@ -1,18 +1,8 @@ # Release History + +## 5.0.0 (2023-03-27) -## 5.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 5.0.0-beta.3 (2022-11-18) - -The package of @azure/arm-databox is using our next generation design principles since version 5.0.0-beta.3, which contains breaking changes. +The package of @azure/arm-databox is using our next generation design principles since version 5.0.0, which contains breaking changes. To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). diff --git a/sdk/databox/arm-databox/LICENSE b/sdk/databox/arm-databox/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/databox/arm-databox/LICENSE +++ b/sdk/databox/arm-databox/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/databox/arm-databox/README.md b/sdk/databox/arm-databox/README.md index 12beff8c004c..6e21df8ea56c 100644 --- a/sdk/databox/arm-databox/README.md +++ b/sdk/databox/arm-databox/README.md @@ -6,7 +6,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databox/arm-databox) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-databox) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-databox?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-databox) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/databox/arm-databox/_meta.json b/sdk/databox/arm-databox/_meta.json index 38528c7be022..24221efb7bdb 100644 --- a/sdk/databox/arm-databox/_meta.json +++ b/sdk/databox/arm-databox/_meta.json @@ -1,8 +1,8 @@ { - "commit": "e6a2296d02ec6c4b2c32479198bfbcb9b16ea247", - "readme": "specification\\databox\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\databox\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", + "commit": "7f3c6aadf2c6d2e4a329f7209b0e4cb48cb9043a", + "readme": "specification/databox/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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/databox/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/databox/arm-databox/package.json b/sdk/databox/arm-databox/package.json index 764a942e3b49..8aee02480773 100644 --- a/sdk/databox/arm-databox/package.json +++ b/sdk/databox/arm-databox/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DataBoxManagementClient.", - "version": "5.0.0-beta.4", + "version": "5.0.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.0", "@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,12 +33,13 @@ "@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": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -49,7 +50,6 @@ "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databox/arm-databox", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -111,12 +111,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-databox?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databox/arm-databox" +} \ No newline at end of file diff --git a/sdk/databox/arm-databox/review/arm-databox.api.md b/sdk/databox/arm-databox/review/arm-databox.api.md index ec1c269d72df..3523098a15f9 100644 --- a/sdk/databox/arm-databox/review/arm-databox.api.md +++ b/sdk/databox/arm-databox/review/arm-databox.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 AccessProtocol = "SMB" | "NFS"; @@ -122,6 +122,14 @@ export interface ContactDetails { phoneExtension?: string; } +// @public +export interface ContactInfo { + contactName: string; + mobile?: string; + phone: string; + phoneExtension?: string; +} + // @public export interface CopyLogDetails { copyLogDetailsType: "DataBox" | "DataBoxCustomerDisk" | "DataBoxDisk" | "DataBoxHeavy"; @@ -133,9 +141,11 @@ export type CopyLogDetailsUnion = CopyLogDetails | DataBoxAccountCopyLogDetails // @public export interface CopyProgress { readonly accountId?: string; + readonly actions?: CustomerResolutionCode[]; readonly bytesProcessed?: number; readonly dataAccountType?: DataAccountType; readonly directoriesErroredOut?: number; + readonly error?: CloudError; readonly filesErroredOut?: number; readonly filesProcessed?: number; readonly invalidDirectoriesProcessed?: number; @@ -177,7 +187,7 @@ export interface CustomerDiskJobSecrets extends JobSecrets { } // @public -export type CustomerResolutionCode = "None" | "MoveToCleanUpDevice" | "Resume"; +export type CustomerResolutionCode = "None" | "MoveToCleanUpDevice" | "Resume" | "Restart" | "ReachOutToOperation"; // @public export interface DataAccountDetails { @@ -238,18 +248,37 @@ export interface DataBoxDiskCopyLogDetails extends CopyLogDetails { // @public export interface DataBoxDiskCopyProgress { + readonly actions?: CustomerResolutionCode[]; readonly bytesCopied?: number; + readonly error?: CloudError; readonly percentComplete?: number; readonly serialNumber?: string; readonly status?: CopyStatus; } +// @public +export interface DataBoxDiskGranularCopyLogDetails extends GranularCopyLogDetails { + readonly accountId?: string; + copyLogDetailsType: "DataBoxCustomerDisk"; + readonly errorLogLink?: string; + readonly serialNumber?: string; + readonly verboseLogLink?: string; +} + +// @public +export interface DataBoxDiskGranularCopyProgress extends GranularCopyProgress { + readonly copyStatus?: CopyStatus; + readonly serialNumber?: string; +} + // @public export interface DataBoxDiskJobDetails extends JobDetails { readonly copyProgress?: DataBoxDiskCopyProgress[]; readonly disksAndSizeDetails?: { [propertyName: string]: number; }; + readonly granularCopyLogDetails?: DataBoxDiskGranularCopyLogDetails[]; + readonly granularCopyProgress?: DataBoxDiskGranularCopyProgress[]; jobDetailsType: "DataBoxDisk"; passkey?: string; preferredDisks?: { @@ -441,6 +470,12 @@ export interface Details { message: string; } +// @public +export interface DeviceErasureDetails { + readonly deviceErasureStatus?: StageStatus; + readonly erasureOrDestructionCertificateSasKey?: string; +} + // @public export interface DiskScheduleAvailabilityRequest extends ScheduleAvailabilityRequest { expectedDataSizeInTeraBytes: number; @@ -492,6 +527,35 @@ export type FilterFileType = "AzureBlob" | "AzureFile"; // @public export function getContinuationToken(page: unknown): string | undefined; +// @public +export interface GranularCopyLogDetails { + copyLogDetailsType: "DataBoxCustomerDisk"; +} + +// @public (undocumented) +export type GranularCopyLogDetailsUnion = GranularCopyLogDetails | DataBoxDiskGranularCopyLogDetails; + +// @public +export interface GranularCopyProgress { + readonly accountId?: string; + readonly actions?: CustomerResolutionCode[]; + readonly bytesProcessed?: number; + readonly dataAccountType?: DataAccountType; + readonly directoriesErroredOut?: number; + readonly error?: CloudError; + readonly filesErroredOut?: number; + readonly filesProcessed?: number; + readonly invalidDirectoriesProcessed?: number; + readonly invalidFileBytesUploaded?: number; + readonly invalidFilesProcessed?: number; + readonly isEnumerationInProgress?: boolean; + readonly renamedContainerCount?: number; + readonly storageAccountName?: string; + readonly totalBytesToProcess?: number; + readonly totalFilesToProcess?: number; + readonly transferType?: TransferType; +} + // @public export interface HeavyScheduleAvailabilityRequest extends ScheduleAvailabilityRequest { skuName: "DataBoxHeavy"; @@ -530,6 +594,7 @@ export interface JobDetails { dataExportDetails?: DataExportDetails[]; dataImportDetails?: DataImportDetails[]; readonly deliveryPackage?: PackageShippingDetails; + readonly deviceErasureDetails?: DeviceErasureDetails; expectedDataSizeInTeraBytes?: number; jobDetailsType: "DataBoxCustomerDisk" | "DataBoxDisk" | "DataBoxHeavy" | "DataBox"; readonly jobStages?: JobStages[]; @@ -538,6 +603,7 @@ export interface JobDetails { preferences?: Preferences; readonly returnPackage?: PackageShippingDetails; readonly reverseShipmentLabelSasKey?: string; + reverseShippingDetails?: ReverseShippingDetails; shippingAddress?: ShippingAddress; } @@ -558,6 +624,8 @@ export interface JobResource extends Resource { readonly isPrepareToShipEnabled?: boolean; readonly isShippingAddressEditable?: boolean; readonly name?: string; + readonly reverseShippingDetailsUpdate?: ReverseShippingDetailsEditStatus; + readonly reverseTransportPreferenceUpdate?: ReverseTransportPreferenceEditStatus; readonly startTime?: Date; readonly status?: StageName; readonly systemData?: SystemData; @@ -582,11 +650,11 @@ export interface JobResourceUpdateParameter { // @public export interface Jobs { - beginCreate(resourceGroupName: string, jobName: string, jobResource: JobResource, options?: JobsCreateOptionalParams): Promise, JobsCreateResponse>>; + beginCreate(resourceGroupName: string, jobName: string, jobResource: JobResource, options?: JobsCreateOptionalParams): Promise, JobsCreateResponse>>; beginCreateAndWait(resourceGroupName: string, jobName: string, jobResource: JobResource, options?: JobsCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, jobName: string, options?: JobsDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, jobName: string, options?: JobsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, jobName: string, options?: JobsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: JobResourceUpdateParameter, options?: JobsUpdateOptionalParams): Promise, JobsUpdateResponse>>; + beginUpdate(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: JobResourceUpdateParameter, options?: JobsUpdateOptionalParams): Promise, JobsUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: JobResourceUpdateParameter, options?: JobsUpdateOptionalParams): Promise; bookShipmentPickUp(resourceGroupName: string, jobName: string, shipmentPickUpRequest: ShipmentPickUpRequest, options?: JobsBookShipmentPickUpOptionalParams): Promise; cancel(resourceGroupName: string, jobName: string, cancellationReason: CancellationReason, options?: JobsCancelOptionalParams): Promise; @@ -617,6 +685,11 @@ export interface JobsCreateOptionalParams extends coreClient.OperationOptions { // @public export type JobsCreateResponse = JobResource; +// @public +export interface JobsDeleteHeaders { + location?: string; +} + // @public export interface JobsDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -643,7 +716,6 @@ export type JobsGetResponse = JobResource; // @public export interface JobsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { - skipToken?: string; } // @public @@ -666,7 +738,6 @@ export type JobsListCredentialsResponse = UnencryptedCredentialsList; // @public export interface JobsListNextOptionalParams extends coreClient.OperationOptions { - skipToken?: string; } // @public @@ -693,6 +764,11 @@ export interface JobStages { readonly stageTime?: Date; } +// @public +export interface JobsUpdateHeaders { + location?: string; +} + // @public export interface JobsUpdateOptionalParams extends coreClient.OperationOptions { ifMatch?: string; @@ -744,9 +820,11 @@ export enum KnownDataCenterCode { AMS20 = "AMS20", AUH20 = "AUH20", BJB = "BJB", + BJS20 = "BJS20", BL20 = "BL20", BL7 = "BL7", BN1 = "BN1", + BN7 = "BN7", BOM01 = "BOM01", BY1 = "BY1", BY2 = "BY2", @@ -759,6 +837,7 @@ export enum KnownDataCenterCode { CWL20 = "CWL20", CYS04 = "CYS04", DSM05 = "DSM05", + DUB07 = "DUB07", FRA22 = "FRA22", HKG20 = "HKG20", Invalid = "Invalid", @@ -770,7 +849,11 @@ export enum KnownDataCenterCode { MNZ21 = "MNZ21", MWH01 = "MWH01", ORK70 = "ORK70", + OSA02 = "OSA02", OSA20 = "OSA20", + OSA22 = "OSA22", + PAR22 = "PAR22", + PNQ01 = "PNQ01", PUS20 = "PUS20", SEL20 = "SEL20", SEL21 = "SEL21", @@ -778,8 +861,10 @@ export enum KnownDataCenterCode { SHA03 = "SHA03", SIN20 = "SIN20", SN5 = "SN5", + SN6 = "SN6", SN8 = "SN8", SSE90 = "SSE90", + SVG20 = "SVG20", SYD03 = "SYD03", SYD23 = "SYD23", TYO01 = "TYO01", @@ -851,7 +936,10 @@ export interface MarkDevicesShippedRequest { // @public export interface MitigateJobRequest { - customerResolutionCode: CustomerResolutionCode; + customerResolutionCode?: CustomerResolutionCode; + serialNumberCustomerResolutionMap?: { + [propertyName: string]: CustomerResolutionCode; + }; } // @public @@ -936,6 +1024,8 @@ export interface PackageShippingDetails { export interface Preferences { encryptionPreferences?: EncryptionPreferences; preferredDataCenterRegion?: string[]; + reverseTransportPreferences?: TransportPreferences; + storageAccountAccessTierPreferences?: string[]; transportPreferences?: TransportPreferences; } @@ -986,6 +1076,19 @@ export interface ResourceIdentity { }; } +// @public +export interface ReverseShippingDetails { + contactDetails?: ContactInfo; + readonly isUpdated?: boolean; + shippingAddress?: ShippingAddress; +} + +// @public +export type ReverseShippingDetailsEditStatus = "Enabled" | "Disabled" | "NotSupported"; + +// @public +export type ReverseTransportPreferenceEditStatus = "Enabled" | "Disabled" | "NotSupported"; + // @public export interface ScheduleAvailabilityRequest { country?: string; @@ -1142,6 +1245,7 @@ export interface SkuInformation { readonly apiVersions?: string[]; readonly capacity?: SkuCapacity; readonly costs?: SkuCost[]; + readonly countriesWithinCommerceBoundary?: string[]; readonly dataLocationToServiceLocationMap?: DataLocationToServiceLocationMap[]; readonly disabledReason?: SkuDisabledReason; readonly disabledReasonMessage?: string; @@ -1157,7 +1261,7 @@ export type SkuName = "DataBox" | "DataBoxDisk" | "DataBoxHeavy" | "DataBoxCusto export type StageName = string; // @public -export type StageStatus = "None" | "InProgress" | "Succeeded" | "Failed" | "Cancelled" | "Cancelling" | "SucceededWithErrors" | "WaitingForCustomerAction" | "SucceededWithWarnings" | "WaitingForCustomerActionForKek" | "WaitingForCustomerActionForCleanUp" | "CustomerActionPerformedForCleanUp"; +export type StageStatus = "None" | "InProgress" | "Succeeded" | "Failed" | "Cancelled" | "Cancelling" | "SucceededWithErrors" | "WaitingForCustomerAction" | "SucceededWithWarnings" | "WaitingForCustomerActionForKek" | "WaitingForCustomerActionForCleanUp" | "CustomerActionPerformedForCleanUp" | "CustomerActionPerformed"; // @public export interface StorageAccountDetails extends DataAccountDetails { @@ -1241,6 +1345,7 @@ export interface TransportAvailabilityResponse { // @public export interface TransportPreferences { + readonly isUpdated?: boolean; preferredShipmentType: TransportShipmentTypes; } @@ -1263,7 +1368,9 @@ export interface UnencryptedCredentialsList { export interface UpdateJobDetails { contactDetails?: ContactDetails; keyEncryptionKey?: KeyEncryptionKey; + preferences?: Preferences; returnToCustomerPackageDetails?: PackageCarrierDetails; + reverseShippingDetails?: ReverseShippingDetails; shippingAddress?: ShippingAddress; } diff --git a/sdk/databox/arm-databox/src/dataBoxManagementClient.ts b/sdk/databox/arm-databox/src/dataBoxManagementClient.ts index b665595e0268..8b429926c4a0 100644 --- a/sdk/databox/arm-databox/src/dataBoxManagementClient.ts +++ b/sdk/databox/arm-databox/src/dataBoxManagementClient.ts @@ -56,7 +56,7 @@ export class DataBoxManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-databox/5.0.0-beta.4`; + const packageDetails = `azsdk-js-arm-databox/5.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -109,7 +109,7 @@ export class DataBoxManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-08-01-preview"; + this.apiVersion = options.apiVersion || "2022-12-01"; this.operations = new OperationsImpl(this); this.jobs = new JobsImpl(this); this.service = new ServiceImpl(this); diff --git a/sdk/databox/arm-databox/src/lroImpl.ts b/sdk/databox/arm-databox/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/databox/arm-databox/src/lroImpl.ts +++ b/sdk/databox/arm-databox/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/databox/arm-databox/src/models/index.ts b/sdk/databox/arm-databox/src/models/index.ts index 91552b509929..4b7b6caec322 100644 --- a/sdk/databox/arm-databox/src/models/index.ts +++ b/sdk/databox/arm-databox/src/models/index.ts @@ -56,6 +56,9 @@ export type ScheduleAvailabilityRequestUnion = | DataBoxScheduleAvailabilityRequest | DiskScheduleAvailabilityRequest | HeavyScheduleAvailabilityRequest; +export type GranularCopyLogDetailsUnion = + | GranularCopyLogDetails + | DataBoxDiskGranularCopyLogDetails; /** Operation Collection. */ export interface OperationList { @@ -130,32 +133,32 @@ export interface JobResourceList { nextLink?: string; } -/** Cloud error. */ +/** Provides additional information about an http error response. */ export interface CloudError { - /** Cloud error code. */ - code?: string; - /** Cloud error message. */ - message?: string; - /** Cloud error target. */ - target?: string; /** - * Cloud error details. + * Gets or sets additional error info. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: CloudError[]; + readonly additionalInfo?: AdditionalErrorInfo[]; + /** Error code. */ + code?: string; /** - * Cloud error additional info. + * Gets or sets details for the error. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalInfo?: AdditionalErrorInfo[]; + readonly details?: CloudError[]; + /** The error message parsed from the body of the http error response. */ + message?: string; + /** Gets or sets the target of the error. */ + target?: string; } -/** Additional error info. */ +/** This class represents additional info which Resource Providers pass when an error occurs. */ export interface AdditionalErrorInfo { - /** Additional error type. */ - type?: string; - /** Additional error info. */ + /** Additional information of the type of error. */ info?: Record; + /** Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation). */ + type?: string; } /** Job details. */ @@ -191,6 +194,8 @@ export interface JobDetails { dataExportDetails?: DataExportDetails[]; /** Preferences for the order. */ preferences?: Preferences; + /** Optional Reverse Shipping details for order. */ + reverseShippingDetails?: ReverseShippingDetails; /** * List of copy log details. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -206,6 +211,11 @@ export interface JobDetails { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly chainOfCustodySasKey?: string; + /** + * Holds device data erasure details + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly deviceErasureDetails?: DeviceErasureDetails; /** Details about which key encryption type is being used. */ keyEncryptionKey?: KeyEncryptionKey; /** The expected size of the data, which needs to be transferred in this job, in terabytes. */ @@ -432,14 +442,23 @@ export interface Preferences { preferredDataCenterRegion?: string[]; /** Preferences related to the shipment logistics of the sku. */ transportPreferences?: TransportPreferences; + /** Optional Preferences related to the reverse shipment logistics of the sku. */ + reverseTransportPreferences?: TransportPreferences; /** Preferences related to the Encryption. */ encryptionPreferences?: EncryptionPreferences; + /** Preferences related to the Access Tier of storage accounts. */ + storageAccountAccessTierPreferences?: string[]; } /** Preferences related to the shipment logistics of the sku */ export interface TransportPreferences { /** Indicates Shipment Logistics type that the customer preferred. */ preferredShipmentType: TransportShipmentTypes; + /** + * Read only property which indicates whether transport preferences has been updated or not after device is prepared. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isUpdated?: boolean; } /** Preferences related to the Encryption. */ @@ -448,6 +467,32 @@ export interface EncryptionPreferences { doubleEncryption?: DoubleEncryption; } +/** Reverse Shipping Address and contact details for a job. */ +export interface ReverseShippingDetails { + /** Contact Info. */ + contactDetails?: ContactInfo; + /** Shipping address where customer wishes to receive the device. */ + shippingAddress?: ShippingAddress; + /** + * A flag to indicate whether Reverse Shipping details are updated or not after device has been prepared. + * Read only field + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isUpdated?: boolean; +} + +/** Contact Info. */ +export interface ContactInfo { + /** Contact name of the person. */ + contactName: string; + /** Phone number of the contact person. */ + phone: string; + /** Phone extension number of the contact person. */ + phoneExtension?: string; + /** Mobile number of the contact person. */ + mobile?: string; +} + /** Details for log generated during copy. */ export interface CopyLogDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -458,6 +503,20 @@ export interface CopyLogDetails { | "DataBoxHeavy"; } +/** Device erasure details with erasure completion status and erasureordestructionlog sas key */ +export interface DeviceErasureDetails { + /** + * Holds the device erasure completion status + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly deviceErasureStatus?: StageStatus; + /** + * Shared access key to download cleanup or destruction certificate for device + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly erasureOrDestructionCertificateSasKey?: string; +} + /** Encryption key containing details about key to encrypt different keys. */ export interface KeyEncryptionKey { /** Type of encryption key used for key encryption. */ @@ -612,7 +671,11 @@ export interface UserAssignedIdentity { /** The Mitigate Job captured from request body for Mitigate API */ export interface MitigateJobRequest { /** Resolution code for the job */ - customerResolutionCode: CustomerResolutionCode; + customerResolutionCode?: CustomerResolutionCode; + /** Serial number and the customer resolution code corresponding to each serial number */ + serialNumberCustomerResolutionMap?: { + [propertyName: string]: CustomerResolutionCode; + }; } /** The request body to provide the delivery package details of job */ @@ -699,6 +762,11 @@ export interface SkuInformation { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly requiredFeature?: string; + /** + * List of all the Countries in the SKU specific commerce boundary + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly countriesWithinCommerceBoundary?: string[]; } /** Map of data location to service location */ @@ -836,6 +904,10 @@ export interface UpdateJobDetails { contactDetails?: ContactDetails; /** Shipping address of the customer. */ shippingAddress?: ShippingAddress; + /** Reverse Shipping Address and contact details for a job. */ + reverseShippingDetails?: ReverseShippingDetails; + /** Preferences related to the order */ + preferences?: Preferences; /** Key encryption key for the job. */ keyEncryptionKey?: KeyEncryptionKey; /** Return package details of job. */ @@ -1098,6 +1170,12 @@ export interface ArmBaseObject { readonly type?: string; } +/** Granular Details for log generated during copy. */ +export interface GranularCopyLogDetails { + /** Polymorphic discriminator, which specifies the different types this object can be */ + copyLogDetailsType: "DataBoxCustomerDisk"; +} + /** Copy progress. */ export interface CopyProgress { /** @@ -1176,6 +1254,106 @@ export interface CopyProgress { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isEnumerationInProgress?: boolean; + /** + * Error, if any, in the stage + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: CloudError; + /** + * Available actions on the job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actions?: CustomerResolutionCode[]; +} + +/** Granular Copy progress. */ +export interface GranularCopyProgress { + /** + * Name of the storage account. This will be empty for data account types other than storage account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly storageAccountName?: string; + /** + * Transfer type of data + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly transferType?: TransferType; + /** + * Data Account Type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dataAccountType?: DataAccountType; + /** + * Id of the account where the data needs to be uploaded. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; + /** + * To indicate bytes transferred. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly bytesProcessed?: number; + /** + * Total amount of data to be processed by the job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalBytesToProcess?: number; + /** + * Number of files processed + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly filesProcessed?: number; + /** + * Total files to process + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalFilesToProcess?: number; + /** + * Number of files not adhering to azure naming conventions which were processed by automatic renaming + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invalidFilesProcessed?: number; + /** + * Total amount of data not adhering to azure naming conventions which were processed by automatic renaming + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invalidFileBytesUploaded?: number; + /** + * Number of folders not adhering to azure naming conventions which were processed by automatic renaming + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly renamedContainerCount?: number; + /** + * Number of files which could not be copied + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly filesErroredOut?: number; + /** + * To indicate directories errored out in the job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly directoriesErroredOut?: number; + /** + * To indicate directories renamed + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invalidDirectoriesProcessed?: number; + /** + * To indicate if enumeration of data is in progress. + * Until this is true, the TotalBytesToProcess may not be valid. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isEnumerationInProgress?: boolean; + /** + * Error, if any, in the stage + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: CloudError; + /** + * Available actions on the job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actions?: CustomerResolutionCode[]; } /** Import disk details */ @@ -1248,6 +1426,16 @@ export interface DataBoxDiskCopyProgress { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly status?: CopyStatus; + /** + * Error, if any, in the stage + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: CloudError; + /** + * Available actions on the job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actions?: CustomerResolutionCode[]; } /** The secrets related to a databox heavy. */ @@ -1348,6 +1536,16 @@ export interface DataBoxDiskJobDetails extends JobDetails { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly copyProgress?: DataBoxDiskCopyProgress[]; + /** + * Copy progress per disk. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly granularCopyProgress?: DataBoxDiskGranularCopyProgress[]; + /** + * Copy progress per disk. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly granularCopyLogDetails?: DataBoxDiskGranularCopyLogDetails[]; /** * Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1608,6 +1806,16 @@ export interface JobResource extends Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isShippingAddressEditable?: boolean; + /** + * The Editable status for Reverse Shipping Address and Contact Info + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reverseShippingDetailsUpdate?: ReverseShippingDetailsEditStatus; + /** + * The Editable status for Reverse Transport preferences + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reverseTransportPreferenceUpdate?: ReverseTransportPreferenceEditStatus; /** * Is Prepare To Ship Enabled on this job * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1875,6 +2083,33 @@ export interface HeavyScheduleAvailabilityRequest skuName: "DataBoxHeavy"; } +/** Granular Copy Log Details for customer disk */ +export interface DataBoxDiskGranularCopyLogDetails + extends GranularCopyLogDetails { + /** Polymorphic discriminator, which specifies the different types this object can be */ + copyLogDetailsType: "DataBoxCustomerDisk"; + /** + * Disk Serial Number. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly serialNumber?: string; + /** + * Account id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; + /** + * Link for copy error logs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorLogLink?: string; + /** + * Link for copy verbose logs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly verboseLogLink?: string; +} + /** DataBox CustomerDisk Copy Progress */ export interface DataBoxCustomerDiskCopyProgress extends CopyProgress { /** @@ -1889,6 +2124,32 @@ export interface DataBoxCustomerDiskCopyProgress extends CopyProgress { readonly copyStatus?: CopyStatus; } +/** DataBox Disk Granular Copy Progress */ +export interface DataBoxDiskGranularCopyProgress extends GranularCopyProgress { + /** + * Disk Serial Number. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly serialNumber?: string; + /** + * The Status of the copy + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly copyStatus?: CopyStatus; +} + +/** Defines headers for Jobs_delete operation. */ +export interface JobsDeleteHeaders { + /** The URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for Jobs_update operation. */ +export interface JobsUpdateHeaders { + /** The URI to poll for completion status. */ + location?: string; +} + /** Known values of {@link StageName} that the service accepts. */ export enum KnownStageName { /** An order has been created. */ @@ -2101,7 +2362,25 @@ export enum KnownDataCenterCode { /** CH1 */ CH1 = "CH1", /** DSM05 */ - DSM05 = "DSM05" + DSM05 = "DSM05", + /** DUB07 */ + DUB07 = "DUB07", + /** PNQ01 */ + PNQ01 = "PNQ01", + /** SVG20 */ + SVG20 = "SVG20", + /** OSA02 */ + OSA02 = "OSA02", + /** OSA22 */ + OSA22 = "OSA22", + /** PAR22 */ + PAR22 = "PAR22", + /** BN7 */ + BN7 = "BN7", + /** SN6 */ + SN6 = "SN6", + /** BJS20 */ + BJS20 = "BJS20" } /** @@ -2158,7 +2437,16 @@ export enum KnownDataCenterCode { * **PUS20** \ * **AdHoc** \ * **CH1** \ - * **DSM05** + * **DSM05** \ + * **DUB07** \ + * **PNQ01** \ + * **SVG20** \ + * **OSA02** \ + * **OSA22** \ + * **PAR22** \ + * **BN7** \ + * **SN6** \ + * **BJS20** */ export type DataCenterCode = string; @@ -2198,7 +2486,7 @@ export enum KnownCopyStatus { DriveNotDetected = "DriveNotDetected", /** Copy failed due to corrupted drive. */ DriveCorrupted = "DriveCorrupted", - /** Copy failed due to modified or removed metadata files. */ + /** Copy failed due to modified or removed metadata files. */ MetadataFilesModifiedOrRemoved = "MetadataFilesModifiedOrRemoved" } @@ -2224,11 +2512,21 @@ export enum KnownCopyStatus { * **OtherUserError**: Copy failed due to user error. \ * **DriveNotDetected**: Copy failed due to disk detection error. \ * **DriveCorrupted**: Copy failed due to corrupted drive. \ - * **MetadataFilesModifiedOrRemoved**: Copy failed due to modified or removed metadata files. + * **MetadataFilesModifiedOrRemoved**: Copy failed due to modified or removed metadata files. */ export type CopyStatus = string; /** Defines values for TransferType. */ export type TransferType = "ImportToAzure" | "ExportFromAzure"; +/** Defines values for ReverseShippingDetailsEditStatus. */ +export type ReverseShippingDetailsEditStatus = + | "Enabled" + | "Disabled" + | "NotSupported"; +/** Defines values for ReverseTransportPreferenceEditStatus. */ +export type ReverseTransportPreferenceEditStatus = + | "Enabled" + | "Disabled" + | "NotSupported"; /** Defines values for StageStatus. */ export type StageStatus = | "None" @@ -2242,7 +2540,8 @@ export type StageStatus = | "SucceededWithWarnings" | "WaitingForCustomerActionForKek" | "WaitingForCustomerActionForCleanUp" - | "CustomerActionPerformedForCleanUp"; + | "CustomerActionPerformedForCleanUp" + | "CustomerActionPerformed"; /** Defines values for AddressType. */ export type AddressType = "None" | "Residential" | "Commercial"; /** Defines values for DataAccountType. */ @@ -2266,7 +2565,12 @@ export type DoubleEncryption = "Enabled" | "Disabled"; /** Defines values for KekType. */ export type KekType = "MicrosoftManaged" | "CustomerManaged"; /** Defines values for CustomerResolutionCode. */ -export type CustomerResolutionCode = "None" | "MoveToCleanUpDevice" | "Resume"; +export type CustomerResolutionCode = + | "None" + | "MoveToCleanUpDevice" + | "Resume" + | "Restart" + | "ReachOutToOperation"; /** Defines values for DatacenterAddressType. */ export type DatacenterAddressType = | "DatacenterAddressLocation" @@ -2412,20 +2716,14 @@ export type JobsListCredentialsResponse = UnencryptedCredentialsList; /** Optional parameters. */ export interface JobsListNextOptionalParams - extends coreClient.OperationOptions { - /** $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. */ - skipToken?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type JobsListNextResponse = JobResourceList; /** Optional parameters. */ export interface JobsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions { - /** $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. */ - skipToken?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ export type JobsListByResourceGroupNextResponse = JobResourceList; diff --git a/sdk/databox/arm-databox/src/models/mappers.ts b/sdk/databox/arm-databox/src/models/mappers.ts index a48a105ad0ce..204fa7f24270 100644 --- a/sdk/databox/arm-databox/src/models/mappers.ts +++ b/sdk/databox/arm-databox/src/models/mappers.ts @@ -225,20 +225,21 @@ export const CloudError: coreClient.CompositeMapper = { name: "Composite", className: "CloudError", modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, - message: { - serializedName: "message", + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AdditionalErrorInfo" + } + } } }, - target: { - serializedName: "target", + code: { + serializedName: "code", type: { name: "String" } @@ -256,17 +257,16 @@ export const CloudError: coreClient.CompositeMapper = { } } }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, + message: { + serializedName: "message", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AdditionalErrorInfo" - } - } + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" } } } @@ -278,18 +278,18 @@ export const AdditionalErrorInfo: coreClient.CompositeMapper = { name: "Composite", className: "AdditionalErrorInfo", modelProperties: { - type: { - serializedName: "type", - type: { - name: "String" - } - }, info: { serializedName: "info", type: { name: "Dictionary", value: { type: { name: "any" } } } + }, + type: { + serializedName: "type", + type: { + name: "String" + } } } } @@ -390,6 +390,13 @@ export const JobDetails: coreClient.CompositeMapper = { className: "Preferences" } }, + reverseShippingDetails: { + serializedName: "reverseShippingDetails", + type: { + name: "Composite", + className: "ReverseShippingDetails" + } + }, copyLogDetails: { serializedName: "copyLogDetails", readOnly: true, @@ -417,6 +424,13 @@ export const JobDetails: coreClient.CompositeMapper = { name: "String" } }, + deviceErasureDetails: { + serializedName: "deviceErasureDetails", + type: { + name: "Composite", + className: "DeviceErasureDetails" + } + }, keyEncryptionKey: { serializedName: "keyEncryptionKey", type: { @@ -438,7 +452,13 @@ export const JobDetails: coreClient.CompositeMapper = { element: { type: { name: "Enum", - allowedValues: ["None", "MoveToCleanUpDevice", "Resume"] + allowedValues: [ + "None", + "MoveToCleanUpDevice", + "Resume", + "Restart", + "ReachOutToOperation" + ] } } } @@ -504,7 +524,8 @@ export const JobStages: coreClient.CompositeMapper = { "SucceededWithWarnings", "WaitingForCustomerActionForKek", "WaitingForCustomerActionForCleanUp", - "CustomerActionPerformedForCleanUp" + "CustomerActionPerformedForCleanUp", + "CustomerActionPerformed" ] } }, @@ -1060,12 +1081,32 @@ export const Preferences: coreClient.CompositeMapper = { className: "TransportPreferences" } }, + reverseTransportPreferences: { + serializedName: "reverseTransportPreferences", + type: { + name: "Composite", + className: "TransportPreferences" + } + }, encryptionPreferences: { serializedName: "encryptionPreferences", type: { name: "Composite", className: "EncryptionPreferences" } + }, + storageAccountAccessTierPreferences: { + serializedName: "storageAccountAccessTierPreferences", + type: { + name: "Sequence", + element: { + defaultValue: "Archive", + isConstant: true, + type: { + name: "String" + } + } + } } } } @@ -1083,6 +1124,13 @@ export const TransportPreferences: coreClient.CompositeMapper = { name: "Enum", allowedValues: ["CustomerManaged", "MicrosoftManaged"] } + }, + isUpdated: { + serializedName: "isUpdated", + readOnly: true, + type: { + name: "Boolean" + } } } } @@ -1105,6 +1153,77 @@ export const EncryptionPreferences: coreClient.CompositeMapper = { } }; +export const ReverseShippingDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReverseShippingDetails", + modelProperties: { + contactDetails: { + serializedName: "contactDetails", + type: { + name: "Composite", + className: "ContactInfo" + } + }, + shippingAddress: { + serializedName: "shippingAddress", + type: { + name: "Composite", + className: "ShippingAddress" + } + }, + isUpdated: { + serializedName: "isUpdated", + readOnly: true, + type: { + name: "Boolean" + } + } + } + } +}; + +export const ContactInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ContactInfo", + modelProperties: { + contactName: { + constraints: { + MinLength: 1 + }, + serializedName: "contactName", + required: true, + type: { + name: "String" + } + }, + phone: { + constraints: { + MinLength: 1 + }, + serializedName: "phone", + required: true, + type: { + name: "String" + } + }, + phoneExtension: { + serializedName: "phoneExtension", + type: { + name: "String" + } + }, + mobile: { + serializedName: "mobile", + type: { + name: "String" + } + } + } + } +}; + export const CopyLogDetails: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1132,6 +1251,44 @@ export const CopyLogDetails: coreClient.CompositeMapper = { } }; +export const DeviceErasureDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeviceErasureDetails", + modelProperties: { + deviceErasureStatus: { + serializedName: "deviceErasureStatus", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "None", + "InProgress", + "Succeeded", + "Failed", + "Cancelled", + "Cancelling", + "SucceededWithErrors", + "WaitingForCustomerAction", + "SucceededWithWarnings", + "WaitingForCustomerActionForKek", + "WaitingForCustomerActionForCleanUp", + "CustomerActionPerformedForCleanUp", + "CustomerActionPerformed" + ] + } + }, + erasureOrDestructionCertificateSasKey: { + serializedName: "erasureOrDestructionCertificateSasKey", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const KeyEncryptionKey: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1227,7 +1384,13 @@ export const LastMitigationActionOnJob: coreClient.CompositeMapper = { serializedName: "customerResolution", type: { name: "Enum", - allowedValues: ["None", "MoveToCleanUpDevice", "Resume"] + allowedValues: [ + "None", + "MoveToCleanUpDevice", + "Resume", + "Restart", + "ReachOutToOperation" + ] } } } @@ -1484,10 +1647,33 @@ export const MitigateJobRequest: coreClient.CompositeMapper = { modelProperties: { customerResolutionCode: { serializedName: "customerResolutionCode", - required: true, type: { name: "Enum", - allowedValues: ["None", "MoveToCleanUpDevice", "Resume"] + allowedValues: [ + "None", + "MoveToCleanUpDevice", + "Resume", + "Restart", + "ReachOutToOperation" + ] + } + }, + serialNumberCustomerResolutionMap: { + serializedName: "serialNumberCustomerResolutionMap", + type: { + name: "Dictionary", + value: { + type: { + name: "Enum", + allowedValues: [ + "None", + "MoveToCleanUpDevice", + "Resume", + "Restart", + "ReachOutToOperation" + ] + } + } } } } @@ -1699,6 +1885,18 @@ export const SkuInformation: coreClient.CompositeMapper = { type: { name: "String" } + }, + countriesWithinCommerceBoundary: { + serializedName: "properties.countriesWithinCommerceBoundary", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } @@ -2014,6 +2212,20 @@ export const UpdateJobDetails: coreClient.CompositeMapper = { className: "ShippingAddress" } }, + reverseShippingDetails: { + serializedName: "reverseShippingDetails", + type: { + name: "Composite", + className: "ReverseShippingDetails" + } + }, + preferences: { + serializedName: "preferences", + type: { + name: "Composite", + className: "Preferences" + } + }, keyEncryptionKey: { serializedName: "keyEncryptionKey", type: { @@ -2605,6 +2817,33 @@ export const ArmBaseObject: coreClient.CompositeMapper = { } }; +export const GranularCopyLogDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GranularCopyLogDetails", + uberParent: "GranularCopyLogDetails", + polymorphicDiscriminator: { + serializedName: "copyLogDetailsType", + clientName: "copyLogDetailsType" + }, + modelProperties: { + copyLogDetailsType: { + serializedName: "copyLogDetailsType", + required: true, + type: { + name: "Enum", + allowedValues: [ + "DataBox", + "DataBoxDisk", + "DataBoxHeavy", + "DataBoxCustomerDisk" + ] + } + } + } + } +}; + export const CopyProgress: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2716,12 +2955,180 @@ export const CopyProgress: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "CloudError" + } + }, + actions: { + serializedName: "actions", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "None", + "MoveToCleanUpDevice", + "Resume", + "Restart", + "ReachOutToOperation" + ] + } + } + } } } } }; -export const ImportDiskDetails: coreClient.CompositeMapper = { +export const GranularCopyProgress: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GranularCopyProgress", + modelProperties: { + storageAccountName: { + serializedName: "storageAccountName", + readOnly: true, + type: { + name: "String" + } + }, + transferType: { + serializedName: "transferType", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["ImportToAzure", "ExportFromAzure"] + } + }, + dataAccountType: { + serializedName: "dataAccountType", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["StorageAccount", "ManagedDisk"] + } + }, + accountId: { + serializedName: "accountId", + readOnly: true, + type: { + name: "String" + } + }, + bytesProcessed: { + serializedName: "bytesProcessed", + readOnly: true, + type: { + name: "Number" + } + }, + totalBytesToProcess: { + serializedName: "totalBytesToProcess", + readOnly: true, + type: { + name: "Number" + } + }, + filesProcessed: { + serializedName: "filesProcessed", + readOnly: true, + type: { + name: "Number" + } + }, + totalFilesToProcess: { + serializedName: "totalFilesToProcess", + readOnly: true, + type: { + name: "Number" + } + }, + invalidFilesProcessed: { + serializedName: "invalidFilesProcessed", + readOnly: true, + type: { + name: "Number" + } + }, + invalidFileBytesUploaded: { + serializedName: "invalidFileBytesUploaded", + readOnly: true, + type: { + name: "Number" + } + }, + renamedContainerCount: { + serializedName: "renamedContainerCount", + readOnly: true, + type: { + name: "Number" + } + }, + filesErroredOut: { + serializedName: "filesErroredOut", + readOnly: true, + type: { + name: "Number" + } + }, + directoriesErroredOut: { + serializedName: "directoriesErroredOut", + readOnly: true, + type: { + name: "Number" + } + }, + invalidDirectoriesProcessed: { + serializedName: "invalidDirectoriesProcessed", + readOnly: true, + type: { + name: "Number" + } + }, + isEnumerationInProgress: { + serializedName: "isEnumerationInProgress", + readOnly: true, + type: { + name: "Boolean" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "CloudError" + } + }, + actions: { + serializedName: "actions", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "None", + "MoveToCleanUpDevice", + "Resume", + "Restart", + "ReachOutToOperation" + ] + } + } + } + } + } + } +}; + +export const ImportDiskDetails: coreClient.CompositeMapper = { type: { name: "Composite", className: "ImportDiskDetails", @@ -2843,6 +3250,32 @@ export const DataBoxDiskCopyProgress: coreClient.CompositeMapper = { type: { name: "String" } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "CloudError" + } + }, + actions: { + serializedName: "actions", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "None", + "MoveToCleanUpDevice", + "Resume", + "Restart", + "ReachOutToOperation" + ] + } + } + } } } } @@ -3051,6 +3484,32 @@ export const DataBoxDiskJobDetails: coreClient.CompositeMapper = { } } }, + granularCopyProgress: { + serializedName: "granularCopyProgress", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataBoxDiskGranularCopyProgress" + } + } + } + }, + granularCopyLogDetails: { + serializedName: "granularCopyLogDetails", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataBoxDiskGranularCopyLogDetails" + } + } + } + }, disksAndSizeDetails: { serializedName: "disksAndSizeDetails", readOnly: true, @@ -3515,6 +3974,22 @@ export const JobResource: coreClient.CompositeMapper = { name: "Boolean" } }, + reverseShippingDetailsUpdate: { + serializedName: "properties.reverseShippingDetailsUpdate", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Enabled", "Disabled", "NotSupported"] + } + }, + reverseTransportPreferenceUpdate: { + serializedName: "properties.reverseTransportPreferenceUpdate", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["Enabled", "Disabled", "NotSupported"] + } + }, isPrepareToShipEnabled: { serializedName: "properties.isPrepareToShipEnabled", readOnly: true, @@ -4138,6 +4613,48 @@ export const HeavyScheduleAvailabilityRequest: coreClient.CompositeMapper = { } }; +export const DataBoxDiskGranularCopyLogDetails: coreClient.CompositeMapper = { + serializedName: "DataBoxCustomerDisk", + type: { + name: "Composite", + className: "DataBoxDiskGranularCopyLogDetails", + uberParent: "GranularCopyLogDetails", + polymorphicDiscriminator: + GranularCopyLogDetails.type.polymorphicDiscriminator, + modelProperties: { + ...GranularCopyLogDetails.type.modelProperties, + serialNumber: { + serializedName: "serialNumber", + readOnly: true, + type: { + name: "String" + } + }, + accountId: { + serializedName: "accountId", + readOnly: true, + type: { + name: "String" + } + }, + errorLogLink: { + serializedName: "errorLogLink", + readOnly: true, + type: { + name: "String" + } + }, + verboseLogLink: { + serializedName: "verboseLogLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const DataBoxCustomerDiskCopyProgress: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4162,6 +4679,60 @@ export const DataBoxCustomerDiskCopyProgress: coreClient.CompositeMapper = { } }; +export const DataBoxDiskGranularCopyProgress: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataBoxDiskGranularCopyProgress", + modelProperties: { + ...GranularCopyProgress.type.modelProperties, + serialNumber: { + serializedName: "serialNumber", + readOnly: true, + type: { + name: "String" + } + }, + copyStatus: { + serializedName: "copyStatus", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const JobsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "JobsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const JobsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "JobsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export let discriminators = { JobDetails: JobDetails, DataAccountDetails: DataAccountDetails, @@ -4172,6 +4743,7 @@ export let discriminators = { ValidationRequest: ValidationRequest, JobSecrets: JobSecrets, ScheduleAvailabilityRequest: ScheduleAvailabilityRequest, + GranularCopyLogDetails: GranularCopyLogDetails, "JobDetails.DataBoxCustomerDisk": DataBoxCustomerDiskJobDetails, "JobDetails.DataBoxDisk": DataBoxDiskJobDetails, "JobDetails.DataBoxHeavy": DataBoxHeavyJobDetails, @@ -4203,5 +4775,6 @@ export let discriminators = { "JobSecrets.DataBox": DataboxJobSecrets, "ScheduleAvailabilityRequest.DataBox": DataBoxScheduleAvailabilityRequest, "ScheduleAvailabilityRequest.DataBoxDisk": DiskScheduleAvailabilityRequest, - "ScheduleAvailabilityRequest.DataBoxHeavy": HeavyScheduleAvailabilityRequest + "ScheduleAvailabilityRequest.DataBoxHeavy": HeavyScheduleAvailabilityRequest, + "GranularCopyLogDetails.DataBoxCustomerDisk": DataBoxDiskGranularCopyLogDetails }; diff --git a/sdk/databox/arm-databox/src/models/parameters.ts b/sdk/databox/arm-databox/src/models/parameters.ts index 71e340c9765a..f940ff30b05c 100644 --- a/sdk/databox/arm-databox/src/models/parameters.ts +++ b/sdk/databox/arm-databox/src/models/parameters.ts @@ -51,7 +51,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-08-01-preview", + defaultValue: "2022-12-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/databox/arm-databox/src/operations/jobs.ts b/sdk/databox/arm-databox/src/operations/jobs.ts index cc6eaa9408f4..58663dec0f5b 100644 --- a/sdk/databox/arm-databox/src/operations/jobs.ts +++ b/sdk/databox/arm-databox/src/operations/jobs.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 { DataBoxManagementClient } from "../dataBoxManagementClient"; -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 { JobResource, JobsListNextOptionalParams, @@ -320,7 +324,7 @@ export class JobsImpl implements Jobs { jobResource: JobResource, options?: JobsCreateOptionalParams ): Promise< - PollerLike, JobsCreateResponse> + SimplePollerLike, JobsCreateResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -328,7 +332,7 @@ export class JobsImpl implements Jobs { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -361,13 +365,16 @@ export class JobsImpl implements Jobs { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, jobName, jobResource, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, jobName, jobResource, options }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + JobsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -409,14 +416,14 @@ export class JobsImpl implements Jobs { resourceGroupName: string, jobName: string, options?: JobsDeleteOptionalParams - ): 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 ) => { @@ -449,13 +456,13 @@ export class JobsImpl implements Jobs { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, jobName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, jobName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -492,7 +499,7 @@ export class JobsImpl implements Jobs { jobResourceUpdateParameter: JobResourceUpdateParameter, options?: JobsUpdateOptionalParams ): Promise< - PollerLike, JobsUpdateResponse> + SimplePollerLike, JobsUpdateResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -500,7 +507,7 @@ export class JobsImpl implements Jobs { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -533,13 +540,16 @@ export class JobsImpl implements Jobs { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, jobName, jobResourceUpdateParameter, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, jobName, jobResourceUpdateParameter, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + JobsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -915,7 +925,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ApiError } }, - queryParameters: [Parameters.apiVersion, Parameters.skipToken], urlParameters: [ Parameters.$host, Parameters.nextLink, @@ -935,7 +944,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ApiError } }, - queryParameters: [Parameters.apiVersion, Parameters.skipToken], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/databox/arm-databox/src/operations/operations.ts b/sdk/databox/arm-databox/src/operations/operations.ts index b231863284ce..4ccc75f11328 100644 --- a/sdk/databox/arm-databox/src/operations/operations.ts +++ b/sdk/databox/arm-databox/src/operations/operations.ts @@ -143,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ApiError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/databox/arm-databox/src/operations/service.ts b/sdk/databox/arm-databox/src/operations/service.ts index 724d6fb2fb14..904afb6a2a4e 100644 --- a/sdk/databox/arm-databox/src/operations/service.ts +++ b/sdk/databox/arm-databox/src/operations/service.ts @@ -430,7 +430,6 @@ const listAvailableSkusByResourceGroupNextOperationSpec: coreClient.OperationSpe bodyMapper: Mappers.ApiError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.nextLink, diff --git a/sdk/databox/arm-databox/src/operationsInterfaces/jobs.ts b/sdk/databox/arm-databox/src/operationsInterfaces/jobs.ts index df0e74ebd795..4d9f851711f1 100644 --- a/sdk/databox/arm-databox/src/operationsInterfaces/jobs.ts +++ b/sdk/databox/arm-databox/src/operationsInterfaces/jobs.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 { JobResource, JobsListOptionalParams, @@ -103,7 +103,7 @@ export interface Jobs { jobResource: JobResource, options?: JobsCreateOptionalParams ): Promise< - PollerLike, JobsCreateResponse> + SimplePollerLike, JobsCreateResponse> >; /** * Creates a new job with the specified parameters. Existing job cannot be updated with this API and @@ -131,7 +131,7 @@ export interface Jobs { resourceGroupName: string, jobName: string, options?: JobsDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes a job. * @param resourceGroupName The Resource Group Name @@ -158,7 +158,7 @@ export interface Jobs { jobResourceUpdateParameter: JobResourceUpdateParameter, options?: JobsUpdateOptionalParams ): Promise< - PollerLike, JobsUpdateResponse> + SimplePollerLike, JobsUpdateResponse> >; /** * Updates the properties of an existing job. diff --git a/sdk/databox/arm-databox/src/pagingHelper.ts b/sdk/databox/arm-databox/src/pagingHelper.ts index d85fc13bce1e..269a2b9814b5 100644 --- a/sdk/databox/arm-databox/src/pagingHelper.ts +++ b/sdk/databox/arm-databox/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { diff --git a/sdk/databox/arm-databox/tsconfig.json b/sdk/databox/arm-databox/tsconfig.json index 7f0a11d9ac11..3e6ae96443f3 100644 --- a/sdk/databox/arm-databox/tsconfig.json +++ b/sdk/databox/arm-databox/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-databox": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"