func()

in v2/api/compute/v1api20240302/disk_types_gen.go [1856:2275]


func (disk *Disk_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.Disk_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Disk_STATUS, got %T", armInput)
	}

	// Set property "BurstingEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.BurstingEnabled != nil {
			burstingEnabled := *typedInput.Properties.BurstingEnabled
			disk.BurstingEnabled = &burstingEnabled
		}
	}

	// Set property "BurstingEnabledTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.BurstingEnabledTime != nil {
			burstingEnabledTime := *typedInput.Properties.BurstingEnabledTime
			disk.BurstingEnabledTime = &burstingEnabledTime
		}
	}

	// Set property "CompletionPercent":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CompletionPercent != nil {
			completionPercent := *typedInput.Properties.CompletionPercent
			disk.CompletionPercent = &completionPercent
		}
	}

	// no assignment for property "Conditions"

	// Set property "CreationData":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreationData != nil {
			var creationData1 CreationData_STATUS
			err := creationData1.PopulateFromARM(owner, *typedInput.Properties.CreationData)
			if err != nil {
				return err
			}
			creationData := creationData1
			disk.CreationData = &creationData
		}
	}

	// Set property "DataAccessAuthMode":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DataAccessAuthMode != nil {
			var temp string
			temp = string(*typedInput.Properties.DataAccessAuthMode)
			dataAccessAuthMode := DataAccessAuthMode_STATUS(temp)
			disk.DataAccessAuthMode = &dataAccessAuthMode
		}
	}

	// Set property "DiskAccessId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskAccessId != nil {
			diskAccessId := *typedInput.Properties.DiskAccessId
			disk.DiskAccessId = &diskAccessId
		}
	}

	// Set property "DiskIOPSReadOnly":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskIOPSReadOnly != nil {
			diskIOPSReadOnly := *typedInput.Properties.DiskIOPSReadOnly
			disk.DiskIOPSReadOnly = &diskIOPSReadOnly
		}
	}

	// Set property "DiskIOPSReadWrite":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskIOPSReadWrite != nil {
			diskIOPSReadWrite := *typedInput.Properties.DiskIOPSReadWrite
			disk.DiskIOPSReadWrite = &diskIOPSReadWrite
		}
	}

	// Set property "DiskMBpsReadOnly":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskMBpsReadOnly != nil {
			diskMBpsReadOnly := *typedInput.Properties.DiskMBpsReadOnly
			disk.DiskMBpsReadOnly = &diskMBpsReadOnly
		}
	}

	// Set property "DiskMBpsReadWrite":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskMBpsReadWrite != nil {
			diskMBpsReadWrite := *typedInput.Properties.DiskMBpsReadWrite
			disk.DiskMBpsReadWrite = &diskMBpsReadWrite
		}
	}

	// Set property "DiskSizeBytes":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskSizeBytes != nil {
			diskSizeBytes := *typedInput.Properties.DiskSizeBytes
			disk.DiskSizeBytes = &diskSizeBytes
		}
	}

	// Set property "DiskSizeGB":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskSizeGB != nil {
			diskSizeGB := *typedInput.Properties.DiskSizeGB
			disk.DiskSizeGB = &diskSizeGB
		}
	}

	// Set property "DiskState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskState != nil {
			var temp string
			temp = string(*typedInput.Properties.DiskState)
			diskState := DiskState_STATUS(temp)
			disk.DiskState = &diskState
		}
	}

	// Set property "Encryption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Encryption != nil {
			var encryption1 Encryption_STATUS
			err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption)
			if err != nil {
				return err
			}
			encryption := encryption1
			disk.Encryption = &encryption
		}
	}

	// Set property "EncryptionSettingsCollection":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EncryptionSettingsCollection != nil {
			var encryptionSettingsCollection1 EncryptionSettingsCollection_STATUS
			err := encryptionSettingsCollection1.PopulateFromARM(owner, *typedInput.Properties.EncryptionSettingsCollection)
			if err != nil {
				return err
			}
			encryptionSettingsCollection := encryptionSettingsCollection1
			disk.EncryptionSettingsCollection = &encryptionSettingsCollection
		}
	}

	// Set property "ExtendedLocation":
	if typedInput.ExtendedLocation != nil {
		var extendedLocation1 ExtendedLocation_STATUS
		err := extendedLocation1.PopulateFromARM(owner, *typedInput.ExtendedLocation)
		if err != nil {
			return err
		}
		extendedLocation := extendedLocation1
		disk.ExtendedLocation = &extendedLocation
	}

	// Set property "HyperVGeneration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HyperVGeneration != nil {
			var temp string
			temp = string(*typedInput.Properties.HyperVGeneration)
			hyperVGeneration := DiskProperties_HyperVGeneration_STATUS(temp)
			disk.HyperVGeneration = &hyperVGeneration
		}
	}

	// Set property "Id":
	if typedInput.Id != nil {
		id := *typedInput.Id
		disk.Id = &id
	}

	// Set property "LastOwnershipUpdateTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LastOwnershipUpdateTime != nil {
			lastOwnershipUpdateTime := *typedInput.Properties.LastOwnershipUpdateTime
			disk.LastOwnershipUpdateTime = &lastOwnershipUpdateTime
		}
	}

	// Set property "Location":
	if typedInput.Location != nil {
		location := *typedInput.Location
		disk.Location = &location
	}

	// Set property "ManagedBy":
	if typedInput.ManagedBy != nil {
		managedBy := *typedInput.ManagedBy
		disk.ManagedBy = &managedBy
	}

	// Set property "ManagedByExtended":
	for _, item := range typedInput.ManagedByExtended {
		disk.ManagedByExtended = append(disk.ManagedByExtended, item)
	}

	// Set property "MaxShares":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MaxShares != nil {
			maxShares := *typedInput.Properties.MaxShares
			disk.MaxShares = &maxShares
		}
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		disk.Name = &name
	}

	// Set property "NetworkAccessPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkAccessPolicy != nil {
			var temp string
			temp = string(*typedInput.Properties.NetworkAccessPolicy)
			networkAccessPolicy := NetworkAccessPolicy_STATUS(temp)
			disk.NetworkAccessPolicy = &networkAccessPolicy
		}
	}

	// Set property "OptimizedForFrequentAttach":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.OptimizedForFrequentAttach != nil {
			optimizedForFrequentAttach := *typedInput.Properties.OptimizedForFrequentAttach
			disk.OptimizedForFrequentAttach = &optimizedForFrequentAttach
		}
	}

	// Set property "OsType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.OsType != nil {
			var temp string
			temp = string(*typedInput.Properties.OsType)
			osType := DiskProperties_OsType_STATUS(temp)
			disk.OsType = &osType
		}
	}

	// Set property "PropertyUpdatesInProgress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PropertyUpdatesInProgress != nil {
			var propertyUpdatesInProgress1 PropertyUpdatesInProgress_STATUS
			err := propertyUpdatesInProgress1.PopulateFromARM(owner, *typedInput.Properties.PropertyUpdatesInProgress)
			if err != nil {
				return err
			}
			propertyUpdatesInProgress := propertyUpdatesInProgress1
			disk.PropertyUpdatesInProgress = &propertyUpdatesInProgress
		}
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			provisioningState := *typedInput.Properties.ProvisioningState
			disk.ProvisioningState = &provisioningState
		}
	}

	// Set property "PublicNetworkAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccess != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccess)
			publicNetworkAccess := PublicNetworkAccess_STATUS(temp)
			disk.PublicNetworkAccess = &publicNetworkAccess
		}
	}

	// Set property "PurchasePlan":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PurchasePlan != nil {
			var purchasePlan1 PurchasePlan_STATUS
			err := purchasePlan1.PopulateFromARM(owner, *typedInput.Properties.PurchasePlan)
			if err != nil {
				return err
			}
			purchasePlan := purchasePlan1
			disk.PurchasePlan = &purchasePlan
		}
	}

	// Set property "SecurityProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SecurityProfile != nil {
			var securityProfile1 DiskSecurityProfile_STATUS
			err := securityProfile1.PopulateFromARM(owner, *typedInput.Properties.SecurityProfile)
			if err != nil {
				return err
			}
			securityProfile := securityProfile1
			disk.SecurityProfile = &securityProfile
		}
	}

	// Set property "ShareInfo":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.ShareInfo {
			var item1 ShareInfoElement_STATUS
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			disk.ShareInfo = append(disk.ShareInfo, item1)
		}
	}

	// Set property "Sku":
	if typedInput.Sku != nil {
		var sku1 DiskSku_STATUS
		err := sku1.PopulateFromARM(owner, *typedInput.Sku)
		if err != nil {
			return err
		}
		sku := sku1
		disk.Sku = &sku
	}

	// Set property "SupportedCapabilities":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SupportedCapabilities != nil {
			var supportedCapabilities1 SupportedCapabilities_STATUS
			err := supportedCapabilities1.PopulateFromARM(owner, *typedInput.Properties.SupportedCapabilities)
			if err != nil {
				return err
			}
			supportedCapabilities := supportedCapabilities1
			disk.SupportedCapabilities = &supportedCapabilities
		}
	}

	// Set property "SupportsHibernation":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SupportsHibernation != nil {
			supportsHibernation := *typedInput.Properties.SupportsHibernation
			disk.SupportsHibernation = &supportsHibernation
		}
	}

	// Set property "Tags":
	if typedInput.Tags != nil {
		disk.Tags = make(map[string]string, len(typedInput.Tags))
		for key, value := range typedInput.Tags {
			disk.Tags[key] = value
		}
	}

	// Set property "Tier":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Tier != nil {
			tier := *typedInput.Properties.Tier
			disk.Tier = &tier
		}
	}

	// Set property "TimeCreated":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TimeCreated != nil {
			timeCreated := *typedInput.Properties.TimeCreated
			disk.TimeCreated = &timeCreated
		}
	}

	// Set property "Type":
	if typedInput.Type != nil {
		typeVar := *typedInput.Type
		disk.Type = &typeVar
	}

	// Set property "UniqueId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.UniqueId != nil {
			uniqueId := *typedInput.Properties.UniqueId
			disk.UniqueId = &uniqueId
		}
	}

	// Set property "Zones":
	for _, item := range typedInput.Zones {
		disk.Zones = append(disk.Zones, item)
	}

	// No error
	return nil
}