12
12
// limitations under the License.
13
13
// ----------------------------------------------------------------------------------
14
14
15
- using Track2 = global ::Azure . ResourceManager . Storage ;
16
15
using Azure . ResourceManager . Storage . Models ;
17
16
using Microsoft . WindowsAzure . Commands . Common . Attributes ;
18
17
using System ;
19
18
using System . Collections . Generic ;
19
+ using Track2 = Azure . ResourceManager . Storage ;
20
+ using Track2Models = Azure . ResourceManager . Storage . Models ;
20
21
21
22
namespace Microsoft . Azure . Commands . Management . Storage . Models
22
23
{
@@ -67,16 +68,16 @@ public PSManagementPolicyRule()
67
68
{
68
69
}
69
70
70
- public PSManagementPolicyRule ( global :: Azure . ResourceManager . Storage . Models . ManagementPolicyRule rule )
71
+ public PSManagementPolicyRule ( Track2Models . ManagementPolicyRule rule )
71
72
{
72
73
this . Enabled = rule . Enabled ;
73
74
this . Name = rule . Name ;
74
75
this . Definition = rule . Definition is null ? null : new PSManagementPolicyDefinition ( rule . Definition ) ;
75
76
}
76
77
77
- public Track2 . Models . ManagementPolicyRule ParseManagementPolicyRule ( )
78
+ public Track2Models . ManagementPolicyRule ParseManagementPolicyRule ( )
78
79
{
79
- Track2 . Models . ManagementPolicyRule rule = new Track2 . Models . ManagementPolicyRule (
80
+ Track2Models . ManagementPolicyRule rule = new Track2Models . ManagementPolicyRule (
80
81
this . Name ,
81
82
RuleType . Lifecycle ,
82
83
this . Definition ? . ParseManagementPolicyDefination ( )
@@ -85,27 +86,27 @@ public Track2.Models.ManagementPolicyRule ParseManagementPolicyRule()
85
86
return rule ;
86
87
}
87
88
88
- public static PSManagementPolicyRule [ ] GetPSManagementPolicyRules ( IList < Track2 . Models . ManagementPolicyRule > rules )
89
+ public static PSManagementPolicyRule [ ] GetPSManagementPolicyRules ( IList < Track2Models . ManagementPolicyRule > rules )
89
90
{
90
91
if ( rules == null )
91
92
{
92
93
return null ;
93
94
}
94
95
List < PSManagementPolicyRule > psrules = new List < PSManagementPolicyRule > ( ) ;
95
- foreach ( Track2 . Models . ManagementPolicyRule rule in rules )
96
+ foreach ( Track2Models . ManagementPolicyRule rule in rules )
96
97
{
97
98
psrules . Add ( new PSManagementPolicyRule ( rule ) ) ;
98
99
}
99
100
return psrules . ToArray ( ) ;
100
101
}
101
102
102
- public static List < Track2 . Models . ManagementPolicyRule > ParseManagementPolicyRules ( PSManagementPolicyRule [ ] psrules )
103
+ public static List < Track2Models . ManagementPolicyRule > ParseManagementPolicyRules ( PSManagementPolicyRule [ ] psrules )
103
104
{
104
105
if ( psrules == null )
105
106
{
106
107
return null ;
107
108
}
108
- List < Track2 . Models . ManagementPolicyRule > rules = new List < Track2 . Models . ManagementPolicyRule > ( ) ;
109
+ List < Track2Models . ManagementPolicyRule > rules = new List < Track2Models . ManagementPolicyRule > ( ) ;
109
110
foreach ( PSManagementPolicyRule psrule in psrules )
110
111
{
111
112
rules . Add ( psrule . ParseManagementPolicyRule ( ) ) ;
@@ -126,15 +127,15 @@ public PSManagementPolicyDefinition()
126
127
{
127
128
}
128
129
129
- public PSManagementPolicyDefinition ( Track2 . Models . ManagementPolicyDefinition defination )
130
+ public PSManagementPolicyDefinition ( Track2Models . ManagementPolicyDefinition defination )
130
131
{
131
132
this . Actions = defination . Actions is null ? null : new PSManagementPolicyActionGroup ( defination . Actions ) ;
132
133
this . Filters = defination . Filters is null ? null : new PSManagementPolicyRuleFilter ( defination . Filters ) ;
133
134
}
134
- public Track2 . Models . ManagementPolicyDefinition ParseManagementPolicyDefination ( )
135
+ public Track2Models . ManagementPolicyDefinition ParseManagementPolicyDefination ( )
135
136
{
136
- Track2 . Models . ManagementPolicyAction actions = this . Actions ? . ParseManagementPolicyAction ( ) ;
137
- Track2 . Models . ManagementPolicyDefinition policyDefinition = new Track2 . Models . ManagementPolicyDefinition ( actions ) ;
137
+ Track2Models . ManagementPolicyAction actions = this . Actions ? . ParseManagementPolicyAction ( ) ;
138
+ Track2Models . ManagementPolicyDefinition policyDefinition = new Track2Models . ManagementPolicyDefinition ( actions ) ;
138
139
policyDefinition . Filters = this . Filters ? . ParseManagementPolicyFilter ( ) ;
139
140
140
141
return policyDefinition ;
@@ -157,14 +158,14 @@ public class PSManagementPolicyRuleFilter
157
158
public PSManagementPolicyRuleFilter ( )
158
159
{ }
159
160
160
- public PSManagementPolicyRuleFilter ( Track2 . Models . ManagementPolicyFilter filter )
161
+ public PSManagementPolicyRuleFilter ( Track2Models . ManagementPolicyFilter filter )
161
162
{
162
163
this . PrefixMatch = StringListToArray ( filter . PrefixMatch ) ;
163
164
this . BlobTypes = StringListToArray ( filter . BlobTypes ) ;
164
165
}
165
- public Track2 . Models . ManagementPolicyFilter ParseManagementPolicyFilter ( )
166
+ public Track2Models . ManagementPolicyFilter ParseManagementPolicyFilter ( )
166
167
{
167
- Track2 . Models . ManagementPolicyFilter policyFilter = new Track2 . Models . ManagementPolicyFilter ( StringArrayToList ( this . BlobTypes ) ) ;
168
+ Track2Models . ManagementPolicyFilter policyFilter = new Track2Models . ManagementPolicyFilter ( StringArrayToList ( this . BlobTypes ) ) ;
168
169
if ( this . PrefixMatch != null )
169
170
{
170
171
foreach ( string prefixMatch in this . PrefixMatch )
@@ -209,15 +210,15 @@ public class PSManagementPolicyActionGroup
209
210
public PSManagementPolicyActionGroup ( )
210
211
{ }
211
212
212
- public PSManagementPolicyActionGroup ( Track2 . Models . ManagementPolicyAction action )
213
+ public PSManagementPolicyActionGroup ( Track2Models . ManagementPolicyAction action )
213
214
{
214
215
this . BaseBlob = ( action is null || action . BaseBlob is null ) ? null : new PSManagementPolicyBaseBlob ( action . BaseBlob ) ;
215
216
this . Snapshot = ( action is null || action . Snapshot is null ) ? null : new PSManagementPolicySnapShot ( action . Snapshot ) ;
216
217
this . Version = ( action is null || action . Version is null ) ? null : new PSManagementPolicyVersion ( action . Version ) ;
217
218
}
218
- public Track2 . Models . ManagementPolicyAction ParseManagementPolicyAction ( )
219
+ public Track2Models . ManagementPolicyAction ParseManagementPolicyAction ( )
219
220
{
220
- return new Track2 . Models . ManagementPolicyAction ( )
221
+ return new Track2Models . ManagementPolicyAction ( )
221
222
{
222
223
BaseBlob = this . BaseBlob ? . ParseManagementPolicyBaseBlob ( ) ,
223
224
Snapshot = this . Snapshot ? . ParseManagementPolicySnapShot ( ) ,
@@ -239,16 +240,16 @@ public class PSManagementPolicyBaseBlob
239
240
public PSManagementPolicyBaseBlob ( )
240
241
{ }
241
242
242
- public PSManagementPolicyBaseBlob ( Track2 . Models . ManagementPolicyBaseBlob blobAction )
243
+ public PSManagementPolicyBaseBlob ( Track2Models . ManagementPolicyBaseBlob blobAction )
243
244
{
244
245
this . TierToCool = blobAction . TierToCool is null ? null : new PSDateAfterModification ( blobAction . TierToCool ) ;
245
246
this . TierToArchive = blobAction . TierToArchive is null ? null : new PSDateAfterModification ( blobAction . TierToArchive ) ;
246
247
this . Delete = blobAction . Delete is null ? null : new PSDateAfterModification ( blobAction . Delete ) ;
247
248
this . EnableAutoTierToHotFromCool = blobAction . EnableAutoTierToHotFromCool ;
248
249
}
249
- public Track2 . Models . ManagementPolicyBaseBlob ParseManagementPolicyBaseBlob ( )
250
+ public Track2Models . ManagementPolicyBaseBlob ParseManagementPolicyBaseBlob ( )
250
251
{
251
- return new Track2 . Models . ManagementPolicyBaseBlob ( )
252
+ return new Track2Models . ManagementPolicyBaseBlob ( )
252
253
{
253
254
TierToCool = this . TierToCool ? . ParseDateAfterModification ( ) ,
254
255
TierToArchive = this . TierToArchive ? . ParseDateAfterModification ( ) ,
@@ -270,29 +271,29 @@ public class PSManagementPolicySnapShot
270
271
public PSManagementPolicySnapShot ( )
271
272
{ }
272
273
273
- public PSManagementPolicySnapShot ( Track2 . Models . ManagementPolicySnapShot blobAction )
274
+ public PSManagementPolicySnapShot ( Track2Models . ManagementPolicySnapShot blobAction )
274
275
{
275
276
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 ) ;
277
+ this . Delete = blobAction . Delete is null ? null : new PSDateAfterCreation ( ( int ) blobAction . Delete . DaysAfterCreationGreaterThan ) ;
278
+ this . TierToCool = blobAction . TierToCool is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToCool . DaysAfterCreationGreaterThan ) ;
279
+ TierToArchive = blobAction . TierToArchive is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToArchive . DaysAfterCreationGreaterThan ) ;
279
280
}
280
- public Track2 . Models . ManagementPolicySnapShot ParseManagementPolicySnapShot ( )
281
+ public Track2Models . ManagementPolicySnapShot ParseManagementPolicySnapShot ( )
281
282
{
282
283
283
- Track2 . Models . ManagementPolicySnapShot snapShot = new Track2 . Models . ManagementPolicySnapShot ( ) ;
284
+ Track2Models . ManagementPolicySnapShot snapShot = new Track2Models . ManagementPolicySnapShot ( ) ;
284
285
285
286
if ( this . Delete != null )
286
287
{
287
- snapShot . DeleteDaysAfterCreationGreaterThan = this . Delete . DaysAfterCreationGreaterThan ;
288
+ snapShot . Delete = new Track2Models . DateAfterCreation ( this . Delete . DaysAfterCreationGreaterThan ) ;
288
289
}
289
290
if ( this . TierToCool != null )
290
291
{
291
- snapShot . TierToCoolDaysAfterCreationGreaterThan = this . TierToCool . DaysAfterCreationGreaterThan ;
292
+ snapShot . TierToCool = new Track2Models . DateAfterCreation ( this . TierToCool . DaysAfterCreationGreaterThan ) ;
292
293
}
293
294
if ( this . TierToArchive != null )
294
295
{
295
- snapShot . TierToArchiveDaysAfterCreationGreaterThan = this . TierToArchive . DaysAfterCreationGreaterThan ;
296
+ snapShot . TierToArchive = new Track2Models . DateAfterCreation ( this . TierToArchive . DaysAfterCreationGreaterThan ) ;
296
297
}
297
298
298
299
return snapShot ;
@@ -311,26 +312,26 @@ public class PSManagementPolicyVersion
311
312
public PSManagementPolicyVersion ( )
312
313
{ }
313
314
314
- public PSManagementPolicyVersion ( Track2 . Models . ManagementPolicyVersion blobAction )
315
+ public PSManagementPolicyVersion ( Track2Models . ManagementPolicyVersion blobAction )
315
316
{
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 ) ;
317
+ this . Delete = blobAction . Delete is null ? null : new PSDateAfterCreation ( ( int ) blobAction . Delete . DaysAfterCreationGreaterThan ) ;
318
+ this . TierToCool = blobAction . TierToCool is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToCool . DaysAfterCreationGreaterThan ) ;
319
+ this . TierToArchive = blobAction . TierToArchive is null ? null : new PSDateAfterCreation ( ( int ) blobAction . TierToArchive . DaysAfterCreationGreaterThan ) ;
319
320
}
320
- public Track2 . Models . ManagementPolicyVersion ParseManagementPolicyVersion ( )
321
+ public Track2Models . ManagementPolicyVersion ParseManagementPolicyVersion ( )
321
322
{
322
- Track2 . Models . ManagementPolicyVersion policyVersion = new Track2 . Models . ManagementPolicyVersion ( ) ;
323
+ Track2Models . ManagementPolicyVersion policyVersion = new Track2Models . ManagementPolicyVersion ( ) ;
323
324
if ( this . Delete != null )
324
325
{
325
- policyVersion . DeleteDaysAfterCreationGreaterThan = this . Delete . DaysAfterCreationGreaterThan ;
326
+ policyVersion . Delete = new DateAfterCreation ( this . Delete . DaysAfterCreationGreaterThan ) ;
326
327
}
327
328
if ( this . TierToCool != null )
328
329
{
329
- policyVersion . TierToCoolDaysAfterCreationGreaterThan = this . TierToCool . DaysAfterCreationGreaterThan ;
330
+ policyVersion . TierToCool = new DateAfterCreation ( this . TierToCool . DaysAfterCreationGreaterThan ) ;
330
331
}
331
332
if ( this . TierToArchive != null )
332
333
{
333
- policyVersion . TierToArchiveDaysAfterCreationGreaterThan = this . TierToArchive . DaysAfterCreationGreaterThan ;
334
+ policyVersion . TierToArchive = new DateAfterCreation ( this . TierToArchive . DaysAfterCreationGreaterThan ) ;
334
335
}
335
336
336
337
return policyVersion ;
@@ -373,7 +374,7 @@ public PSDateAfterModification(int? daysAfterModificationGreaterThan, int? daysA
373
374
this . DaysAfterLastTierChangeGreaterThan = DaysAfterLastTierChangeGreaterThan ;
374
375
}
375
376
376
- public PSDateAfterModification ( Track2 . Models . DateAfterModification data )
377
+ public PSDateAfterModification ( Track2Models . DateAfterModification data )
377
378
{
378
379
if ( data . DaysAfterModificationGreaterThan is null )
379
380
{
@@ -392,9 +393,9 @@ public PSDateAfterModification(Track2.Models.DateAfterModification data)
392
393
this . DaysAfterLastAccessTimeGreaterThan = Convert . ToInt32 ( data . DaysAfterLastAccessTimeGreaterThan ) ;
393
394
}
394
395
}
395
- public Track2 . Models . DateAfterModification ParseDateAfterModification ( )
396
+ public Track2Models . DateAfterModification ParseDateAfterModification ( )
396
397
{
397
- Track2 . Models . DateAfterModification dateAfterModification = new Track2 . Models . DateAfterModification ( ) ;
398
+ Track2Models . DateAfterModification dateAfterModification = new Track2Models . DateAfterModification ( ) ;
398
399
dateAfterModification . DaysAfterLastAccessTimeGreaterThan = this . DaysAfterLastAccessTimeGreaterThan ;
399
400
dateAfterModification . DaysAfterModificationGreaterThan = this . DaysAfterModificationGreaterThan ;
400
401
// TODO: Add DaysAfterLastTierChangeGreaterThan once supported by Track2 SDK
0 commit comments