1
1
// ----------------------------------------------------------------------------------
2
+ // ----------------------------------------------------------------------------------
2
3
//
3
4
// Copyright Microsoft Corporation
4
5
// Licensed under the Apache License, Version 2.0 (the "License");
12
13
// limitations under the License.
13
14
// ----------------------------------------------------------------------------------
14
15
15
- using Track2 = global ::Azure . ResourceManager . Storage ;
16
+ using Track2 = Azure . ResourceManager . Storage ;
17
+ using Track2Models = Azure . ResourceManager . Storage . Models ;
16
18
using Azure . ResourceManager . Storage . Models ;
17
19
using Microsoft . WindowsAzure . Commands . Common . Attributes ;
18
20
using System ;
@@ -67,16 +69,16 @@ public PSManagementPolicyRule()
67
69
{
68
70
}
69
71
70
- public PSManagementPolicyRule ( global :: Azure . ResourceManager . Storage . Models . ManagementPolicyRule rule )
72
+ public PSManagementPolicyRule ( Track2Models . ManagementPolicyRule rule )
71
73
{
72
74
this . Enabled = rule . Enabled ;
73
75
this . Name = rule . Name ;
74
76
this . Definition = rule . Definition is null ? null : new PSManagementPolicyDefinition ( rule . Definition ) ;
75
77
}
76
78
77
- public Track2 . Models . ManagementPolicyRule ParseManagementPolicyRule ( )
79
+ public Track2Models . ManagementPolicyRule ParseManagementPolicyRule ( )
78
80
{
79
- Track2 . Models . ManagementPolicyRule rule = new Track2 . Models . ManagementPolicyRule (
81
+ Track2Models . ManagementPolicyRule rule = new Track2Models . ManagementPolicyRule (
80
82
this . Name ,
81
83
RuleType . Lifecycle ,
82
84
this . Definition ? . ParseManagementPolicyDefination ( )
@@ -85,7 +87,7 @@ public Track2.Models.ManagementPolicyRule ParseManagementPolicyRule()
85
87
return rule ;
86
88
}
87
89
88
- public static PSManagementPolicyRule [ ] GetPSManagementPolicyRules ( IList < Track2 . Models . ManagementPolicyRule > rules )
90
+ public static PSManagementPolicyRule [ ] GetPSManagementPolicyRules ( IList < Track2Models . ManagementPolicyRule > rules )
89
91
{
90
92
if ( rules == null )
91
93
{
@@ -273,9 +275,9 @@ public PSManagementPolicySnapShot()
273
275
public PSManagementPolicySnapShot ( Track2 . Models . ManagementPolicySnapShot blobAction )
274
276
{
275
277
276
- this . Delete = blobAction . DeleteDaysAfterCreationGreaterThan is null ? null : new PSDateAfterCreation ( ( int ) blobAction . DeleteDaysAfterCreationGreaterThan ) ;
277
- this . TierToCool = blobAction . TierToCoolDaysAfterCreationGreaterThan is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToCoolDaysAfterCreationGreaterThan ) ;
278
- TierToArchive = blobAction . TierToArchiveDaysAfterCreationGreaterThan is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToArchiveDaysAfterCreationGreaterThan ) ;
278
+ this . Delete = blobAction . Delete is null ? null : new PSDateAfterCreation ( ( int ) blobAction . Delete . DaysAfterCreationGreaterThan ) ;
279
+ this . TierToCool = blobAction . TierToCool is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToCool . DaysAfterCreationGreaterThan ) ;
280
+ TierToArchive = blobAction . TierToArchive is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToArchive . DaysAfterCreationGreaterThan ) ;
279
281
}
280
282
public Track2 . Models . ManagementPolicySnapShot ParseManagementPolicySnapShot ( )
281
283
{
@@ -284,15 +286,17 @@ public Track2.Models.ManagementPolicySnapShot ParseManagementPolicySnapShot()
284
286
285
287
if ( this . Delete != null )
286
288
{
287
- snapShot . DeleteDaysAfterCreationGreaterThan = this . Delete . DaysAfterCreationGreaterThan ;
289
+ snapShot . Delete = new Track2 . Models . DateAfterCreation ( this . Delete . DaysAfterCreationGreaterThan ) ;
288
290
}
289
291
if ( this . TierToCool != null )
290
292
{
291
- snapShot . TierToCoolDaysAfterCreationGreaterThan = this . TierToCool . DaysAfterCreationGreaterThan ;
293
+ snapShot . TierToCool = new Track2 . Models . DateAfterCreation ( this . TierToCool . DaysAfterCreationGreaterThan ) ;
294
+ //snapShot.TierToCoolDaysAfterCreationGreaterThan = this.TierToCool.DaysAfterCreationGreaterThan;
292
295
}
293
296
if ( this . TierToArchive != null )
294
297
{
295
- snapShot . TierToArchiveDaysAfterCreationGreaterThan = this . TierToArchive . DaysAfterCreationGreaterThan ;
298
+ snapShot . TierToArchive = new Track2 . Models . DateAfterCreation ( this . TierToArchive . DaysAfterCreationGreaterThan ) ;
299
+ //snapShot.TierToArchiveDaysAfterCreationGreaterThan = this.TierToArchive.DaysAfterCreationGreaterThan;
296
300
}
297
301
298
302
return snapShot ;
@@ -313,24 +317,27 @@ public PSManagementPolicyVersion()
313
317
314
318
public PSManagementPolicyVersion ( Track2 . Models . ManagementPolicyVersion blobAction )
315
319
{
316
- this . Delete = blobAction . DeleteDaysAfterCreationGreaterThan is null ? null : new PSDateAfterCreation ( ( int ) blobAction . DeleteDaysAfterCreationGreaterThan ) ;
317
- this . TierToCool = blobAction . TierToCoolDaysAfterCreationGreaterThan is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToCoolDaysAfterCreationGreaterThan ) ;
318
- this . TierToArchive = blobAction . TierToArchiveDaysAfterCreationGreaterThan is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToArchiveDaysAfterCreationGreaterThan ) ;
320
+ this . Delete = blobAction . Delete is null ? null : new PSDateAfterCreation ( ( int ) blobAction . Delete . DaysAfterCreationGreaterThan ) ;
321
+ this . TierToCool = blobAction . TierToCool is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToCool . DaysAfterCreationGreaterThan ) ;
322
+ this . TierToArchive = blobAction . TierToArchive is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToArchive . DaysAfterCreationGreaterThan ) ;
319
323
}
320
324
public Track2 . Models . ManagementPolicyVersion ParseManagementPolicyVersion ( )
321
325
{
322
326
Track2 . Models . ManagementPolicyVersion policyVersion = new Track2 . Models . ManagementPolicyVersion ( ) ;
323
327
if ( this . Delete != null )
324
328
{
325
- policyVersion . DeleteDaysAfterCreationGreaterThan = this . Delete . DaysAfterCreationGreaterThan ;
329
+ policyVersion . Delete = new DateAfterCreation ( this . Delete . DaysAfterCreationGreaterThan ) ;
330
+ //policyVersion.DeleteDaysAfterCreationGreaterThan = this.Delete.DaysAfterCreationGreaterThan;
326
331
}
327
332
if ( this . TierToCool != null )
328
333
{
329
- policyVersion . TierToCoolDaysAfterCreationGreaterThan = this . TierToCool . DaysAfterCreationGreaterThan ;
334
+ policyVersion . TierToCool = new DateAfterCreation ( this . TierToCool . DaysAfterCreationGreaterThan ) ;
335
+ //policyVersion.TierToCoolDaysAfterCreationGreaterThan = this.TierToCool.DaysAfterCreationGreaterThan;
330
336
}
331
337
if ( this . TierToArchive != null )
332
338
{
333
- policyVersion . TierToArchiveDaysAfterCreationGreaterThan = this . TierToArchive . DaysAfterCreationGreaterThan ;
339
+ policyVersion . TierToArchive = new DateAfterCreation ( this . TierToArchive . DaysAfterCreationGreaterThan ) ;
340
+ //policyVersion.TierToArchiveDaysAfterCreationGreaterThan = this.TierToArchive.DaysAfterCreationGreaterThan;
334
341
}
335
342
336
343
return policyVersion ;
0 commit comments