func()

in v2/api/containerservice/v1api20240402preview/managed_clusters_agent_pool_types_gen.go [3233:3644]


func (pool *ManagedClustersAgentPool_STATUS) AssignProperties_From_ManagedClustersAgentPool_STATUS(source *storage.ManagedClustersAgentPool_STATUS) error {

	// ArtifactStreamingProfile
	if source.ArtifactStreamingProfile != nil {
		var artifactStreamingProfile AgentPoolArtifactStreamingProfile_STATUS
		err := artifactStreamingProfile.AssignProperties_From_AgentPoolArtifactStreamingProfile_STATUS(source.ArtifactStreamingProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AgentPoolArtifactStreamingProfile_STATUS() to populate field ArtifactStreamingProfile")
		}
		pool.ArtifactStreamingProfile = &artifactStreamingProfile
	} else {
		pool.ArtifactStreamingProfile = nil
	}

	// AvailabilityZones
	pool.AvailabilityZones = genruntime.CloneSliceOfString(source.AvailabilityZones)

	// CapacityReservationGroupID
	pool.CapacityReservationGroupID = genruntime.ClonePointerToString(source.CapacityReservationGroupID)

	// Conditions
	pool.Conditions = genruntime.CloneSliceOfCondition(source.Conditions)

	// Count
	pool.Count = genruntime.ClonePointerToInt(source.Count)

	// CreationData
	if source.CreationData != nil {
		var creationDatum CreationData_STATUS
		err := creationDatum.AssignProperties_From_CreationData_STATUS(source.CreationData)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CreationData_STATUS() to populate field CreationData")
		}
		pool.CreationData = &creationDatum
	} else {
		pool.CreationData = nil
	}

	// CurrentOrchestratorVersion
	pool.CurrentOrchestratorVersion = genruntime.ClonePointerToString(source.CurrentOrchestratorVersion)

	// ETag
	pool.ETag = genruntime.ClonePointerToString(source.ETag)

	// EnableAutoScaling
	if source.EnableAutoScaling != nil {
		enableAutoScaling := *source.EnableAutoScaling
		pool.EnableAutoScaling = &enableAutoScaling
	} else {
		pool.EnableAutoScaling = nil
	}

	// EnableCustomCATrust
	if source.EnableCustomCATrust != nil {
		enableCustomCATrust := *source.EnableCustomCATrust
		pool.EnableCustomCATrust = &enableCustomCATrust
	} else {
		pool.EnableCustomCATrust = nil
	}

	// EnableEncryptionAtHost
	if source.EnableEncryptionAtHost != nil {
		enableEncryptionAtHost := *source.EnableEncryptionAtHost
		pool.EnableEncryptionAtHost = &enableEncryptionAtHost
	} else {
		pool.EnableEncryptionAtHost = nil
	}

	// EnableFIPS
	if source.EnableFIPS != nil {
		enableFIPS := *source.EnableFIPS
		pool.EnableFIPS = &enableFIPS
	} else {
		pool.EnableFIPS = nil
	}

	// EnableNodePublicIP
	if source.EnableNodePublicIP != nil {
		enableNodePublicIP := *source.EnableNodePublicIP
		pool.EnableNodePublicIP = &enableNodePublicIP
	} else {
		pool.EnableNodePublicIP = nil
	}

	// EnableUltraSSD
	if source.EnableUltraSSD != nil {
		enableUltraSSD := *source.EnableUltraSSD
		pool.EnableUltraSSD = &enableUltraSSD
	} else {
		pool.EnableUltraSSD = nil
	}

	// GatewayProfile
	if source.GatewayProfile != nil {
		var gatewayProfile AgentPoolGatewayProfile_STATUS
		err := gatewayProfile.AssignProperties_From_AgentPoolGatewayProfile_STATUS(source.GatewayProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AgentPoolGatewayProfile_STATUS() to populate field GatewayProfile")
		}
		pool.GatewayProfile = &gatewayProfile
	} else {
		pool.GatewayProfile = nil
	}

	// GpuInstanceProfile
	if source.GpuInstanceProfile != nil {
		gpuInstanceProfile := *source.GpuInstanceProfile
		gpuInstanceProfileTemp := genruntime.ToEnum(gpuInstanceProfile, gPUInstanceProfile_STATUS_Values)
		pool.GpuInstanceProfile = &gpuInstanceProfileTemp
	} else {
		pool.GpuInstanceProfile = nil
	}

	// GpuProfile
	if source.GpuProfile != nil {
		var gpuProfile AgentPoolGPUProfile_STATUS
		err := gpuProfile.AssignProperties_From_AgentPoolGPUProfile_STATUS(source.GpuProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AgentPoolGPUProfile_STATUS() to populate field GpuProfile")
		}
		pool.GpuProfile = &gpuProfile
	} else {
		pool.GpuProfile = nil
	}

	// HostGroupID
	pool.HostGroupID = genruntime.ClonePointerToString(source.HostGroupID)

	// Id
	pool.Id = genruntime.ClonePointerToString(source.Id)

	// KubeletConfig
	if source.KubeletConfig != nil {
		var kubeletConfig KubeletConfig_STATUS
		err := kubeletConfig.AssignProperties_From_KubeletConfig_STATUS(source.KubeletConfig)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_KubeletConfig_STATUS() to populate field KubeletConfig")
		}
		pool.KubeletConfig = &kubeletConfig
	} else {
		pool.KubeletConfig = nil
	}

	// KubeletDiskType
	if source.KubeletDiskType != nil {
		kubeletDiskType := *source.KubeletDiskType
		kubeletDiskTypeTemp := genruntime.ToEnum(kubeletDiskType, kubeletDiskType_STATUS_Values)
		pool.KubeletDiskType = &kubeletDiskTypeTemp
	} else {
		pool.KubeletDiskType = nil
	}

	// LinuxOSConfig
	if source.LinuxOSConfig != nil {
		var linuxOSConfig LinuxOSConfig_STATUS
		err := linuxOSConfig.AssignProperties_From_LinuxOSConfig_STATUS(source.LinuxOSConfig)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_LinuxOSConfig_STATUS() to populate field LinuxOSConfig")
		}
		pool.LinuxOSConfig = &linuxOSConfig
	} else {
		pool.LinuxOSConfig = nil
	}

	// MaxCount
	pool.MaxCount = genruntime.ClonePointerToInt(source.MaxCount)

	// MaxPods
	pool.MaxPods = genruntime.ClonePointerToInt(source.MaxPods)

	// MessageOfTheDay
	pool.MessageOfTheDay = genruntime.ClonePointerToString(source.MessageOfTheDay)

	// MinCount
	pool.MinCount = genruntime.ClonePointerToInt(source.MinCount)

	// Mode
	if source.Mode != nil {
		mode := *source.Mode
		modeTemp := genruntime.ToEnum(mode, agentPoolMode_STATUS_Values)
		pool.Mode = &modeTemp
	} else {
		pool.Mode = nil
	}

	// Name
	pool.Name = genruntime.ClonePointerToString(source.Name)

	// NetworkProfile
	if source.NetworkProfile != nil {
		var networkProfile AgentPoolNetworkProfile_STATUS
		err := networkProfile.AssignProperties_From_AgentPoolNetworkProfile_STATUS(source.NetworkProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AgentPoolNetworkProfile_STATUS() to populate field NetworkProfile")
		}
		pool.NetworkProfile = &networkProfile
	} else {
		pool.NetworkProfile = nil
	}

	// NodeImageVersion
	pool.NodeImageVersion = genruntime.ClonePointerToString(source.NodeImageVersion)

	// NodeInitializationTaints
	pool.NodeInitializationTaints = genruntime.CloneSliceOfString(source.NodeInitializationTaints)

	// NodeLabels
	pool.NodeLabels = genruntime.CloneMapOfStringToString(source.NodeLabels)

	// NodePublicIPPrefixID
	pool.NodePublicIPPrefixID = genruntime.ClonePointerToString(source.NodePublicIPPrefixID)

	// NodeTaints
	pool.NodeTaints = genruntime.CloneSliceOfString(source.NodeTaints)

	// OrchestratorVersion
	pool.OrchestratorVersion = genruntime.ClonePointerToString(source.OrchestratorVersion)

	// OsDiskSizeGB
	pool.OsDiskSizeGB = genruntime.ClonePointerToInt(source.OsDiskSizeGB)

	// OsDiskType
	if source.OsDiskType != nil {
		osDiskType := *source.OsDiskType
		osDiskTypeTemp := genruntime.ToEnum(osDiskType, oSDiskType_STATUS_Values)
		pool.OsDiskType = &osDiskTypeTemp
	} else {
		pool.OsDiskType = nil
	}

	// OsSKU
	if source.OsSKU != nil {
		osSKU := *source.OsSKU
		osSKUTemp := genruntime.ToEnum(osSKU, oSSKU_STATUS_Values)
		pool.OsSKU = &osSKUTemp
	} else {
		pool.OsSKU = nil
	}

	// OsType
	if source.OsType != nil {
		osType := *source.OsType
		osTypeTemp := genruntime.ToEnum(osType, oSType_STATUS_Values)
		pool.OsType = &osTypeTemp
	} else {
		pool.OsType = nil
	}

	// PodIPAllocationMode
	if source.PodIPAllocationMode != nil {
		podIPAllocationMode := *source.PodIPAllocationMode
		podIPAllocationModeTemp := genruntime.ToEnum(podIPAllocationMode, podIPAllocationMode_STATUS_Values)
		pool.PodIPAllocationMode = &podIPAllocationModeTemp
	} else {
		pool.PodIPAllocationMode = nil
	}

	// PodSubnetID
	pool.PodSubnetID = genruntime.ClonePointerToString(source.PodSubnetID)

	// PowerState
	if source.PowerState != nil {
		var powerState PowerState_STATUS
		err := powerState.AssignProperties_From_PowerState_STATUS(source.PowerState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_PowerState_STATUS() to populate field PowerState")
		}
		pool.PowerState = &powerState
	} else {
		pool.PowerState = nil
	}

	// PropertiesType
	if source.PropertiesType != nil {
		propertiesType := *source.PropertiesType
		propertiesTypeTemp := genruntime.ToEnum(propertiesType, agentPoolType_STATUS_Values)
		pool.PropertiesType = &propertiesTypeTemp
	} else {
		pool.PropertiesType = nil
	}

	// ProvisioningState
	pool.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState)

	// ProximityPlacementGroupID
	pool.ProximityPlacementGroupID = genruntime.ClonePointerToString(source.ProximityPlacementGroupID)

	// ScaleDownMode
	if source.ScaleDownMode != nil {
		scaleDownMode := *source.ScaleDownMode
		scaleDownModeTemp := genruntime.ToEnum(scaleDownMode, scaleDownMode_STATUS_Values)
		pool.ScaleDownMode = &scaleDownModeTemp
	} else {
		pool.ScaleDownMode = nil
	}

	// ScaleSetEvictionPolicy
	if source.ScaleSetEvictionPolicy != nil {
		scaleSetEvictionPolicy := *source.ScaleSetEvictionPolicy
		scaleSetEvictionPolicyTemp := genruntime.ToEnum(scaleSetEvictionPolicy, scaleSetEvictionPolicy_STATUS_Values)
		pool.ScaleSetEvictionPolicy = &scaleSetEvictionPolicyTemp
	} else {
		pool.ScaleSetEvictionPolicy = nil
	}

	// ScaleSetPriority
	if source.ScaleSetPriority != nil {
		scaleSetPriority := *source.ScaleSetPriority
		scaleSetPriorityTemp := genruntime.ToEnum(scaleSetPriority, scaleSetPriority_STATUS_Values)
		pool.ScaleSetPriority = &scaleSetPriorityTemp
	} else {
		pool.ScaleSetPriority = nil
	}

	// SecurityProfile
	if source.SecurityProfile != nil {
		var securityProfile AgentPoolSecurityProfile_STATUS
		err := securityProfile.AssignProperties_From_AgentPoolSecurityProfile_STATUS(source.SecurityProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AgentPoolSecurityProfile_STATUS() to populate field SecurityProfile")
		}
		pool.SecurityProfile = &securityProfile
	} else {
		pool.SecurityProfile = nil
	}

	// SpotMaxPrice
	if source.SpotMaxPrice != nil {
		spotMaxPrice := *source.SpotMaxPrice
		pool.SpotMaxPrice = &spotMaxPrice
	} else {
		pool.SpotMaxPrice = nil
	}

	// Tags
	pool.Tags = genruntime.CloneMapOfStringToString(source.Tags)

	// Type
	pool.Type = genruntime.ClonePointerToString(source.Type)

	// UpgradeSettings
	if source.UpgradeSettings != nil {
		var upgradeSetting AgentPoolUpgradeSettings_STATUS
		err := upgradeSetting.AssignProperties_From_AgentPoolUpgradeSettings_STATUS(source.UpgradeSettings)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AgentPoolUpgradeSettings_STATUS() to populate field UpgradeSettings")
		}
		pool.UpgradeSettings = &upgradeSetting
	} else {
		pool.UpgradeSettings = nil
	}

	// VirtualMachineNodesStatus
	if source.VirtualMachineNodesStatus != nil {
		virtualMachineNodesStatusList := make([]VirtualMachineNodes_STATUS, len(source.VirtualMachineNodesStatus))
		for virtualMachineNodesStatusIndex, virtualMachineNodesStatusItem := range source.VirtualMachineNodesStatus {
			// Shadow the loop variable to avoid aliasing
			virtualMachineNodesStatusItem := virtualMachineNodesStatusItem
			var virtualMachineNodesStatus VirtualMachineNodes_STATUS
			err := virtualMachineNodesStatus.AssignProperties_From_VirtualMachineNodes_STATUS(&virtualMachineNodesStatusItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VirtualMachineNodes_STATUS() to populate field VirtualMachineNodesStatus")
			}
			virtualMachineNodesStatusList[virtualMachineNodesStatusIndex] = virtualMachineNodesStatus
		}
		pool.VirtualMachineNodesStatus = virtualMachineNodesStatusList
	} else {
		pool.VirtualMachineNodesStatus = nil
	}

	// VirtualMachinesProfile
	if source.VirtualMachinesProfile != nil {
		var virtualMachinesProfile VirtualMachinesProfile_STATUS
		err := virtualMachinesProfile.AssignProperties_From_VirtualMachinesProfile_STATUS(source.VirtualMachinesProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualMachinesProfile_STATUS() to populate field VirtualMachinesProfile")
		}
		pool.VirtualMachinesProfile = &virtualMachinesProfile
	} else {
		pool.VirtualMachinesProfile = nil
	}

	// VmSize
	pool.VmSize = genruntime.ClonePointerToString(source.VmSize)

	// VnetSubnetID
	pool.VnetSubnetID = genruntime.ClonePointerToString(source.VnetSubnetID)

	// WindowsProfile
	if source.WindowsProfile != nil {
		var windowsProfile AgentPoolWindowsProfile_STATUS
		err := windowsProfile.AssignProperties_From_AgentPoolWindowsProfile_STATUS(source.WindowsProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AgentPoolWindowsProfile_STATUS() to populate field WindowsProfile")
		}
		pool.WindowsProfile = &windowsProfile
	} else {
		pool.WindowsProfile = nil
	}

	// WorkloadRuntime
	if source.WorkloadRuntime != nil {
		workloadRuntime := *source.WorkloadRuntime
		workloadRuntimeTemp := genruntime.ToEnum(workloadRuntime, workloadRuntime_STATUS_Values)
		pool.WorkloadRuntime = &workloadRuntimeTemp
	} else {
		pool.WorkloadRuntime = nil
	}

	// No error
	return nil
}