diff --git a/sdk/databox/arm-databox/README.md b/sdk/databox/arm-databox/README.md index 6e21df8ea56c..12beff8c004c 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) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-databox?view=azure-node-preview) | [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 0198d6501785..8accc101a375 100644 --- a/sdk/databox/arm-databox/_meta.json +++ b/sdk/databox/arm-databox/_meta.json @@ -1,8 +1,8 @@ { - "commit": "756495dd7e0e2f5181039def47a8c85ff0787b66", + "commit": "5d31f53fbd070705e63e349221d291df3c33ac10", "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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\databox\\resource-manager\\readme.md --use=@autorest/typescript@6.0.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/databox/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.6.2", - "use": "@autorest/typescript@6.0.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/databox/arm-databox/package.json b/sdk/databox/arm-databox/package.json index 2ed7709b2a18..7c5ef38b8809 100644 --- a/sdk/databox/arm-databox/package.json +++ b/sdk/databox/arm-databox/package.json @@ -3,12 +3,12 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DataBoxManagementClient.", - "version": "5.0.1", + "version": "1.0.0-beta.1", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.3", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databox/arm-databox", - "//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/src/dataBoxManagementClient.ts b/sdk/databox/arm-databox/src/dataBoxManagementClient.ts index dbff2cc246b4..dbcd52161f2d 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.1`; + const packageDetails = `azsdk-js-arm-databox/1.0.0-beta.1`; 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 || "2022-12-01"; + this.apiVersion = options.apiVersion || "2023-03-01"; this.operations = new OperationsImpl(this); this.jobs = new JobsImpl(this); this.service = new ServiceImpl(this); diff --git a/sdk/databox/arm-databox/src/models/index.ts b/sdk/databox/arm-databox/src/models/index.ts index 0a12e4afa289..52ddb696dd85 100644 --- a/sdk/databox/arm-databox/src/models/index.ts +++ b/sdk/databox/arm-databox/src/models/index.ts @@ -269,6 +269,40 @@ export interface JobStages { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly jobStageDetails?: Record; + /** + * Delay information for the job stages. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly delayInformation?: JobDelayDetails[]; +} + +/** Job Delay Notification details */ +export interface JobDelayDetails { + /** + * Status of notification + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: DelayNotificationStatus; + /** + * Delay Error code + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorCode?: PortalDelayErrorCode; + /** + * Description of the delay. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * Timestamp when the delay notification was created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly startTime?: Date; + /** + * Timestamp when the delay notification was resolved. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resolutionTime?: Date; } /** Contact Details. */ @@ -1832,6 +1866,11 @@ export interface JobResource extends Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly status?: StageName; + /** + * Name of the stage where delay might be present. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly delayedStage?: StageName; /** * Time at which the job was started in UTC ISO 8601 format. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2231,6 +2270,48 @@ export enum KnownStageName { */ export type StageName = string; +/** Known values of {@link DelayNotificationStatus} that the service accepts. */ +export enum KnownDelayNotificationStatus { + /** Delay is still active */ + Active = "Active", + /** Delay has been resolved */ + Resolved = "Resolved" +} + +/** + * Defines values for DelayNotificationStatus. \ + * {@link KnownDelayNotificationStatus} can be used interchangeably with DelayNotificationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active**: Delay is still active \ + * **Resolved**: Delay has been resolved + */ +export type DelayNotificationStatus = string; + +/** Known values of {@link PortalDelayErrorCode} that the service accepts. */ +export enum KnownPortalDelayErrorCode { + /** Delay due to any internal reasons */ + InternalIssueDelay = "InternalIssueDelay", + /** Active Order limit breached. */ + ActiveOrderLimitBreachedDelay = "ActiveOrderLimitBreachedDelay", + /** High demand */ + ActiveOrderLimitBreachedDelay = "ActiveOrderLimitBreachedDelay", + /** Slow copy due to large number of files */ + ActiveOrderLimitBreachedDelay = "ActiveOrderLimitBreachedDelay" +} + +/** + * Defines values for PortalDelayErrorCode. \ + * {@link KnownPortalDelayErrorCode} can be used interchangeably with PortalDelayErrorCode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **InternalIssueDelay**: Delay due to any internal reasons \ + * **ActiveOrderLimitBreachedDelay**: Active Order limit breached. \ + * **ActiveOrderLimitBreachedDelay**: High demand \ + * **ActiveOrderLimitBreachedDelay**: Slow copy due to large number of files + */ +export type PortalDelayErrorCode = string; + /** Known values of {@link NotificationStageName} that the service accepts. */ export enum KnownNotificationStageName { /** Notification at device prepared stage. */ diff --git a/sdk/databox/arm-databox/src/models/mappers.ts b/sdk/databox/arm-databox/src/models/mappers.ts index 84159d05c171..c83c183fb46f 100644 --- a/sdk/databox/arm-databox/src/models/mappers.ts +++ b/sdk/databox/arm-databox/src/models/mappers.ts @@ -543,6 +543,63 @@ export const JobStages: coreClient.CompositeMapper = { name: "Dictionary", value: { type: { name: "any" } } } + }, + delayInformation: { + serializedName: "delayInformation", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "JobDelayDetails" + } + } + } + } + } + } +}; + +export const JobDelayDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "JobDelayDetails", + modelProperties: { + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String" + } + }, + errorCode: { + serializedName: "errorCode", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + readOnly: true, + type: { + name: "DateTime" + } + }, + resolutionTime: { + serializedName: "resolutionTime", + readOnly: true, + type: { + name: "DateTime" + } } } } @@ -4023,6 +4080,13 @@ export const JobResource: coreClient.CompositeMapper = { name: "String" } }, + delayedStage: { + serializedName: "properties.delayedStage", + readOnly: true, + type: { + name: "String" + } + }, startTime: { serializedName: "properties.startTime", readOnly: true, diff --git a/sdk/databox/arm-databox/src/models/parameters.ts b/sdk/databox/arm-databox/src/models/parameters.ts index f940ff30b05c..2dd56e615212 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: "2022-12-01", + defaultValue: "2023-03-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/databox/arm-databox/test/sampleTest.ts b/sdk/databox/arm-databox/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/databox/arm-databox/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/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"