Skip to content

Commit d8f857d

Browse files
authored
[DataProtectionBackup] Change ResourceUri type in DataSourceInfo and DataSourceSetInfo class (Azure#35627)
* Change resource type * Fix pipeline * Update CHANGELOG.md * Update to fix comment * Remove useless code * Update to fix comments * Update BackupVaultTests.cs
1 parent 766f0f4 commit d8f857d

File tree

10 files changed

+95
-26
lines changed

10 files changed

+95
-26
lines changed

sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
### Breaking Changes
88

9+
- Add property `ResourceUriString` to class `DataSourceInfo`, replace the `ResourceUri`.
10+
- Add property `ResourceUriString` to class `DataSourceSetInfo`, replace the `ResourceUri`.
11+
912
### Bugs Fixed
1013

1114
### Other Changes

sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/api/Azure.ResourceManager.DataProtectionBackup.netstandard2.0.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,10 @@ public DataSourceInfo(Azure.Core.ResourceIdentifier resourceId) { }
11051105
public Azure.Core.AzureLocation? ResourceLocation { get { throw null; } set { } }
11061106
public string ResourceName { get { throw null; } set { } }
11071107
public Azure.Core.ResourceType? ResourceType { get { throw null; } set { } }
1108+
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
1109+
[System.ObsoleteAttribute("This property has been replaced by ResourceUriString", false)]
11081110
public System.Uri ResourceUri { get { throw null; } set { } }
1111+
public string ResourceUriString { get { throw null; } set { } }
11091112
}
11101113
public partial class DataSourceSetInfo
11111114
{
@@ -1116,7 +1119,10 @@ public DataSourceSetInfo(Azure.Core.ResourceIdentifier resourceId) { }
11161119
public Azure.Core.AzureLocation? ResourceLocation { get { throw null; } set { } }
11171120
public string ResourceName { get { throw null; } set { } }
11181121
public Azure.Core.ResourceType? ResourceType { get { throw null; } set { } }
1122+
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
1123+
[System.ObsoleteAttribute("This property has been replaced by ResourceUriString", false)]
11191124
public System.Uri ResourceUri { get { throw null; } set { } }
1125+
public string ResourceUriString { get { throw null; } set { } }
11201126
}
11211127
public partial class DataStoreInfoBase
11221128
{
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System;
7+
using System.ComponentModel;
8+
9+
namespace Azure.ResourceManager.DataProtectionBackup.Models
10+
{
11+
public partial class DataSourceInfo
12+
{
13+
/// <summary> Uri of the resource. </summary>
14+
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
15+
[ObsoleteAttribute("This property has been replaced by ResourceUriString", false)]
16+
public System.Uri ResourceUri { get; set; }
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System;
7+
using System.ComponentModel;
8+
9+
namespace Azure.ResourceManager.DataProtectionBackup.Models
10+
{
11+
public partial class DataSourceSetInfo
12+
{
13+
/// <summary> Uri of the resource. </summary>
14+
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
15+
[ObsoleteAttribute("This property has been replaced by ResourceUriString", false)]
16+
public System.Uri ResourceUri { get; set; }
17+
}
18+
}

sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataSourceInfo.Serialization.cs

Lines changed: 4 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataSourceInfo.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataSourceSetInfo.Serialization.cs

Lines changed: 4 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/Generated/Models/DataSourceSetInfo.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/src/autorest.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,13 @@ rename-mapping:
172172
Datasource.resourceID: -|arm-id
173173
Datasource.resourceLocation: -|azure-location
174174
Datasource.resourceType: -|resource-type
175+
Datasource.resourceUri: ResourceUriString
175176
DatasourceSet: DataSourceSetInfo
176177
DatasourceSet.datasourceType: DataSourceType
177178
DatasourceSet.resourceID: -|arm-id
178179
DatasourceSet.resourceLocation: -|azure-location
179180
DatasourceSet.resourceType: -|resource-type
181+
DatasourceSet.resourceUri: ResourceUriString
180182
PolicyInfo: BackupInstancePolicyInfo
181183
PolicyInfo.policyId: -|arm-id
182184
ValidationType: BackupValidationType
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using Azure.Core;
5+
using Azure.ResourceManager.DataProtectionBackup.Models;
6+
using NUnit.Framework;
7+
8+
namespace Azure.ResourceManager.DataProtectionBackup.Tests.Unit
9+
{
10+
public class BackupVaultTests
11+
{
12+
[TestCase]
13+
public void ValidateDataSourceInfo()
14+
{
15+
var dataSourceInfo = new DataSourceInfo(new ResourceIdentifier("/subs/id"))
16+
{
17+
ResourceUriString = "/sub/test"
18+
};
19+
var dataSourceSetInfo = new DataSourceSetInfo(new ResourceIdentifier("/subs/id"))
20+
{
21+
ResourceUriString = "/sub/test"
22+
};
23+
24+
#pragma warning disable CS0618 // Type or member is obsolete
25+
Assert.IsNull(dataSourceInfo.ResourceUri);
26+
Assert.IsNull(dataSourceSetInfo.ResourceUri);
27+
#pragma warning restore CS0618 // Type or member is obsolete
28+
Assert.AreEqual("/sub/test", dataSourceInfo.ResourceUriString);
29+
Assert.NotNull("/sub/test", dataSourceSetInfo.ResourceUriString);
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)