diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3df1bbf10e37..8329c07adc05 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4131,7 +4131,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20230822 + typescript: 5.3.0-dev.20230823 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8715,8 +8715,8 @@ packages: hasBin: true dev: false - /typescript/5.3.0-dev.20230822: - resolution: {integrity: sha512-zVlawDu8ult5+AoXXQck+R+qJn1Gzv5aE1lH9UcStRRE461MjXK7P8DDJuee840m66huRJKMzh+ttgrTUEfWmQ==} + /typescript/5.3.0-dev.20230823: + resolution: {integrity: sha512-IEFfTl67UgTTJzf+Ma4+0txDKzxzxtjNjyFjTm7c+yP5sff+atKe44mAjhCxX8wGjwRrFuhAUeHz1udmzBZ4ow==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -11606,7 +11606,7 @@ packages: dev: false file:projects/arm-dataprotection.tgz: - resolution: {integrity: sha512-i3zZQlyVWbpv62xZMwVu3Ll7mZcigQd9EabNpYP2PP/0VsrV9qHEZUxRkpJ5Y4jqAH41B4ia0Izghuc5KtBxEQ==, tarball: file:projects/arm-dataprotection.tgz} + resolution: {integrity: sha512-Bx3qYLD9462Z50hj6Scg+QFQjBrE8ZzYYVb087lynveev0HCIU6TqtT111LWD7d36si15md7uwSk+NW0HFXo5g==, tarball: file:projects/arm-dataprotection.tgz} name: '@rush-temp/arm-dataprotection' version: 0.0.0 dependencies: @@ -11626,10 +11626,13 @@ packages: rimraf: 3.0.2 rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_dmbj5memikchm63lpeyt6ukdau + ts-node: 10.9.1_n7tz6hmpirns3flqdptizaxofa tslib: 2.6.2 typescript: 5.0.4 uglify-js: 3.17.4 transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' - supports-color dev: false @@ -14510,7 +14513,7 @@ packages: dev: false file:projects/arm-resourceconnector.tgz: - resolution: {integrity: sha512-A5KPLmzwoQ024tNq6AKb/Er0C6bwhs8U1HtzQRmYFRuFLXhHSh+Dk86nwQRc2vgV/J+Cvr4QQ+uYDQ0x0K4gHw==, tarball: file:projects/arm-resourceconnector.tgz} + resolution: {integrity: sha512-19vyuiPH5cJogzuaO5ZWxm9aCXhh6xgkOl4NA3n8f1HlR1cjy4dfz23a5qEGkcxQVudXpN53gCOeoTc1sDYD7w==, tarball: file:projects/arm-resourceconnector.tgz} name: '@rush-temp/arm-resourceconnector' version: 0.0.0 dependencies: diff --git a/sdk/dataprotection/arm-dataprotection/CHANGELOG.md b/sdk/dataprotection/arm-dataprotection/CHANGELOG.md index 2d485d62f048..a8d900366b8e 100644 --- a/sdk/dataprotection/arm-dataprotection/CHANGELOG.md +++ b/sdk/dataprotection/arm-dataprotection/CHANGELOG.md @@ -1,15 +1,21 @@ # Release History + +## 2.0.0 (2023-08-23) + +**Features** -## 1.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added Interface DefaultResourceProperties + - Added Type Alias BaseResourcePropertiesUnion + - Added Type Alias ResourcePropertiesObjectType + - Added Enum KnownResourcePropertiesObjectType -### Other Changes +**Breaking Changes** + - Type of parameter objectType of interface BaseResourceProperties is changed from "BaseResourceProperties" to "DefaultResourceProperties" + - Type of parameter resourceProperties of interface Datasource is changed from BaseResourceProperties to BaseResourcePropertiesUnion + - Type of parameter resourceProperties of interface DatasourceSet is changed from BaseResourceProperties to BaseResourcePropertiesUnion + + ## 1.2.0 (2023-07-10) **Features** diff --git a/sdk/dataprotection/arm-dataprotection/_meta.json b/sdk/dataprotection/arm-dataprotection/_meta.json index ecfdd4e96408..c2c520748026 100644 --- a/sdk/dataprotection/arm-dataprotection/_meta.json +++ b/sdk/dataprotection/arm-dataprotection/_meta.json @@ -1,8 +1,8 @@ { - "commit": "0f39a2d56070d2bc4251494525cb8af88583a938", + "commit": "98beecab43f4c928c57b1023a40e6b606ca896c4", "readme": "specification/dataprotection/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\\dataprotection\\resource-manager\\readme.md --use=@autorest/typescript@6.0.5 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/dataprotection/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.7.0", - "use": "@autorest/typescript@6.0.5" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/dataprotection/arm-dataprotection/package.json b/sdk/dataprotection/arm-dataprotection/package.json index 2ba260f5cee7..abedd2a5f6ce 100644 --- a/sdk/dataprotection/arm-dataprotection/package.json +++ b/sdk/dataprotection/arm-dataprotection/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DataProtectionClient.", - "version": "1.2.1", + "version": "2.0.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.3", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -48,6 +48,7 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", + "ts-node": "^10.0.0", "@azure/dev-tool": "^1.0.0" }, "repository": { @@ -111,13 +112,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dataprotection/arm-dataprotection", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-dataprotection?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/dataprotection/arm-dataprotection" +} \ No newline at end of file diff --git a/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md b/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md index c903e9dfdbed..2f12c4269b4e 100644 --- a/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md +++ b/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md @@ -733,9 +733,12 @@ export type BasePolicyRuleUnion = BasePolicyRule | AzureBackupRule | AzureRetent // @public export interface BaseResourceProperties { - objectType: "BaseResourceProperties"; + objectType: "DefaultResourceProperties"; } +// @public (undocumented) +export type BaseResourcePropertiesUnion = BaseResourceProperties | DefaultResourceProperties; + // @public export interface BlobBackupDatasourceParameters extends BackupDatasourceParameters { containersList: string[]; @@ -934,7 +937,7 @@ export interface Datasource { resourceID: string; resourceLocation?: string; resourceName?: string; - resourceProperties?: BaseResourceProperties; + resourceProperties?: BaseResourcePropertiesUnion; resourceType?: string; resourceUri?: string; } @@ -946,7 +949,7 @@ export interface DatasourceSet { resourceID: string; resourceLocation?: string; resourceName?: string; - resourceProperties?: BaseResourceProperties; + resourceProperties?: BaseResourcePropertiesUnion; resourceType?: string; resourceUri?: string; } @@ -978,6 +981,11 @@ export interface Day { // @public export type DayOfWeek = string; +// @public +export interface DefaultResourceProperties extends BaseResourceProperties { + objectType: "DefaultResourceProperties"; +} + // @public export interface DeletedBackupInstance extends BackupInstance { readonly deletionInfo?: DeletionInfo; @@ -1559,6 +1567,11 @@ export enum KnownResourceMoveState { Unknown = "Unknown" } +// @public +export enum KnownResourcePropertiesObjectType { + DefaultResourceProperties = "DefaultResourceProperties" +} + // @public export enum KnownRestoreSourceDataStoreType { ArchiveStore = "ArchiveStore", @@ -2185,6 +2198,9 @@ export interface ResourceMoveDetails { // @public export type ResourceMoveState = string; +// @public +export type ResourcePropertiesObjectType = string; + // @public (undocumented) export interface RestorableTimeRange { endTime: string; diff --git a/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts b/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts index ce0888aa2f64..62b791e368c4 100644 --- a/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts +++ b/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts @@ -102,7 +102,7 @@ export class DataProtectionClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-dataprotection/1.2.1`; + const packageDetails = `azsdk-js-arm-dataprotection/2.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/dataprotection/arm-dataprotection/src/models/index.ts b/sdk/dataprotection/arm-dataprotection/src/models/index.ts index 9a79488b2a2e..ce7f4c6ddac7 100644 --- a/sdk/dataprotection/arm-dataprotection/src/models/index.ts +++ b/sdk/dataprotection/arm-dataprotection/src/models/index.ts @@ -18,6 +18,9 @@ export type FeatureValidationResponseBaseUnion = | FeatureValidationResponseBase | FeatureValidationResponse; export type BaseBackupPolicyUnion = BaseBackupPolicy | BackupPolicy; +export type BaseResourcePropertiesUnion = + | BaseResourceProperties + | DefaultResourceProperties; export type DataStoreParametersUnion = | DataStoreParameters | AzureOperationalStoreParameters; @@ -532,13 +535,13 @@ export interface Datasource { /** Uri of the resource. */ resourceUri?: string; /** Properties specific to data source */ - resourceProperties?: BaseResourceProperties; + resourceProperties?: BaseResourcePropertiesUnion; } /** Properties which are specific to datasource/datasourceSets */ export interface BaseResourceProperties { /** Polymorphic discriminator, which specifies the different types this object can be */ - objectType: "BaseResourceProperties"; + objectType: "DefaultResourceProperties"; } /** DatasourceSet details of datasource to be backed up */ @@ -558,7 +561,7 @@ export interface DatasourceSet { /** Uri of the resource. */ resourceUri?: string; /** Properties specific to data source set */ - resourceProperties?: BaseResourceProperties; + resourceProperties?: BaseResourcePropertiesUnion; } /** Policy Info in backupInstance */ @@ -1426,6 +1429,12 @@ export interface DeletedBackupInstance extends BackupInstance { readonly deletionInfo?: DeletionInfo; } +/** Default source properties */ +export interface DefaultResourceProperties extends BaseResourceProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + objectType: "DefaultResourceProperties"; +} + /** Parameters for Operational-Tier DataStore */ export interface AzureOperationalStoreParameters extends DataStoreParameters { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -2152,6 +2161,21 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link ResourcePropertiesObjectType} that the service accepts. */ +export enum KnownResourcePropertiesObjectType { + /** DefaultResourceProperties */ + DefaultResourceProperties = "DefaultResourceProperties" +} + +/** + * Defines values for ResourcePropertiesObjectType. \ + * {@link KnownResourcePropertiesObjectType} can be used interchangeably with ResourcePropertiesObjectType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **DefaultResourceProperties** + */ +export type ResourcePropertiesObjectType = string; + /** Known values of {@link DataStoreTypes} that the service accepts. */ export enum KnownDataStoreTypes { /** OperationalStore */ diff --git a/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts b/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts index 81a32fbef7e3..6602da0d8c77 100644 --- a/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts +++ b/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts @@ -1172,7 +1172,6 @@ export const Datasource: coreClient.CompositeMapper = { }; export const BaseResourceProperties: coreClient.CompositeMapper = { - serializedName: "BaseResourceProperties", type: { name: "Composite", className: "BaseResourceProperties", @@ -3671,6 +3670,20 @@ export const DeletedBackupInstance: coreClient.CompositeMapper = { } }; +export const DefaultResourceProperties: coreClient.CompositeMapper = { + serializedName: "DefaultResourceProperties", + type: { + name: "Composite", + className: "DefaultResourceProperties", + uberParent: "BaseResourceProperties", + polymorphicDiscriminator: + BaseResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...BaseResourceProperties.type.modelProperties + } + } +}; + export const AzureOperationalStoreParameters: coreClient.CompositeMapper = { serializedName: "AzureOperationalStoreParameters", type: { @@ -5061,7 +5074,7 @@ export let discriminators = { FeatureValidationRequestBase: FeatureValidationRequestBase, FeatureValidationResponseBase: FeatureValidationResponseBase, BaseBackupPolicy: BaseBackupPolicy, - "BaseResourceProperties.BaseResourceProperties": BaseResourceProperties, + BaseResourceProperties: BaseResourceProperties, DataStoreParameters: DataStoreParameters, BackupDatasourceParameters: BackupDatasourceParameters, AuthCredentials: AuthCredentials, @@ -5079,6 +5092,7 @@ export let discriminators = { "FeatureValidationRequestBase.FeatureValidationRequest": FeatureValidationRequest, "FeatureValidationResponseBase.FeatureValidationResponse": FeatureValidationResponse, "BaseBackupPolicy.BackupPolicy": BackupPolicy, + "BaseResourceProperties.DefaultResourceProperties": DefaultResourceProperties, "DataStoreParameters.AzureOperationalStoreParameters": AzureOperationalStoreParameters, "BackupDatasourceParameters.KubernetesClusterBackupDatasourceParameters": KubernetesClusterBackupDatasourceParameters, "BackupDatasourceParameters.BlobBackupDatasourceParameters": BlobBackupDatasourceParameters, diff --git a/sdk/dataprotection/arm-dataprotection/src/operations/backupInstances.ts b/sdk/dataprotection/arm-dataprotection/src/operations/backupInstances.ts index 7600004ee5bb..228271f76e9c 100644 --- a/sdk/dataprotection/arm-dataprotection/src/operations/backupInstances.ts +++ b/sdk/dataprotection/arm-dataprotection/src/operations/backupInstances.ts @@ -448,7 +448,8 @@ export class BackupInstancesImpl implements BackupInstances { OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -546,7 +547,8 @@ export class BackupInstancesImpl implements BackupInstances { OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -782,7 +784,8 @@ export class BackupInstancesImpl implements BackupInstances { OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -1338,7 +1341,8 @@ export class BackupInstancesImpl implements BackupInstances { OperationState >(lro, { restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" }); await poller.poll(); return poller; diff --git a/sdk/dataprotection/arm-dataprotection/test/sampleTest.ts b/sdk/dataprotection/arm-dataprotection/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/dataprotection/arm-dataprotection/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/dataprotection/arm-dataprotection/tsconfig.json b/sdk/dataprotection/arm-dataprotection/tsconfig.json index 1f65f09046a1..3e6ae96443f3 100644 --- a/sdk/dataprotection/arm-dataprotection/tsconfig.json +++ b/sdk/dataprotection/arm-dataprotection/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-dataprotection": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"