From d2f4d8ea825b6ad52167a663e4b1c1d28aa9e126 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 20 Jun 2023 10:31:37 +0000 Subject: [PATCH] CodeGen from PR 24011 in Azure/azure-rest-api-specs Merge 753c9ce8385cc93154c1225f999113427e292b55 into eae8ca2f90c2deb68688f5b1bbba9a5efcc0e42e --- .../arm-dataprotection/CHANGELOG.md | 29 +++ .../arm-dataprotection/_meta.json | 8 +- .../arm-dataprotection/package.json | 12 +- .../review/arm-dataprotection.api.md | 65 +++++- .../src/dataProtectionClient.ts | 24 ++- .../arm-dataprotection/src/models/index.ts | 132 ++++++++++++- .../arm-dataprotection/src/models/mappers.ts | 185 ++++++++++++++++++ .../src/models/parameters.ts | 2 +- .../arm-dataprotection/test/sampleTest.ts | 43 ++++ .../arm-dataprotection/tsconfig.json | 10 +- 10 files changed, 473 insertions(+), 37 deletions(-) create mode 100644 sdk/dataprotection/arm-dataprotection/test/sampleTest.ts diff --git a/sdk/dataprotection/arm-dataprotection/CHANGELOG.md b/sdk/dataprotection/arm-dataprotection/CHANGELOG.md index 2e4e54e7fa3..9a61ad2c1c6 100644 --- a/sdk/dataprotection/arm-dataprotection/CHANGELOG.md +++ b/sdk/dataprotection/arm-dataprotection/CHANGELOG.md @@ -1,5 +1,34 @@ # Release History +## 2.0.0 (2023-06-20) + +**Features** + + - Added Interface BaseResourceProperties + - Added Interface CrossRegionRestoreSettings + - Added Interface IdentityDetails + - Added Interface NamespacedNameResource + - Added Interface UserAssignedIdentity + - Added Type Alias CrossRegionRestoreState + - Added Type Alias SecureScoreLevel + - Interface AzureBackupJob has a new optional parameter rehydrationPriority + - Interface AzureBackupRestoreRequest has a new optional parameter identityDetails + - Interface BackupInstance has a new optional parameter identityDetails + - Interface BackupVault has a new optional parameter secureScore + - Interface Datasource has a new optional parameter resourceProperties + - Interface DatasourceSet has a new optional parameter resourceProperties + - Interface DppIdentityDetails has a new optional parameter userAssignedIdentities + - Interface FeatureSettings has a new optional parameter crossRegionRestoreSettings + - Interface KubernetesClusterBackupDatasourceParameters has a new optional parameter backupHookReferences + - Interface KubernetesClusterRestoreCriteria has a new optional parameter restoreHookReferences + - Added Enum KnownCrossRegionRestoreState + - Added Enum KnownSecureScoreLevel + +**Breaking Changes** + + - Class DataProtectionClient has a new signature + + ## 1.1.0 (2023-06-12) **Features** diff --git a/sdk/dataprotection/arm-dataprotection/_meta.json b/sdk/dataprotection/arm-dataprotection/_meta.json index 9154ae5452d..9d62018125c 100644 --- a/sdk/dataprotection/arm-dataprotection/_meta.json +++ b/sdk/dataprotection/arm-dataprotection/_meta.json @@ -1,8 +1,8 @@ { - "commit": "1b33e81bbdc28fcd6644a1315b8d7b1b6d030590", + "commit": "edc7205cdc4b1e98db83ebbf3d3ac12b32b9fedc", "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.2 --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/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.2" + "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/dataprotection/arm-dataprotection/package.json b/sdk/dataprotection/arm-dataprotection/package.json index 7b31215d24c..a4d88b57079 100644 --- a/sdk/dataprotection/arm-dataprotection/package.json +++ b/sdk/dataprotection/arm-dataprotection/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DataProtectionClient.", - "version": "1.1.0", + "version": "2.0.0", "engines": { "node": ">=14.0.0" }, @@ -111,13 +111,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 9dc4ad6dee6..c903e9dfdbe 100644 --- a/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md +++ b/sdk/dataprotection/arm-dataprotection/review/arm-dataprotection.api.md @@ -126,6 +126,7 @@ export interface AzureBackupJob { readonly policyName?: string; progressEnabled: boolean; readonly progressUrl?: string; + readonly rehydrationPriority?: string; readonly restoreType?: string; // (undocumented) sourceDataStoreName?: string; @@ -197,6 +198,7 @@ export interface AzureBackupRehydrationRequest { // @public export interface AzureBackupRestoreRequest { + identityDetails?: IdentityDetails; objectType: "AzureBackupRecoveryPointBasedRestoreRequest" | "AzureBackupRestoreWithRehydrationRequest" | "AzureBackupRecoveryTimeBasedRestoreRequest"; restoreTargetInfo: RestoreTargetInfoBaseUnion; sourceDataStoreType: SourceDataStoreType; @@ -265,6 +267,7 @@ export interface BackupInstance { dataSourceInfo: Datasource; dataSourceSetInfo?: DatasourceSet; friendlyName?: string; + identityDetails?: IdentityDetails; // (undocumented) objectType: string; policyInfo: PolicyInfo; @@ -584,6 +587,7 @@ export interface BackupVault { readonly provisioningState?: ProvisioningState; readonly resourceMoveDetails?: ResourceMoveDetails; readonly resourceMoveState?: ResourceMoveState; + readonly secureScore?: SecureScoreLevel; securitySettings?: SecuritySettings; storageSettings: StorageSetting[]; } @@ -727,6 +731,11 @@ export interface BasePolicyRule { // @public (undocumented) export type BasePolicyRuleUnion = BasePolicyRule | AzureBackupRule | AzureRetentionRule; +// @public +export interface BaseResourceProperties { + objectType: "BaseResourceProperties"; +} + // @public export interface BlobBackupDatasourceParameters extends BackupDatasourceParameters { containersList: string[]; @@ -807,6 +816,14 @@ export type CopyOptionUnion = CopyOption | CopyOnExpiryOption | CustomCopyOption // @public export type CreatedByType = string; +// @public (undocumented) +export interface CrossRegionRestoreSettings { + state?: CrossRegionRestoreState; +} + +// @public +export type CrossRegionRestoreState = string; + // @public export interface CrossSubscriptionRestoreSettings { state?: CrossSubscriptionRestoreState; @@ -841,6 +858,7 @@ export class DataProtectionClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: DataProtectionClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: DataProtectionClientOptionalParams); // (undocumented) apiVersion: string; // (undocumented) @@ -880,7 +898,7 @@ export class DataProtectionClient extends coreClient.ServiceClient { // (undocumented) restorableTimeRanges: RestorableTimeRanges; // (undocumented) - subscriptionId: string; + subscriptionId?: string; } // @public @@ -916,6 +934,7 @@ export interface Datasource { resourceID: string; resourceLocation?: string; resourceName?: string; + resourceProperties?: BaseResourceProperties; resourceType?: string; resourceUri?: string; } @@ -927,6 +946,7 @@ export interface DatasourceSet { resourceID: string; resourceLocation?: string; resourceName?: string; + resourceProperties?: BaseResourceProperties; resourceType?: string; resourceUri?: string; } @@ -1058,6 +1078,9 @@ export interface DppIdentityDetails { readonly principalId?: string; readonly tenantId?: string; type?: string; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; } // @public (undocumented) @@ -1223,6 +1246,8 @@ export type ExportJobsTriggerResponse = ExportJobsTriggerHeaders; // @public export interface FeatureSettings { + // (undocumented) + crossRegionRestoreSettings?: CrossRegionRestoreSettings; crossSubscriptionRestoreSettings?: CrossSubscriptionRestoreSettings; } @@ -1265,6 +1290,12 @@ export type FeatureValidationResponseBaseUnion = FeatureValidationResponseBase | // @public export function getContinuationToken(page: unknown): string | undefined; +// @public (undocumented) +export interface IdentityDetails { + userAssignedIdentityArmUrl?: string; + useSystemAssignedIdentity?: boolean; +} + // @public export interface ImmediateCopyOption extends CopyOption { objectType: "ImmediateCopyOption"; @@ -1386,6 +1417,12 @@ export enum KnownCreatedByType { User = "User" } +// @public +export enum KnownCrossRegionRestoreState { + Disabled = "Disabled", + Enabled = "Enabled" +} + // @public export enum KnownCrossSubscriptionRestoreState { Disabled = "Disabled", @@ -1542,6 +1579,15 @@ export enum KnownSecretStoreType { Invalid = "Invalid" } +// @public +export enum KnownSecureScoreLevel { + Adequate = "Adequate", + Maximum = "Maximum", + Minimum = "Minimum", + None = "None", + NotSupported = "NotSupported" +} + // @public export enum KnownSoftDeleteState { AlwaysOn = "AlwaysOn", @@ -1604,6 +1650,7 @@ export enum KnownWeekNumber { // @public export interface KubernetesClusterBackupDatasourceParameters extends BackupDatasourceParameters { + backupHookReferences?: NamespacedNameResource[]; excludedNamespaces?: string[]; excludedResourceTypes?: string[]; includeClusterScopeResources: boolean; @@ -1628,6 +1675,7 @@ export interface KubernetesClusterRestoreCriteria extends ItemLevelRestoreCriter }; objectType: "KubernetesClusterRestoreCriteria"; persistentVolumeRestoreMode?: PersistentVolumeRestoreMode; + restoreHookReferences?: NamespacedNameResource[]; } // @public @@ -1652,6 +1700,12 @@ export interface MonitoringSettings { // @public export type Month = string; +// @public +export interface NamespacedNameResource { + name?: string; + namespace?: string; +} + // @public export interface OperationExtendedInfo { objectType: "OperationJobExtendedInfo"; @@ -2231,6 +2285,9 @@ export interface SecretStoreResource { // @public export type SecretStoreType = string; +// @public +export type SecureScoreLevel = string; + // @public export interface SecuritySettings { immutabilitySettings?: ImmutabilitySettings; @@ -2345,6 +2402,12 @@ export interface UnlockDeleteResponse { unlockDeleteExpiryTime?: string; } +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + // @public export interface UserFacingError { code?: string; diff --git a/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts b/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts index b68d0b78045..62b791e368c 100644 --- a/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts +++ b/sdk/dataprotection/arm-dataprotection/src/dataProtectionClient.ts @@ -59,7 +59,7 @@ import { DataProtectionClientOptionalParams } from "./models"; export class DataProtectionClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the DataProtectionClient class. @@ -71,12 +71,26 @@ export class DataProtectionClient extends coreClient.ServiceClient { credentials: coreAuth.TokenCredential, subscriptionId: string, options?: DataProtectionClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: DataProtectionClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: DataProtectionClientOptionalParams | string, + options?: DataProtectionClientOptionalParams ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -88,7 +102,7 @@ export class DataProtectionClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-dataprotection/1.1.0`; + const packageDetails = `azsdk-js-arm-dataprotection/2.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -141,7 +155,7 @@ export class DataProtectionClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-01-01"; + this.apiVersion = options.apiVersion || "2023-05-01"; this.backupVaults = new BackupVaultsImpl(this); this.operationResult = new OperationResultImpl(this); this.operationStatus = new OperationStatusImpl(this); diff --git a/sdk/dataprotection/arm-dataprotection/src/models/index.ts b/sdk/dataprotection/arm-dataprotection/src/models/index.ts index 7410ef280fe..9a79488b2a2 100644 --- a/sdk/dataprotection/arm-dataprotection/src/models/index.ts +++ b/sdk/dataprotection/arm-dataprotection/src/models/index.ts @@ -97,6 +97,11 @@ export interface BackupVault { readonly isVaultProtectedByResourceGuard?: boolean; /** Feature Settings */ featureSettings?: FeatureSettings; + /** + * Secure Score of Backup Vault + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly secureScore?: SecureScoreLevel; } /** Monitoring Settings */ @@ -158,6 +163,7 @@ export interface StorageSetting { export interface FeatureSettings { /** CrossSubscriptionRestore Settings */ crossSubscriptionRestoreSettings?: CrossSubscriptionRestoreSettings; + crossRegionRestoreSettings?: CrossRegionRestoreSettings; } /** CrossSubscriptionRestore Settings */ @@ -166,6 +172,11 @@ export interface CrossSubscriptionRestoreSettings { state?: CrossSubscriptionRestoreState; } +export interface CrossRegionRestoreSettings { + /** CrossRegionRestore state */ + state?: CrossRegionRestoreState; +} + /** Identity details */ export interface DppIdentityDetails { /** @@ -178,8 +189,24 @@ export interface DppIdentityDetails { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly tenantId?: string; - /** The identityType which can be either SystemAssigned or None */ + /** The identityType which can be either SystemAssigned, UserAssigned, 'SystemAssigned,UserAssigned' or None */ type?: string; + /** Gets or sets the user assigned identities. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; } export interface DppBaseTrackedResource { @@ -480,6 +507,11 @@ export interface BackupInstance { datasourceAuthCredentials?: AuthCredentialsUnion; /** Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again. */ validationType?: ValidationType; + /** + * Contains information of the Identity Details for the BI. + * If it is null, default will be considered as System Assigned. + */ + identityDetails?: IdentityDetails; objectType: string; } @@ -499,6 +531,14 @@ export interface Datasource { resourceType?: string; /** Uri of the resource. */ resourceUri?: string; + /** Properties specific to data source */ + resourceProperties?: BaseResourceProperties; +} + +/** Properties which are specific to datasource/datasourceSets */ +export interface BaseResourceProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + objectType: "BaseResourceProperties"; } /** DatasourceSet details of datasource to be backed up */ @@ -517,6 +557,8 @@ export interface DatasourceSet { resourceType?: string; /** Uri of the resource. */ resourceUri?: string; + /** Properties specific to data source set */ + resourceProperties?: BaseResourceProperties; } /** Policy Info in backupInstance */ @@ -597,6 +639,13 @@ export interface AuthCredentials { objectType: "SecretStoreBasedAuthCredentials"; } +export interface IdentityDetails { + /** Specifies if the BI is protected by System Identity. */ + useSystemAssignedIdentity?: boolean; + /** ARM URL for User Assigned Identity. */ + userAssignedIdentityArmUrl?: string; +} + export interface DppProxyResource { /** * Proxy Resource Id represents the complete path to the resource. @@ -675,6 +724,11 @@ export interface AzureBackupRestoreRequest { sourceDataStoreType: SourceDataStoreType; /** Fully qualified Azure Resource Manager ID of the datasource which is being recovered. */ sourceResourceId?: string; + /** + * Contains information of the Identity Details for the BI. + * If it is null, default will be considered as System Assigned. + */ + identityDetails?: IdentityDetails; } /** Base class common to RestoreTargetInfo and RestoreFilesTargetInfo */ @@ -763,6 +817,11 @@ export interface AzureBackupJob { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly progressUrl?: string; + /** + * Priority to be used for rehydration + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly rehydrationPriority?: string; /** * It indicates the sub type of operation i.e. in case of Restore it can be ALR/OLR * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1114,6 +1173,14 @@ export interface BasePolicyRule { name: string; } +/** Class to refer resources which contains namespace and name */ +export interface NamespacedNameResource { + /** Name of the resource */ + name?: string; + /** Namespace in which the resource exists */ + namespace?: string; +} + /** Source LifeCycle */ export interface SourceLifeCycle { /** Delete Option */ @@ -1372,20 +1439,22 @@ export interface KubernetesClusterBackupDatasourceParameters extends BackupDatasourceParameters { /** Polymorphic discriminator, which specifies the different types this object can be */ objectType: "KubernetesClusterBackupDatasourceParameters"; - /** Gets or sets the volume snapshot property. This property if enabled will take volume snapshots during restore. */ + /** Gets or sets the volume snapshot property. This property if enabled will take volume snapshots during backup. */ snapshotVolumes: boolean; - /** Gets or sets the include cluster resources property. This property if enabled will include cluster scope resources during restore. */ + /** Gets or sets the include cluster resources property. This property if enabled will include cluster scope resources during backup. */ includeClusterScopeResources: boolean; - /** Gets or sets the include namespaces property. This property sets the namespaces to be included during restore. */ + /** Gets or sets the include namespaces property. This property sets the namespaces to be included during backup. */ includedNamespaces?: string[]; - /** Gets or sets the exclude namespaces property. This property sets the namespaces to be excluded during restore. */ + /** Gets or sets the exclude namespaces property. This property sets the namespaces to be excluded during backup. */ excludedNamespaces?: string[]; - /** Gets or sets the include resource types property. This property sets the resource types to be included during restore. */ + /** Gets or sets the include resource types property. This property sets the resource types to be included during backup. */ includedResourceTypes?: string[]; - /** Gets or sets the exclude resource types property. This property sets the resource types to be excluded during restore. */ + /** Gets or sets the exclude resource types property. This property sets the resource types to be excluded during backup. */ excludedResourceTypes?: string[]; - /** Gets or sets the LabelSelectors property. This property sets the resource with such label selectors to be included during restore. */ + /** Gets or sets the LabelSelectors property. This property sets the resource with such label selectors to be included during backup. */ labelSelectors?: string[]; + /** Gets or sets the backup hook references. This property sets the hook reference to be executed during backup. */ + backupHookReferences?: NamespacedNameResource[]; } /** Parameters to be used during configuration of backup of blobs */ @@ -1655,6 +1724,8 @@ export interface KubernetesClusterRestoreCriteria conflictPolicy?: ExistingResourcePolicy; /** Gets or sets the Namespace Mappings property. This property sets if namespace needs to be change during restore. */ namespaceMappings?: { [propertyName: string]: string }; + /** Gets or sets the restore hook references. This property sets the hook reference to be executed during restore. */ + restoreHookReferences?: NamespacedNameResource[]; } /** Backup Vault Resource */ @@ -2012,6 +2083,51 @@ export enum KnownCrossSubscriptionRestoreState { */ export type CrossSubscriptionRestoreState = string; +/** Known values of {@link CrossRegionRestoreState} that the service accepts. */ +export enum KnownCrossRegionRestoreState { + /** Disabled */ + Disabled = "Disabled", + /** Enabled */ + Enabled = "Enabled" +} + +/** + * Defines values for CrossRegionRestoreState. \ + * {@link KnownCrossRegionRestoreState} can be used interchangeably with CrossRegionRestoreState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Disabled** \ + * **Enabled** + */ +export type CrossRegionRestoreState = string; + +/** Known values of {@link SecureScoreLevel} that the service accepts. */ +export enum KnownSecureScoreLevel { + /** None */ + None = "None", + /** Minimum */ + Minimum = "Minimum", + /** Adequate */ + Adequate = "Adequate", + /** Maximum */ + Maximum = "Maximum", + /** NotSupported */ + NotSupported = "NotSupported" +} + +/** + * Defines values for SecureScoreLevel. \ + * {@link KnownSecureScoreLevel} can be used interchangeably with SecureScoreLevel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Minimum** \ + * **Adequate** \ + * **Maximum** \ + * **NotSupported** + */ +export type SecureScoreLevel = string; + /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { /** User */ diff --git a/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts b/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts index e349f47c67c..81a32fbef7e 100644 --- a/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts +++ b/sdk/dataprotection/arm-dataprotection/src/models/mappers.ts @@ -74,6 +74,13 @@ export const BackupVault: coreClient.CompositeMapper = { name: "Composite", className: "FeatureSettings" } + }, + secureScore: { + serializedName: "secureScore", + readOnly: true, + type: { + name: "String" + } } } } @@ -240,6 +247,13 @@ export const FeatureSettings: coreClient.CompositeMapper = { name: "Composite", className: "CrossSubscriptionRestoreSettings" } + }, + crossRegionRestoreSettings: { + serializedName: "crossRegionRestoreSettings", + type: { + name: "Composite", + className: "CrossRegionRestoreSettings" + } } } } @@ -260,6 +274,21 @@ export const CrossSubscriptionRestoreSettings: coreClient.CompositeMapper = { } }; +export const CrossRegionRestoreSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CrossRegionRestoreSettings", + modelProperties: { + state: { + serializedName: "state", + type: { + name: "String" + } + } + } + } +}; + export const DppIdentityDetails: coreClient.CompositeMapper = { type: { name: "Composite", @@ -284,6 +313,38 @@ export const DppIdentityDetails: coreClient.CompositeMapper = { type: { name: "String" } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } + } + } + } +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "Uuid" + } } } } @@ -1033,6 +1094,13 @@ export const BackupInstance: coreClient.CompositeMapper = { name: "String" } }, + identityDetails: { + serializedName: "identityDetails", + type: { + name: "Composite", + className: "IdentityDetails" + } + }, objectType: { serializedName: "objectType", required: true, @@ -1091,6 +1159,35 @@ export const Datasource: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceProperties: { + serializedName: "resourceProperties", + type: { + name: "Composite", + className: "BaseResourceProperties" + } + } + } + } +}; + +export const BaseResourceProperties: coreClient.CompositeMapper = { + serializedName: "BaseResourceProperties", + type: { + name: "Composite", + className: "BaseResourceProperties", + uberParent: "BaseResourceProperties", + polymorphicDiscriminator: { + serializedName: "objectType", + clientName: "objectType" + }, + modelProperties: { + objectType: { + serializedName: "objectType", + required: true, + type: { + name: "String" + } } } } @@ -1143,6 +1240,13 @@ export const DatasourceSet: coreClient.CompositeMapper = { type: { name: "String" } + }, + resourceProperties: { + serializedName: "resourceProperties", + type: { + name: "Composite", + className: "BaseResourceProperties" + } } } } @@ -1408,6 +1512,27 @@ export const AuthCredentials: coreClient.CompositeMapper = { } }; +export const IdentityDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IdentityDetails", + modelProperties: { + useSystemAssignedIdentity: { + serializedName: "useSystemAssignedIdentity", + type: { + name: "Boolean" + } + }, + userAssignedIdentityArmUrl: { + serializedName: "userAssignedIdentityArmUrl", + type: { + name: "String" + } + } + } + } +}; + export const DppProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1608,6 +1733,13 @@ export const AzureBackupRestoreRequest: coreClient.CompositeMapper = { type: { name: "String" } + }, + identityDetails: { + serializedName: "identityDetails", + type: { + name: "Composite", + className: "IdentityDetails" + } } } } @@ -1820,6 +1952,13 @@ export const AzureBackupJob: coreClient.CompositeMapper = { name: "String" } }, + rehydrationPriority: { + serializedName: "rehydrationPriority", + readOnly: true, + type: { + name: "String" + } + }, restoreType: { serializedName: "restoreType", readOnly: true, @@ -2793,6 +2932,27 @@ export const BasePolicyRule: coreClient.CompositeMapper = { } }; +export const NamespacedNameResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NamespacedNameResource", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + namespace: { + serializedName: "namespace", + type: { + name: "String" + } + } + } + } +}; + export const SourceLifeCycle: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3608,6 +3768,18 @@ export const KubernetesClusterBackupDatasourceParameters: coreClient.CompositeMa } } } + }, + backupHookReferences: { + serializedName: "backupHookReferences", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NamespacedNameResource" + } + } + } } } } @@ -4429,6 +4601,18 @@ export const KubernetesClusterRestoreCriteria: coreClient.CompositeMapper = { name: "Dictionary", value: { type: { name: "String" } } } + }, + restoreHookReferences: { + serializedName: "restoreHookReferences", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NamespacedNameResource" + } + } + } } } } @@ -4877,6 +5061,7 @@ export let discriminators = { FeatureValidationRequestBase: FeatureValidationRequestBase, FeatureValidationResponseBase: FeatureValidationResponseBase, BaseBackupPolicy: BaseBackupPolicy, + "BaseResourceProperties.BaseResourceProperties": BaseResourceProperties, DataStoreParameters: DataStoreParameters, BackupDatasourceParameters: BackupDatasourceParameters, AuthCredentials: AuthCredentials, diff --git a/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts b/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts index fd3f7c7effe..bd7a849ddf8 100644 --- a/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts +++ b/sdk/dataprotection/arm-dataprotection/src/models/parameters.ts @@ -58,7 +58,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-01-01", + defaultValue: "2023-05-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/dataprotection/arm-dataprotection/test/sampleTest.ts b/sdk/dataprotection/arm-dataprotection/test/sampleTest.ts new file mode 100644 index 00000000000..25aeb3ebcc3 --- /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 1f65f09046a..3e6ae96443f 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"