11// ----------------------------------------------------------------------------------
2- // ----------------------------------------------------------------------------------
32//
43// Copyright Microsoft Corporation
54// Licensed under the Apache License, Version 2.0 (the "License");
1312// limitations under the License.
1413// ----------------------------------------------------------------------------------
1514
16- using Track2 = Azure . ResourceManager . Storage ;
17- using Track2Models = Azure . ResourceManager . Storage . Models ;
1815using Azure . ResourceManager . Storage . Models ;
1916using Microsoft . WindowsAzure . Commands . Common . Attributes ;
2017using System ;
2118using System . Collections . Generic ;
19+ using Track2 = Azure . ResourceManager . Storage ;
20+ using Track2Models = Azure . ResourceManager . Storage . Models ;
2221
2322namespace Microsoft . Azure . Commands . Management . Storage . Models
2423{
@@ -94,20 +93,20 @@ public static PSManagementPolicyRule[] GetPSManagementPolicyRules(IList<Track2Mo
9493 return null ;
9594 }
9695 List < PSManagementPolicyRule > psrules = new List < PSManagementPolicyRule > ( ) ;
97- foreach ( Track2 . Models . ManagementPolicyRule rule in rules )
96+ foreach ( Track2Models . ManagementPolicyRule rule in rules )
9897 {
9998 psrules . Add ( new PSManagementPolicyRule ( rule ) ) ;
10099 }
101100 return psrules . ToArray ( ) ;
102101 }
103102
104- public static List < Track2 . Models . ManagementPolicyRule > ParseManagementPolicyRules ( PSManagementPolicyRule [ ] psrules )
103+ public static List < Track2Models . ManagementPolicyRule > ParseManagementPolicyRules ( PSManagementPolicyRule [ ] psrules )
105104 {
106105 if ( psrules == null )
107106 {
108107 return null ;
109108 }
110- List < Track2 . Models . ManagementPolicyRule > rules = new List < Track2 . Models . ManagementPolicyRule > ( ) ;
109+ List < Track2Models . ManagementPolicyRule > rules = new List < Track2Models . ManagementPolicyRule > ( ) ;
111110 foreach ( PSManagementPolicyRule psrule in psrules )
112111 {
113112 rules . Add ( psrule . ParseManagementPolicyRule ( ) ) ;
@@ -128,15 +127,15 @@ public PSManagementPolicyDefinition()
128127 {
129128 }
130129
131- public PSManagementPolicyDefinition ( Track2 . Models . ManagementPolicyDefinition defination )
130+ public PSManagementPolicyDefinition ( Track2Models . ManagementPolicyDefinition defination )
132131 {
133132 this . Actions = defination . Actions is null ? null : new PSManagementPolicyActionGroup ( defination . Actions ) ;
134133 this . Filters = defination . Filters is null ? null : new PSManagementPolicyRuleFilter ( defination . Filters ) ;
135134 }
136- public Track2 . Models . ManagementPolicyDefinition ParseManagementPolicyDefination ( )
135+ public Track2Models . ManagementPolicyDefinition ParseManagementPolicyDefination ( )
137136 {
138- Track2 . Models . ManagementPolicyAction actions = this . Actions ? . ParseManagementPolicyAction ( ) ;
139- Track2 . Models . ManagementPolicyDefinition policyDefinition = new Track2 . Models . ManagementPolicyDefinition ( actions ) ;
137+ Track2Models . ManagementPolicyAction actions = this . Actions ? . ParseManagementPolicyAction ( ) ;
138+ Track2Models . ManagementPolicyDefinition policyDefinition = new Track2Models . ManagementPolicyDefinition ( actions ) ;
140139 policyDefinition . Filters = this . Filters ? . ParseManagementPolicyFilter ( ) ;
141140
142141 return policyDefinition ;
@@ -159,14 +158,14 @@ public class PSManagementPolicyRuleFilter
159158 public PSManagementPolicyRuleFilter ( )
160159 { }
161160
162- public PSManagementPolicyRuleFilter ( Track2 . Models . ManagementPolicyFilter filter )
161+ public PSManagementPolicyRuleFilter ( Track2Models . ManagementPolicyFilter filter )
163162 {
164163 this . PrefixMatch = StringListToArray ( filter . PrefixMatch ) ;
165164 this . BlobTypes = StringListToArray ( filter . BlobTypes ) ;
166165 }
167- public Track2 . Models . ManagementPolicyFilter ParseManagementPolicyFilter ( )
166+ public Track2Models . ManagementPolicyFilter ParseManagementPolicyFilter ( )
168167 {
169- Track2 . Models . ManagementPolicyFilter policyFilter = new Track2 . Models . ManagementPolicyFilter ( StringArrayToList ( this . BlobTypes ) ) ;
168+ Track2Models . ManagementPolicyFilter policyFilter = new Track2Models . ManagementPolicyFilter ( StringArrayToList ( this . BlobTypes ) ) ;
170169 if ( this . PrefixMatch != null )
171170 {
172171 foreach ( string prefixMatch in this . PrefixMatch )
@@ -211,15 +210,15 @@ public class PSManagementPolicyActionGroup
211210 public PSManagementPolicyActionGroup ( )
212211 { }
213212
214- public PSManagementPolicyActionGroup ( Track2 . Models . ManagementPolicyAction action )
213+ public PSManagementPolicyActionGroup ( Track2Models . ManagementPolicyAction action )
215214 {
216215 this . BaseBlob = ( action is null || action . BaseBlob is null ) ? null : new PSManagementPolicyBaseBlob ( action . BaseBlob ) ;
217216 this . Snapshot = ( action is null || action . Snapshot is null ) ? null : new PSManagementPolicySnapShot ( action . Snapshot ) ;
218217 this . Version = ( action is null || action . Version is null ) ? null : new PSManagementPolicyVersion ( action . Version ) ;
219218 }
220- public Track2 . Models . ManagementPolicyAction ParseManagementPolicyAction ( )
219+ public Track2Models . ManagementPolicyAction ParseManagementPolicyAction ( )
221220 {
222- return new Track2 . Models . ManagementPolicyAction ( )
221+ return new Track2Models . ManagementPolicyAction ( )
223222 {
224223 BaseBlob = this . BaseBlob ? . ParseManagementPolicyBaseBlob ( ) ,
225224 Snapshot = this . Snapshot ? . ParseManagementPolicySnapShot ( ) ,
@@ -241,16 +240,16 @@ public class PSManagementPolicyBaseBlob
241240 public PSManagementPolicyBaseBlob ( )
242241 { }
243242
244- public PSManagementPolicyBaseBlob ( Track2 . Models . ManagementPolicyBaseBlob blobAction )
243+ public PSManagementPolicyBaseBlob ( Track2Models . ManagementPolicyBaseBlob blobAction )
245244 {
246245 this . TierToCool = blobAction . TierToCool is null ? null : new PSDateAfterModification ( blobAction . TierToCool ) ;
247246 this . TierToArchive = blobAction . TierToArchive is null ? null : new PSDateAfterModification ( blobAction . TierToArchive ) ;
248247 this . Delete = blobAction . Delete is null ? null : new PSDateAfterModification ( blobAction . Delete ) ;
249248 this . EnableAutoTierToHotFromCool = blobAction . EnableAutoTierToHotFromCool ;
250249 }
251- public Track2 . Models . ManagementPolicyBaseBlob ParseManagementPolicyBaseBlob ( )
250+ public Track2Models . ManagementPolicyBaseBlob ParseManagementPolicyBaseBlob ( )
252251 {
253- return new Track2 . Models . ManagementPolicyBaseBlob ( )
252+ return new Track2Models . ManagementPolicyBaseBlob ( )
254253 {
255254 TierToCool = this . TierToCool ? . ParseDateAfterModification ( ) ,
256255 TierToArchive = this . TierToArchive ? . ParseDateAfterModification ( ) ,
@@ -272,31 +271,29 @@ public class PSManagementPolicySnapShot
272271 public PSManagementPolicySnapShot ( )
273272 { }
274273
275- public PSManagementPolicySnapShot ( Track2 . Models . ManagementPolicySnapShot blobAction )
274+ public PSManagementPolicySnapShot ( Track2Models . ManagementPolicySnapShot blobAction )
276275 {
277276
278277 this . Delete = blobAction . Delete is null ? null : new PSDateAfterCreation ( ( int ) blobAction . Delete . DaysAfterCreationGreaterThan ) ;
279278 this . TierToCool = blobAction . TierToCool is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToCool . DaysAfterCreationGreaterThan ) ;
280279 TierToArchive = blobAction . TierToArchive is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToArchive . DaysAfterCreationGreaterThan ) ;
281280 }
282- public Track2 . Models . ManagementPolicySnapShot ParseManagementPolicySnapShot ( )
281+ public Track2Models . ManagementPolicySnapShot ParseManagementPolicySnapShot ( )
283282 {
284283
285- Track2 . Models . ManagementPolicySnapShot snapShot = new Track2 . Models . ManagementPolicySnapShot ( ) ;
284+ Track2Models . ManagementPolicySnapShot snapShot = new Track2Models . ManagementPolicySnapShot ( ) ;
286285
287286 if ( this . Delete != null )
288287 {
289- snapShot . Delete = new Track2 . Models . DateAfterCreation ( this . Delete . DaysAfterCreationGreaterThan ) ;
288+ snapShot . Delete = new Track2Models . DateAfterCreation ( this . Delete . DaysAfterCreationGreaterThan ) ;
290289 }
291290 if ( this . TierToCool != null )
292291 {
293- snapShot . TierToCool = new Track2 . Models . DateAfterCreation ( this . TierToCool . DaysAfterCreationGreaterThan ) ;
294- //snapShot.TierToCoolDaysAfterCreationGreaterThan = this.TierToCool.DaysAfterCreationGreaterThan;
292+ snapShot . TierToCool = new Track2Models . DateAfterCreation ( this . TierToCool . DaysAfterCreationGreaterThan ) ;
295293 }
296294 if ( this . TierToArchive != null )
297295 {
298- snapShot . TierToArchive = new Track2 . Models . DateAfterCreation ( this . TierToArchive . DaysAfterCreationGreaterThan ) ;
299- //snapShot.TierToArchiveDaysAfterCreationGreaterThan = this.TierToArchive.DaysAfterCreationGreaterThan;
296+ snapShot . TierToArchive = new Track2Models . DateAfterCreation ( this . TierToArchive . DaysAfterCreationGreaterThan ) ;
300297 }
301298
302299 return snapShot ;
@@ -315,29 +312,26 @@ public class PSManagementPolicyVersion
315312 public PSManagementPolicyVersion ( )
316313 { }
317314
318- public PSManagementPolicyVersion ( Track2 . Models . ManagementPolicyVersion blobAction )
315+ public PSManagementPolicyVersion ( Track2Models . ManagementPolicyVersion blobAction )
319316 {
320317 this . Delete = blobAction . Delete is null ? null : new PSDateAfterCreation ( ( int ) blobAction . Delete . DaysAfterCreationGreaterThan ) ;
321318 this . TierToCool = blobAction . TierToCool is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToCool . DaysAfterCreationGreaterThan ) ;
322319 this . TierToArchive = blobAction . TierToArchive is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToArchive . DaysAfterCreationGreaterThan ) ;
323320 }
324- public Track2 . Models . ManagementPolicyVersion ParseManagementPolicyVersion ( )
321+ public Track2Models . ManagementPolicyVersion ParseManagementPolicyVersion ( )
325322 {
326- Track2 . Models . ManagementPolicyVersion policyVersion = new Track2 . Models . ManagementPolicyVersion ( ) ;
323+ Track2Models . ManagementPolicyVersion policyVersion = new Track2Models . ManagementPolicyVersion ( ) ;
327324 if ( this . Delete != null )
328325 {
329326 policyVersion . Delete = new DateAfterCreation ( this . Delete . DaysAfterCreationGreaterThan ) ;
330- //policyVersion.DeleteDaysAfterCreationGreaterThan = this.Delete.DaysAfterCreationGreaterThan;
331327 }
332328 if ( this . TierToCool != null )
333329 {
334330 policyVersion . TierToCool = new DateAfterCreation ( this . TierToCool . DaysAfterCreationGreaterThan ) ;
335- //policyVersion.TierToCoolDaysAfterCreationGreaterThan = this.TierToCool.DaysAfterCreationGreaterThan;
336331 }
337332 if ( this . TierToArchive != null )
338333 {
339334 policyVersion . TierToArchive = new DateAfterCreation ( this . TierToArchive . DaysAfterCreationGreaterThan ) ;
340- //policyVersion.TierToArchiveDaysAfterCreationGreaterThan = this.TierToArchive.DaysAfterCreationGreaterThan;
341335 }
342336
343337 return policyVersion ;
@@ -380,7 +374,7 @@ public PSDateAfterModification(int? daysAfterModificationGreaterThan, int? daysA
380374 this . DaysAfterLastTierChangeGreaterThan = DaysAfterLastTierChangeGreaterThan ;
381375 }
382376
383- public PSDateAfterModification ( Track2 . Models . DateAfterModification data )
377+ public PSDateAfterModification ( Track2Models . DateAfterModification data )
384378 {
385379 if ( data . DaysAfterModificationGreaterThan is null )
386380 {
@@ -399,9 +393,9 @@ public PSDateAfterModification(Track2.Models.DateAfterModification data)
399393 this . DaysAfterLastAccessTimeGreaterThan = Convert . ToInt32 ( data . DaysAfterLastAccessTimeGreaterThan ) ;
400394 }
401395 }
402- public Track2 . Models . DateAfterModification ParseDateAfterModification ( )
396+ public Track2Models . DateAfterModification ParseDateAfterModification ( )
403397 {
404- Track2 . Models . DateAfterModification dateAfterModification = new Track2 . Models . DateAfterModification ( ) ;
398+ Track2Models . DateAfterModification dateAfterModification = new Track2Models . DateAfterModification ( ) ;
405399 dateAfterModification . DaysAfterLastAccessTimeGreaterThan = this . DaysAfterLastAccessTimeGreaterThan ;
406400 dateAfterModification . DaysAfterModificationGreaterThan = this . DaysAfterModificationGreaterThan ;
407401 // TODO: Add DaysAfterLastTierChangeGreaterThan once supported by Track2 SDK
0 commit comments