func()

in v2/api/signalrservice/v1api20240301/signal_r_types_gen.go [1525:1855]


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

	// no assignment for property "Conditions"

	// Set property "Cors":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Cors != nil {
			var cors1 SignalRCorsSettings_STATUS
			err := cors1.PopulateFromARM(owner, *typedInput.Properties.Cors)
			if err != nil {
				return err
			}
			cors := cors1
			signalR.Cors = &cors
		}
	}

	// Set property "DisableAadAuth":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisableAadAuth != nil {
			disableAadAuth := *typedInput.Properties.DisableAadAuth
			signalR.DisableAadAuth = &disableAadAuth
		}
	}

	// Set property "DisableLocalAuth":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisableLocalAuth != nil {
			disableLocalAuth := *typedInput.Properties.DisableLocalAuth
			signalR.DisableLocalAuth = &disableLocalAuth
		}
	}

	// Set property "ExternalIP":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ExternalIP != nil {
			externalIP := *typedInput.Properties.ExternalIP
			signalR.ExternalIP = &externalIP
		}
	}

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

	// Set property "HostName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HostName != nil {
			hostName := *typedInput.Properties.HostName
			signalR.HostName = &hostName
		}
	}

	// Set property "HostNamePrefix":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HostNamePrefix != nil {
			hostNamePrefix := *typedInput.Properties.HostNamePrefix
			signalR.HostNamePrefix = &hostNamePrefix
		}
	}

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

	// Set property "Identity":
	if typedInput.Identity != nil {
		var identity1 ManagedIdentity_STATUS
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		signalR.Identity = &identity
	}

	// Set property "Kind":
	if typedInput.Kind != nil {
		var temp string
		temp = string(*typedInput.Kind)
		kind := SignalrServiceKind_STATUS(temp)
		signalR.Kind = &kind
	}

	// Set property "LiveTraceConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LiveTraceConfiguration != nil {
			var liveTraceConfiguration1 LiveTraceConfiguration_STATUS
			err := liveTraceConfiguration1.PopulateFromARM(owner, *typedInput.Properties.LiveTraceConfiguration)
			if err != nil {
				return err
			}
			liveTraceConfiguration := liveTraceConfiguration1
			signalR.LiveTraceConfiguration = &liveTraceConfiguration
		}
	}

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

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

	// Set property "NetworkACLs":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkACLs != nil {
			var networkACLs1 SignalRNetworkACLs_STATUS
			err := networkACLs1.PopulateFromARM(owner, *typedInput.Properties.NetworkACLs)
			if err != nil {
				return err
			}
			networkACLs := networkACLs1
			signalR.NetworkACLs = &networkACLs
		}
	}

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

	// 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)
			signalR.ProvisioningState = &provisioningState
		}
	}

	// Set property "PublicNetworkAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccess != nil {
			publicNetworkAccess := *typedInput.Properties.PublicNetworkAccess
			signalR.PublicNetworkAccess = &publicNetworkAccess
		}
	}

	// Set property "PublicPort":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicPort != nil {
			publicPort := *typedInput.Properties.PublicPort
			signalR.PublicPort = &publicPort
		}
	}

	// Set property "RegionEndpointEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RegionEndpointEnabled != nil {
			regionEndpointEnabled := *typedInput.Properties.RegionEndpointEnabled
			signalR.RegionEndpointEnabled = &regionEndpointEnabled
		}
	}

	// Set property "ResourceLogConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ResourceLogConfiguration != nil {
			var resourceLogConfiguration1 ResourceLogConfiguration_STATUS
			err := resourceLogConfiguration1.PopulateFromARM(owner, *typedInput.Properties.ResourceLogConfiguration)
			if err != nil {
				return err
			}
			resourceLogConfiguration := resourceLogConfiguration1
			signalR.ResourceLogConfiguration = &resourceLogConfiguration
		}
	}

	// Set property "ResourceStopped":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ResourceStopped != nil {
			resourceStopped := *typedInput.Properties.ResourceStopped
			signalR.ResourceStopped = &resourceStopped
		}
	}

	// Set property "ServerPort":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ServerPort != nil {
			serverPort := *typedInput.Properties.ServerPort
			signalR.ServerPort = &serverPort
		}
	}

	// Set property "Serverless":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Serverless != nil {
			var serverless1 ServerlessSettings_STATUS
			err := serverless1.PopulateFromARM(owner, *typedInput.Properties.Serverless)
			if err != nil {
				return err
			}
			serverless := serverless1
			signalR.Serverless = &serverless
		}
	}

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

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

	// Set property "SystemData":
	if typedInput.SystemData != nil {
		var systemData1 SystemData_STATUS
		err := systemData1.PopulateFromARM(owner, *typedInput.SystemData)
		if err != nil {
			return err
		}
		systemData := systemData1
		signalR.SystemData = &systemData
	}

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

	// Set property "Tls":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Tls != nil {
			var tls1 SignalRTlsSettings_STATUS
			err := tls1.PopulateFromARM(owner, *typedInput.Properties.Tls)
			if err != nil {
				return err
			}
			tls := tls1
			signalR.Tls = &tls
		}
	}

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

	// Set property "Upstream":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Upstream != nil {
			var upstream1 ServerlessUpstreamSettings_STATUS
			err := upstream1.PopulateFromARM(owner, *typedInput.Properties.Upstream)
			if err != nil {
				return err
			}
			upstream := upstream1
			signalR.Upstream = &upstream
		}
	}

	// Set property "Version":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Version != nil {
			version := *typedInput.Properties.Version
			signalR.Version = &version
		}
	}

	// No error
	return nil
}