コード例 #1
0
 ///GENMHASH:46AD705474F82EB01989BDC537143CDA:E24CCAC647CB1E84A09989E367AC3866
 public IReadOnlyList <Models.DiskSkuTypes> UnsupportedDiskTypes()
 {
     if (this.Inner.Disallowed == null || this.Inner.Disallowed.DiskTypes == null)
     {
         return(new List <Models.DiskSkuTypes>());
     }
     else
     {
         List <DiskSkuTypes> diskTypes = new List <DiskSkuTypes>();
         foreach (var diskTypeStr in this.Inner.Disallowed.DiskTypes)
         {
             diskTypes.Add(DiskSkuTypes.FromStorageAccountType(DiskStorageAccountTypes.Parse(diskTypeStr)));
         }
         return(diskTypes);
     }
 }
コード例 #2
0
 ///GENMHASH:08C16A717E4778526168C783D7E02873:5CDB83FF69B6F42640F7ADC9D700AF7A
 public DiskSkuTypes DiskSkuType()
 {
     if (this.inner.ResourceType != null &&
         (this.inner.ResourceType.Equals("disks", System.StringComparison.OrdinalIgnoreCase) ||
          this.inner.ResourceType.Equals("snapshots", System.StringComparison.OrdinalIgnoreCase)) &&
         this.inner.Name != null)
     {
         if (this.inner.Name.Equals("Standard_LRS", System.StringComparison.OrdinalIgnoreCase))
         {
             return(DiskSkuTypes.FromStorageAccountType(StorageAccountTypes.StandardLRS));
         }
         if (this.inner.Name.Equals("Premium_LRS", System.StringComparison.OrdinalIgnoreCase))
         {
             return(DiskSkuTypes.FromStorageAccountType(StorageAccountTypes.PremiumLRS));
         }
         return(null);
     }
     else
     {
         return(null);
     }
 }
コード例 #3
0
 ///GENMHASH:327CBF262F4C69D4F67206A8BC678FD6:6E1EBADD62B789305803912915AD8226
 public GalleryImageImpl WithoutUnsupportedDiskType(DiskSkuTypes diskType)
 {
     if (this.Inner.Disallowed != null && this.Inner.Disallowed.DiskTypes != null)
     {
         int    foundIndex       = -1;
         int    i                = 0;
         string diskTypeToRemove = diskType.ToString();
         foreach (var diskTypeStr in this.Inner.Disallowed.DiskTypes)
         {
             if (diskTypeStr.Equals(diskTypeToRemove, StringComparison.OrdinalIgnoreCase))
             {
                 foundIndex = i;
                 break;
             }
             i++;
         }
         if (foundIndex != -1)
         {
             this.Inner.Disallowed.DiskTypes.RemoveAt(foundIndex);
         }
     }
     return(this);
 }
コード例 #4
0
 /// <summary>
 /// Specifies the SKU.
 /// </summary>
 /// <param name="sku">The SKU.</param>
 /// <return>The next stage of the definition.</return>
 Disk.Definition.IWithCreate Disk.Definition.IWithSku.WithSku(DiskSkuTypes sku)
 {
     return(this.WithSku(sku) as Disk.Definition.IWithCreate);
 }
コード例 #5
0
 /// <summary>
 /// Specifies the SKU.
 /// </summary>
 /// <param name="sku">A SKU.</param>
 /// <return>The next stage of the update.</return>
 Disk.Update.IUpdate Disk.Update.IWithSku.WithSku(DiskSkuTypes sku)
 {
     return(this.WithSku(sku) as Disk.Update.IUpdate);
 }
コード例 #6
0
 /// <summary>
 /// Specifies the disk type not supported by the image.
 /// </summary>
 /// <param name="diskType">The disk type.</param>
 /// <return>The next definition stage.</return>
 GalleryImage.Definition.IWithCreate GalleryImage.Definition.IWithDisallowed.WithUnsupportedDiskType(DiskSkuTypes diskType)
 {
     return(this.WithUnsupportedDiskType(diskType));
 }
コード例 #7
0
 /// <summary>
 /// Specifies the disk type not supported by the image.
 /// </summary>
 /// <param name="diskType">The disk type.</param>
 /// <return>The next update stage.</return>
 GalleryImage.Update.IUpdate GalleryImage.Update.IWithDisallowed.WithUnsupportedDiskType(DiskSkuTypes diskType)
 {
     return(this.WithUnsupportedDiskType(diskType));
 }
コード例 #8
0
 Snapshot.Definition.IWithCreate Snapshot.Definition.IWithSku.WithSku(DiskSkuTypes sku)
 {
     return(this.WithSku(sku) as Snapshot.Definition.IWithCreate);
 }
コード例 #9
0
 Snapshot.Update.IUpdate Snapshot.Update.IWithSku.WithSku(DiskSkuTypes sku)
 {
     return(this.WithSku(sku) as Snapshot.Update.IUpdate);
 }