File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/Storage/Storage.Management/Models Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 22
22
using Microsoft . WindowsAzure . Commands . Common . Attributes ;
23
23
using StorageModels = Microsoft . Azure . Management . Storage . Models ;
24
24
using Microsoft . Azure . Management . Internal . Resources . Utilities . Models ;
25
+ using Newtonsoft . Json . Serialization ;
26
+ using Newtonsoft . Json ;
25
27
26
28
namespace Microsoft . Azure . Commands . Management . Storage . Models
27
29
{
@@ -193,6 +195,26 @@ public override string ToString()
193
195
// Allow listing storage contents through piping
194
196
return null ;
195
197
}
198
+
199
+ /// <summary>
200
+ /// Function used by piping PSStorageAccount to autorest based cmdlets
201
+ /// </summary>
202
+ /// <returns></returns>
203
+ public string ToJsonString ( )
204
+ {
205
+ DefaultContractResolver contractResolver = new DefaultContractResolver
206
+ {
207
+ NamingStrategy = new CamelCaseNamingStrategy ( )
208
+ } ;
209
+ PSStorageAccount result = MemberwiseClone ( ) as PSStorageAccount ;
210
+ result . Context = null ;
211
+
212
+ return JsonConvert . SerializeObject ( result , new JsonSerializerSettings
213
+ {
214
+ ContractResolver = contractResolver ,
215
+ Formatting = Formatting . Indented ,
216
+ } ) ;
217
+ }
196
218
}
197
219
198
220
public class PSCustomDomain
You can’t perform that action at this time.
0 commit comments