func()

in v2/api/network/v1api20240301/network_interface_types_gen.go [1264:1568]


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

	// Set property "AuxiliaryMode":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AuxiliaryMode != nil {
			var temp string
			temp = string(*typedInput.Properties.AuxiliaryMode)
			auxiliaryMode := NetworkInterfacePropertiesFormat_AuxiliaryMode_STATUS(temp)
			embedded.AuxiliaryMode = &auxiliaryMode
		}
	}

	// Set property "AuxiliarySku":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AuxiliarySku != nil {
			var temp string
			temp = string(*typedInput.Properties.AuxiliarySku)
			auxiliarySku := NetworkInterfacePropertiesFormat_AuxiliarySku_STATUS(temp)
			embedded.AuxiliarySku = &auxiliarySku
		}
	}

	// no assignment for property "Conditions"

	// Set property "DisableTcpStateTracking":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisableTcpStateTracking != nil {
			disableTcpStateTracking := *typedInput.Properties.DisableTcpStateTracking
			embedded.DisableTcpStateTracking = &disableTcpStateTracking
		}
	}

	// Set property "DnsSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DnsSettings != nil {
			var dnsSettings1 NetworkInterfaceDnsSettings_STATUS
			err := dnsSettings1.PopulateFromARM(owner, *typedInput.Properties.DnsSettings)
			if err != nil {
				return err
			}
			dnsSettings := dnsSettings1
			embedded.DnsSettings = &dnsSettings
		}
	}

	// Set property "DscpConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DscpConfiguration != nil {
			var dscpConfiguration1 SubResource_STATUS
			err := dscpConfiguration1.PopulateFromARM(owner, *typedInput.Properties.DscpConfiguration)
			if err != nil {
				return err
			}
			dscpConfiguration := dscpConfiguration1
			embedded.DscpConfiguration = &dscpConfiguration
		}
	}

	// Set property "EnableAcceleratedNetworking":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableAcceleratedNetworking != nil {
			enableAcceleratedNetworking := *typedInput.Properties.EnableAcceleratedNetworking
			embedded.EnableAcceleratedNetworking = &enableAcceleratedNetworking
		}
	}

	// Set property "EnableIPForwarding":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableIPForwarding != nil {
			enableIPForwarding := *typedInput.Properties.EnableIPForwarding
			embedded.EnableIPForwarding = &enableIPForwarding
		}
	}

	// Set property "Etag":
	if typedInput.Etag != nil {
		etag := *typedInput.Etag
		embedded.Etag = &etag
	}

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

	// Set property "HostedWorkloads":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.HostedWorkloads {
			embedded.HostedWorkloads = append(embedded.HostedWorkloads, item)
		}
	}

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

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

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

	// Set property "MacAddress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MacAddress != nil {
			macAddress := *typedInput.Properties.MacAddress
			embedded.MacAddress = &macAddress
		}
	}

	// Set property "MigrationPhase":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MigrationPhase != nil {
			var temp string
			temp = string(*typedInput.Properties.MigrationPhase)
			migrationPhase := NetworkInterfacePropertiesFormat_MigrationPhase_STATUS(temp)
			embedded.MigrationPhase = &migrationPhase
		}
	}

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

	// Set property "NetworkSecurityGroup":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkSecurityGroup != nil {
			var networkSecurityGroup1 NetworkSecurityGroup_STATUS_NetworkInterface_SubResourceEmbedded
			err := networkSecurityGroup1.PopulateFromARM(owner, *typedInput.Properties.NetworkSecurityGroup)
			if err != nil {
				return err
			}
			networkSecurityGroup := networkSecurityGroup1
			embedded.NetworkSecurityGroup = &networkSecurityGroup
		}
	}

	// Set property "NicType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NicType != nil {
			var temp string
			temp = string(*typedInput.Properties.NicType)
			nicType := NetworkInterfacePropertiesFormat_NicType_STATUS(temp)
			embedded.NicType = &nicType
		}
	}

	// Set property "Primary":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Primary != nil {
			primary := *typedInput.Properties.Primary
			embedded.Primary = &primary
		}
	}

	// Set property "PrivateEndpoint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrivateEndpoint != nil {
			var privateEndpoint1 PrivateEndpoint_STATUS_NetworkInterface_SubResourceEmbedded
			err := privateEndpoint1.PopulateFromARM(owner, *typedInput.Properties.PrivateEndpoint)
			if err != nil {
				return err
			}
			privateEndpoint := privateEndpoint1
			embedded.PrivateEndpoint = &privateEndpoint
		}
	}

	// Set property "PrivateLinkService":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrivateLinkService != nil {
			var privateLinkService1 PrivateLinkService_STATUS_NetworkInterface_SubResourceEmbedded
			err := privateLinkService1.PopulateFromARM(owner, *typedInput.Properties.PrivateLinkService)
			if err != nil {
				return err
			}
			privateLinkService := privateLinkService1
			embedded.PrivateLinkService = &privateLinkService
		}
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			var temp string
			temp = string(*typedInput.Properties.ProvisioningState)
			provisioningState := ProvisioningState_STATUS(temp)
			embedded.ProvisioningState = &provisioningState
		}
	}

	// Set property "ResourceGuid":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ResourceGuid != nil {
			resourceGuid := *typedInput.Properties.ResourceGuid
			embedded.ResourceGuid = &resourceGuid
		}
	}

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

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

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

	// Set property "VirtualMachine":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VirtualMachine != nil {
			var virtualMachine1 SubResource_STATUS
			err := virtualMachine1.PopulateFromARM(owner, *typedInput.Properties.VirtualMachine)
			if err != nil {
				return err
			}
			virtualMachine := virtualMachine1
			embedded.VirtualMachine = &virtualMachine
		}
	}

	// Set property "VnetEncryptionSupported":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VnetEncryptionSupported != nil {
			vnetEncryptionSupported := *typedInput.Properties.VnetEncryptionSupported
			embedded.VnetEncryptionSupported = &vnetEncryptionSupported
		}
	}

	// Set property "WorkloadType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.WorkloadType != nil {
			workloadType := *typedInput.Properties.WorkloadType
			embedded.WorkloadType = &workloadType
		}
	}

	// No error
	return nil
}