func()

in sdk/resourcemanager/containerservice/armcontainerservice/models_serde.go [4513:4674]


func (m *ManagedClusterProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "aadProfile":
			err = unpopulate(val, "AADProfile", &m.AADProfile)
			delete(rawMsg, key)
		case "apiServerAccessProfile":
			err = unpopulate(val, "APIServerAccessProfile", &m.APIServerAccessProfile)
			delete(rawMsg, key)
		case "addonProfiles":
			err = unpopulate(val, "AddonProfiles", &m.AddonProfiles)
			delete(rawMsg, key)
		case "agentPoolProfiles":
			err = unpopulate(val, "AgentPoolProfiles", &m.AgentPoolProfiles)
			delete(rawMsg, key)
		case "aiToolchainOperatorProfile":
			err = unpopulate(val, "AiToolchainOperatorProfile", &m.AiToolchainOperatorProfile)
			delete(rawMsg, key)
		case "autoScalerProfile":
			err = unpopulate(val, "AutoScalerProfile", &m.AutoScalerProfile)
			delete(rawMsg, key)
		case "autoUpgradeProfile":
			err = unpopulate(val, "AutoUpgradeProfile", &m.AutoUpgradeProfile)
			delete(rawMsg, key)
		case "azureMonitorProfile":
			err = unpopulate(val, "AzureMonitorProfile", &m.AzureMonitorProfile)
			delete(rawMsg, key)
		case "azurePortalFQDN":
			err = unpopulate(val, "AzurePortalFQDN", &m.AzurePortalFQDN)
			delete(rawMsg, key)
		case "bootstrapProfile":
			err = unpopulate(val, "BootstrapProfile", &m.BootstrapProfile)
			delete(rawMsg, key)
		case "creationData":
			err = unpopulate(val, "CreationData", &m.CreationData)
			delete(rawMsg, key)
		case "currentKubernetesVersion":
			err = unpopulate(val, "CurrentKubernetesVersion", &m.CurrentKubernetesVersion)
			delete(rawMsg, key)
		case "dnsPrefix":
			err = unpopulate(val, "DNSPrefix", &m.DNSPrefix)
			delete(rawMsg, key)
		case "disableLocalAccounts":
			err = unpopulate(val, "DisableLocalAccounts", &m.DisableLocalAccounts)
			delete(rawMsg, key)
		case "diskEncryptionSetID":
			err = unpopulate(val, "DiskEncryptionSetID", &m.DiskEncryptionSetID)
			delete(rawMsg, key)
		case "enableNamespaceResources":
			err = unpopulate(val, "EnableNamespaceResources", &m.EnableNamespaceResources)
			delete(rawMsg, key)
		case "enablePodSecurityPolicy":
			err = unpopulate(val, "EnablePodSecurityPolicy", &m.EnablePodSecurityPolicy)
			delete(rawMsg, key)
		case "enableRBAC":
			err = unpopulate(val, "EnableRBAC", &m.EnableRBAC)
			delete(rawMsg, key)
		case "fqdn":
			err = unpopulate(val, "Fqdn", &m.Fqdn)
			delete(rawMsg, key)
		case "fqdnSubdomain":
			err = unpopulate(val, "FqdnSubdomain", &m.FqdnSubdomain)
			delete(rawMsg, key)
		case "httpProxyConfig":
			err = unpopulate(val, "HTTPProxyConfig", &m.HTTPProxyConfig)
			delete(rawMsg, key)
		case "identityProfile":
			err = unpopulate(val, "IdentityProfile", &m.IdentityProfile)
			delete(rawMsg, key)
		case "ingressProfile":
			err = unpopulate(val, "IngressProfile", &m.IngressProfile)
			delete(rawMsg, key)
		case "kubernetesVersion":
			err = unpopulate(val, "KubernetesVersion", &m.KubernetesVersion)
			delete(rawMsg, key)
		case "linuxProfile":
			err = unpopulate(val, "LinuxProfile", &m.LinuxProfile)
			delete(rawMsg, key)
		case "maxAgentPools":
			err = unpopulate(val, "MaxAgentPools", &m.MaxAgentPools)
			delete(rawMsg, key)
		case "metricsProfile":
			err = unpopulate(val, "MetricsProfile", &m.MetricsProfile)
			delete(rawMsg, key)
		case "networkProfile":
			err = unpopulate(val, "NetworkProfile", &m.NetworkProfile)
			delete(rawMsg, key)
		case "nodeProvisioningProfile":
			err = unpopulate(val, "NodeProvisioningProfile", &m.NodeProvisioningProfile)
			delete(rawMsg, key)
		case "nodeResourceGroup":
			err = unpopulate(val, "NodeResourceGroup", &m.NodeResourceGroup)
			delete(rawMsg, key)
		case "nodeResourceGroupProfile":
			err = unpopulate(val, "NodeResourceGroupProfile", &m.NodeResourceGroupProfile)
			delete(rawMsg, key)
		case "oidcIssuerProfile":
			err = unpopulate(val, "OidcIssuerProfile", &m.OidcIssuerProfile)
			delete(rawMsg, key)
		case "podIdentityProfile":
			err = unpopulate(val, "PodIdentityProfile", &m.PodIdentityProfile)
			delete(rawMsg, key)
		case "powerState":
			err = unpopulate(val, "PowerState", &m.PowerState)
			delete(rawMsg, key)
		case "privateFQDN":
			err = unpopulate(val, "PrivateFQDN", &m.PrivateFQDN)
			delete(rawMsg, key)
		case "privateLinkResources":
			err = unpopulate(val, "PrivateLinkResources", &m.PrivateLinkResources)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &m.ProvisioningState)
			delete(rawMsg, key)
		case "publicNetworkAccess":
			err = unpopulate(val, "PublicNetworkAccess", &m.PublicNetworkAccess)
			delete(rawMsg, key)
		case "resourceUID":
			err = unpopulate(val, "ResourceUID", &m.ResourceUID)
			delete(rawMsg, key)
		case "safeguardsProfile":
			err = unpopulate(val, "SafeguardsProfile", &m.SafeguardsProfile)
			delete(rawMsg, key)
		case "securityProfile":
			err = unpopulate(val, "SecurityProfile", &m.SecurityProfile)
			delete(rawMsg, key)
		case "serviceMeshProfile":
			err = unpopulate(val, "ServiceMeshProfile", &m.ServiceMeshProfile)
			delete(rawMsg, key)
		case "servicePrincipalProfile":
			err = unpopulate(val, "ServicePrincipalProfile", &m.ServicePrincipalProfile)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &m.Status)
			delete(rawMsg, key)
		case "storageProfile":
			err = unpopulate(val, "StorageProfile", &m.StorageProfile)
			delete(rawMsg, key)
		case "supportPlan":
			err = unpopulate(val, "SupportPlan", &m.SupportPlan)
			delete(rawMsg, key)
		case "upgradeSettings":
			err = unpopulate(val, "UpgradeSettings", &m.UpgradeSettings)
			delete(rawMsg, key)
		case "windowsProfile":
			err = unpopulate(val, "WindowsProfile", &m.WindowsProfile)
			delete(rawMsg, key)
		case "workloadAutoScalerProfile":
			err = unpopulate(val, "WorkloadAutoScalerProfile", &m.WorkloadAutoScalerProfile)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}