in v2/api/containerservice/v1api20240402preview/managed_clusters_agent_pool_types_gen.go [2618:3230]
func (pool *ManagedClustersAgentPool_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
typedInput, ok := armInput.(arm.ManagedClustersAgentPool_STATUS)
if !ok {
return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.ManagedClustersAgentPool_STATUS, got %T", armInput)
}
// Set property "ArtifactStreamingProfile":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.ArtifactStreamingProfile != nil {
var artifactStreamingProfile1 AgentPoolArtifactStreamingProfile_STATUS
err := artifactStreamingProfile1.PopulateFromARM(owner, *typedInput.Properties.ArtifactStreamingProfile)
if err != nil {
return err
}
artifactStreamingProfile := artifactStreamingProfile1
pool.ArtifactStreamingProfile = &artifactStreamingProfile
}
}
// Set property "AvailabilityZones":
// copying flattened property:
if typedInput.Properties != nil {
for _, item := range typedInput.Properties.AvailabilityZones {
pool.AvailabilityZones = append(pool.AvailabilityZones, item)
}
}
// Set property "CapacityReservationGroupID":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.CapacityReservationGroupID != nil {
capacityReservationGroupID := *typedInput.Properties.CapacityReservationGroupID
pool.CapacityReservationGroupID = &capacityReservationGroupID
}
}
// no assignment for property "Conditions"
// Set property "Count":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.Count != nil {
count := *typedInput.Properties.Count
pool.Count = &count
}
}
// 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
pool.CreationData = &creationData
}
}
// Set property "CurrentOrchestratorVersion":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.CurrentOrchestratorVersion != nil {
currentOrchestratorVersion := *typedInput.Properties.CurrentOrchestratorVersion
pool.CurrentOrchestratorVersion = ¤tOrchestratorVersion
}
}
// Set property "ETag":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.ETag != nil {
eTag := *typedInput.Properties.ETag
pool.ETag = &eTag
}
}
// Set property "EnableAutoScaling":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.EnableAutoScaling != nil {
enableAutoScaling := *typedInput.Properties.EnableAutoScaling
pool.EnableAutoScaling = &enableAutoScaling
}
}
// Set property "EnableCustomCATrust":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.EnableCustomCATrust != nil {
enableCustomCATrust := *typedInput.Properties.EnableCustomCATrust
pool.EnableCustomCATrust = &enableCustomCATrust
}
}
// Set property "EnableEncryptionAtHost":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.EnableEncryptionAtHost != nil {
enableEncryptionAtHost := *typedInput.Properties.EnableEncryptionAtHost
pool.EnableEncryptionAtHost = &enableEncryptionAtHost
}
}
// Set property "EnableFIPS":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.EnableFIPS != nil {
enableFIPS := *typedInput.Properties.EnableFIPS
pool.EnableFIPS = &enableFIPS
}
}
// Set property "EnableNodePublicIP":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.EnableNodePublicIP != nil {
enableNodePublicIP := *typedInput.Properties.EnableNodePublicIP
pool.EnableNodePublicIP = &enableNodePublicIP
}
}
// Set property "EnableUltraSSD":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.EnableUltraSSD != nil {
enableUltraSSD := *typedInput.Properties.EnableUltraSSD
pool.EnableUltraSSD = &enableUltraSSD
}
}
// Set property "GatewayProfile":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.GatewayProfile != nil {
var gatewayProfile1 AgentPoolGatewayProfile_STATUS
err := gatewayProfile1.PopulateFromARM(owner, *typedInput.Properties.GatewayProfile)
if err != nil {
return err
}
gatewayProfile := gatewayProfile1
pool.GatewayProfile = &gatewayProfile
}
}
// Set property "GpuInstanceProfile":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.GpuInstanceProfile != nil {
var temp string
temp = string(*typedInput.Properties.GpuInstanceProfile)
gpuInstanceProfile := GPUInstanceProfile_STATUS(temp)
pool.GpuInstanceProfile = &gpuInstanceProfile
}
}
// Set property "GpuProfile":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.GpuProfile != nil {
var gpuProfile1 AgentPoolGPUProfile_STATUS
err := gpuProfile1.PopulateFromARM(owner, *typedInput.Properties.GpuProfile)
if err != nil {
return err
}
gpuProfile := gpuProfile1
pool.GpuProfile = &gpuProfile
}
}
// Set property "HostGroupID":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.HostGroupID != nil {
hostGroupID := *typedInput.Properties.HostGroupID
pool.HostGroupID = &hostGroupID
}
}
// Set property "Id":
if typedInput.Id != nil {
id := *typedInput.Id
pool.Id = &id
}
// Set property "KubeletConfig":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.KubeletConfig != nil {
var kubeletConfig1 KubeletConfig_STATUS
err := kubeletConfig1.PopulateFromARM(owner, *typedInput.Properties.KubeletConfig)
if err != nil {
return err
}
kubeletConfig := kubeletConfig1
pool.KubeletConfig = &kubeletConfig
}
}
// Set property "KubeletDiskType":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.KubeletDiskType != nil {
var temp string
temp = string(*typedInput.Properties.KubeletDiskType)
kubeletDiskType := KubeletDiskType_STATUS(temp)
pool.KubeletDiskType = &kubeletDiskType
}
}
// Set property "LinuxOSConfig":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.LinuxOSConfig != nil {
var linuxOSConfig1 LinuxOSConfig_STATUS
err := linuxOSConfig1.PopulateFromARM(owner, *typedInput.Properties.LinuxOSConfig)
if err != nil {
return err
}
linuxOSConfig := linuxOSConfig1
pool.LinuxOSConfig = &linuxOSConfig
}
}
// Set property "MaxCount":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.MaxCount != nil {
maxCount := *typedInput.Properties.MaxCount
pool.MaxCount = &maxCount
}
}
// Set property "MaxPods":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.MaxPods != nil {
maxPods := *typedInput.Properties.MaxPods
pool.MaxPods = &maxPods
}
}
// Set property "MessageOfTheDay":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.MessageOfTheDay != nil {
messageOfTheDay := *typedInput.Properties.MessageOfTheDay
pool.MessageOfTheDay = &messageOfTheDay
}
}
// Set property "MinCount":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.MinCount != nil {
minCount := *typedInput.Properties.MinCount
pool.MinCount = &minCount
}
}
// Set property "Mode":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.Mode != nil {
var temp string
temp = string(*typedInput.Properties.Mode)
mode := AgentPoolMode_STATUS(temp)
pool.Mode = &mode
}
}
// Set property "Name":
if typedInput.Name != nil {
name := *typedInput.Name
pool.Name = &name
}
// Set property "NetworkProfile":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.NetworkProfile != nil {
var networkProfile1 AgentPoolNetworkProfile_STATUS
err := networkProfile1.PopulateFromARM(owner, *typedInput.Properties.NetworkProfile)
if err != nil {
return err
}
networkProfile := networkProfile1
pool.NetworkProfile = &networkProfile
}
}
// Set property "NodeImageVersion":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.NodeImageVersion != nil {
nodeImageVersion := *typedInput.Properties.NodeImageVersion
pool.NodeImageVersion = &nodeImageVersion
}
}
// Set property "NodeInitializationTaints":
// copying flattened property:
if typedInput.Properties != nil {
for _, item := range typedInput.Properties.NodeInitializationTaints {
pool.NodeInitializationTaints = append(pool.NodeInitializationTaints, item)
}
}
// Set property "NodeLabels":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.NodeLabels != nil {
pool.NodeLabels = make(map[string]string, len(typedInput.Properties.NodeLabels))
for key, value := range typedInput.Properties.NodeLabels {
pool.NodeLabels[key] = value
}
}
}
// Set property "NodePublicIPPrefixID":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.NodePublicIPPrefixID != nil {
nodePublicIPPrefixID := *typedInput.Properties.NodePublicIPPrefixID
pool.NodePublicIPPrefixID = &nodePublicIPPrefixID
}
}
// Set property "NodeTaints":
// copying flattened property:
if typedInput.Properties != nil {
for _, item := range typedInput.Properties.NodeTaints {
pool.NodeTaints = append(pool.NodeTaints, item)
}
}
// Set property "OrchestratorVersion":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.OrchestratorVersion != nil {
orchestratorVersion := *typedInput.Properties.OrchestratorVersion
pool.OrchestratorVersion = &orchestratorVersion
}
}
// Set property "OsDiskSizeGB":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.OsDiskSizeGB != nil {
osDiskSizeGB := *typedInput.Properties.OsDiskSizeGB
pool.OsDiskSizeGB = &osDiskSizeGB
}
}
// Set property "OsDiskType":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.OsDiskType != nil {
var temp string
temp = string(*typedInput.Properties.OsDiskType)
osDiskType := OSDiskType_STATUS(temp)
pool.OsDiskType = &osDiskType
}
}
// Set property "OsSKU":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.OsSKU != nil {
var temp string
temp = string(*typedInput.Properties.OsSKU)
osSKU := OSSKU_STATUS(temp)
pool.OsSKU = &osSKU
}
}
// Set property "OsType":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.OsType != nil {
var temp string
temp = string(*typedInput.Properties.OsType)
osType := OSType_STATUS(temp)
pool.OsType = &osType
}
}
// Set property "PodIPAllocationMode":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.PodIPAllocationMode != nil {
var temp string
temp = string(*typedInput.Properties.PodIPAllocationMode)
podIPAllocationMode := PodIPAllocationMode_STATUS(temp)
pool.PodIPAllocationMode = &podIPAllocationMode
}
}
// Set property "PodSubnetID":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.PodSubnetID != nil {
podSubnetID := *typedInput.Properties.PodSubnetID
pool.PodSubnetID = &podSubnetID
}
}
// Set property "PowerState":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.PowerState != nil {
var powerState1 PowerState_STATUS
err := powerState1.PopulateFromARM(owner, *typedInput.Properties.PowerState)
if err != nil {
return err
}
powerState := powerState1
pool.PowerState = &powerState
}
}
// Set property "PropertiesType":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.Type != nil {
var temp string
temp = string(*typedInput.Properties.Type)
propertiesType := AgentPoolType_STATUS(temp)
pool.PropertiesType = &propertiesType
}
}
// Set property "ProvisioningState":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.ProvisioningState != nil {
provisioningState := *typedInput.Properties.ProvisioningState
pool.ProvisioningState = &provisioningState
}
}
// Set property "ProximityPlacementGroupID":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.ProximityPlacementGroupID != nil {
proximityPlacementGroupID := *typedInput.Properties.ProximityPlacementGroupID
pool.ProximityPlacementGroupID = &proximityPlacementGroupID
}
}
// Set property "ScaleDownMode":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.ScaleDownMode != nil {
var temp string
temp = string(*typedInput.Properties.ScaleDownMode)
scaleDownMode := ScaleDownMode_STATUS(temp)
pool.ScaleDownMode = &scaleDownMode
}
}
// Set property "ScaleSetEvictionPolicy":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.ScaleSetEvictionPolicy != nil {
var temp string
temp = string(*typedInput.Properties.ScaleSetEvictionPolicy)
scaleSetEvictionPolicy := ScaleSetEvictionPolicy_STATUS(temp)
pool.ScaleSetEvictionPolicy = &scaleSetEvictionPolicy
}
}
// Set property "ScaleSetPriority":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.ScaleSetPriority != nil {
var temp string
temp = string(*typedInput.Properties.ScaleSetPriority)
scaleSetPriority := ScaleSetPriority_STATUS(temp)
pool.ScaleSetPriority = &scaleSetPriority
}
}
// Set property "SecurityProfile":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.SecurityProfile != nil {
var securityProfile1 AgentPoolSecurityProfile_STATUS
err := securityProfile1.PopulateFromARM(owner, *typedInput.Properties.SecurityProfile)
if err != nil {
return err
}
securityProfile := securityProfile1
pool.SecurityProfile = &securityProfile
}
}
// Set property "SpotMaxPrice":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.SpotMaxPrice != nil {
spotMaxPrice := *typedInput.Properties.SpotMaxPrice
pool.SpotMaxPrice = &spotMaxPrice
}
}
// Set property "Tags":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.Tags != nil {
pool.Tags = make(map[string]string, len(typedInput.Properties.Tags))
for key, value := range typedInput.Properties.Tags {
pool.Tags[key] = value
}
}
}
// Set property "Type":
if typedInput.Type != nil {
typeVar := *typedInput.Type
pool.Type = &typeVar
}
// Set property "UpgradeSettings":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.UpgradeSettings != nil {
var upgradeSettings1 AgentPoolUpgradeSettings_STATUS
err := upgradeSettings1.PopulateFromARM(owner, *typedInput.Properties.UpgradeSettings)
if err != nil {
return err
}
upgradeSettings := upgradeSettings1
pool.UpgradeSettings = &upgradeSettings
}
}
// Set property "VirtualMachineNodesStatus":
// copying flattened property:
if typedInput.Properties != nil {
for _, item := range typedInput.Properties.VirtualMachineNodesStatus {
var item1 VirtualMachineNodes_STATUS
err := item1.PopulateFromARM(owner, item)
if err != nil {
return err
}
pool.VirtualMachineNodesStatus = append(pool.VirtualMachineNodesStatus, item1)
}
}
// Set property "VirtualMachinesProfile":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.VirtualMachinesProfile != nil {
var virtualMachinesProfile1 VirtualMachinesProfile_STATUS
err := virtualMachinesProfile1.PopulateFromARM(owner, *typedInput.Properties.VirtualMachinesProfile)
if err != nil {
return err
}
virtualMachinesProfile := virtualMachinesProfile1
pool.VirtualMachinesProfile = &virtualMachinesProfile
}
}
// Set property "VmSize":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.VmSize != nil {
vmSize := *typedInput.Properties.VmSize
pool.VmSize = &vmSize
}
}
// Set property "VnetSubnetID":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.VnetSubnetID != nil {
vnetSubnetID := *typedInput.Properties.VnetSubnetID
pool.VnetSubnetID = &vnetSubnetID
}
}
// Set property "WindowsProfile":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.WindowsProfile != nil {
var windowsProfile1 AgentPoolWindowsProfile_STATUS
err := windowsProfile1.PopulateFromARM(owner, *typedInput.Properties.WindowsProfile)
if err != nil {
return err
}
windowsProfile := windowsProfile1
pool.WindowsProfile = &windowsProfile
}
}
// Set property "WorkloadRuntime":
// copying flattened property:
if typedInput.Properties != nil {
if typedInput.Properties.WorkloadRuntime != nil {
var temp string
temp = string(*typedInput.Properties.WorkloadRuntime)
workloadRuntime := WorkloadRuntime_STATUS(temp)
pool.WorkloadRuntime = &workloadRuntime
}
}
// No error
return nil
}