func()

in v2/api/machinelearningservices/v1api20240401/workspace_types_gen.go [1797:2212]


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

	// Set property "AllowPublicAccessWhenBehindVnet":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AllowPublicAccessWhenBehindVnet != nil {
			allowPublicAccessWhenBehindVnet := *typedInput.Properties.AllowPublicAccessWhenBehindVnet
			workspace.AllowPublicAccessWhenBehindVnet = &allowPublicAccessWhenBehindVnet
		}
	}

	// Set property "ApplicationInsights":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApplicationInsights != nil {
			applicationInsights := *typedInput.Properties.ApplicationInsights
			workspace.ApplicationInsights = &applicationInsights
		}
	}

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

	// no assignment for property "Conditions"

	// Set property "ContainerRegistry":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ContainerRegistry != nil {
			containerRegistry := *typedInput.Properties.ContainerRegistry
			workspace.ContainerRegistry = &containerRegistry
		}
	}

	// Set property "Description":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Description != nil {
			description := *typedInput.Properties.Description
			workspace.Description = &description
		}
	}

	// Set property "DiscoveryUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiscoveryUrl != nil {
			discoveryUrl := *typedInput.Properties.DiscoveryUrl
			workspace.DiscoveryUrl = &discoveryUrl
		}
	}

	// Set property "EnableDataIsolation":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableDataIsolation != nil {
			enableDataIsolation := *typedInput.Properties.EnableDataIsolation
			workspace.EnableDataIsolation = &enableDataIsolation
		}
	}

	// Set property "Encryption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Encryption != nil {
			var encryption1 EncryptionProperty_STATUS
			err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption)
			if err != nil {
				return err
			}
			encryption := encryption1
			workspace.Encryption = &encryption
		}
	}

	// Set property "FeatureStoreSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.FeatureStoreSettings != nil {
			var featureStoreSettings1 FeatureStoreSettings_STATUS
			err := featureStoreSettings1.PopulateFromARM(owner, *typedInput.Properties.FeatureStoreSettings)
			if err != nil {
				return err
			}
			featureStoreSettings := featureStoreSettings1
			workspace.FeatureStoreSettings = &featureStoreSettings
		}
	}

	// Set property "FriendlyName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.FriendlyName != nil {
			friendlyName := *typedInput.Properties.FriendlyName
			workspace.FriendlyName = &friendlyName
		}
	}

	// Set property "HbiWorkspace":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HbiWorkspace != nil {
			hbiWorkspace := *typedInput.Properties.HbiWorkspace
			workspace.HbiWorkspace = &hbiWorkspace
		}
	}

	// Set property "HubResourceId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HubResourceId != nil {
			hubResourceId := *typedInput.Properties.HubResourceId
			workspace.HubResourceId = &hubResourceId
		}
	}

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

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

	// Set property "ImageBuildCompute":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ImageBuildCompute != nil {
			imageBuildCompute := *typedInput.Properties.ImageBuildCompute
			workspace.ImageBuildCompute = &imageBuildCompute
		}
	}

	// Set property "KeyVault":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.KeyVault != nil {
			keyVault := *typedInput.Properties.KeyVault
			workspace.KeyVault = &keyVault
		}
	}

	// Set property "Kind":
	if typedInput.Kind != nil {
		kind := *typedInput.Kind
		workspace.Kind = &kind
	}

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

	// Set property "ManagedNetwork":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ManagedNetwork != nil {
			var managedNetwork1 ManagedNetworkSettings_STATUS
			err := managedNetwork1.PopulateFromARM(owner, *typedInput.Properties.ManagedNetwork)
			if err != nil {
				return err
			}
			managedNetwork := managedNetwork1
			workspace.ManagedNetwork = &managedNetwork
		}
	}

	// Set property "MlFlowTrackingUri":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MlFlowTrackingUri != nil {
			mlFlowTrackingUri := *typedInput.Properties.MlFlowTrackingUri
			workspace.MlFlowTrackingUri = &mlFlowTrackingUri
		}
	}

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

	// Set property "NotebookInfo":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NotebookInfo != nil {
			var notebookInfo1 NotebookResourceInfo_STATUS
			err := notebookInfo1.PopulateFromARM(owner, *typedInput.Properties.NotebookInfo)
			if err != nil {
				return err
			}
			notebookInfo := notebookInfo1
			workspace.NotebookInfo = &notebookInfo
		}
	}

	// Set property "PrimaryUserAssignedIdentity":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrimaryUserAssignedIdentity != nil {
			primaryUserAssignedIdentity := *typedInput.Properties.PrimaryUserAssignedIdentity
			workspace.PrimaryUserAssignedIdentity = &primaryUserAssignedIdentity
		}
	}

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

	// Set property "PrivateLinkCount":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrivateLinkCount != nil {
			privateLinkCount := *typedInput.Properties.PrivateLinkCount
			workspace.PrivateLinkCount = &privateLinkCount
		}
	}

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

	// Set property "PublicNetworkAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccess != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccess)
			publicNetworkAccess := WorkspaceProperties_PublicNetworkAccess_STATUS(temp)
			workspace.PublicNetworkAccess = &publicNetworkAccess
		}
	}

	// Set property "ServerlessComputeSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ServerlessComputeSettings != nil {
			var serverlessComputeSettings1 ServerlessComputeSettings_STATUS
			err := serverlessComputeSettings1.PopulateFromARM(owner, *typedInput.Properties.ServerlessComputeSettings)
			if err != nil {
				return err
			}
			serverlessComputeSettings := serverlessComputeSettings1
			workspace.ServerlessComputeSettings = &serverlessComputeSettings
		}
	}

	// Set property "ServiceManagedResourcesSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ServiceManagedResourcesSettings != nil {
			var serviceManagedResourcesSettings1 ServiceManagedResourcesSettings_STATUS
			err := serviceManagedResourcesSettings1.PopulateFromARM(owner, *typedInput.Properties.ServiceManagedResourcesSettings)
			if err != nil {
				return err
			}
			serviceManagedResourcesSettings := serviceManagedResourcesSettings1
			workspace.ServiceManagedResourcesSettings = &serviceManagedResourcesSettings
		}
	}

	// Set property "ServiceProvisionedResourceGroup":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ServiceProvisionedResourceGroup != nil {
			serviceProvisionedResourceGroup := *typedInput.Properties.ServiceProvisionedResourceGroup
			workspace.ServiceProvisionedResourceGroup = &serviceProvisionedResourceGroup
		}
	}

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

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

	// Set property "StorageAccount":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.StorageAccount != nil {
			storageAccount := *typedInput.Properties.StorageAccount
			workspace.StorageAccount = &storageAccount
		}
	}

	// Set property "StorageHnsEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.StorageHnsEnabled != nil {
			storageHnsEnabled := *typedInput.Properties.StorageHnsEnabled
			workspace.StorageHnsEnabled = &storageHnsEnabled
		}
	}

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

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

	// Set property "TenantId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TenantId != nil {
			tenantId := *typedInput.Properties.TenantId
			workspace.TenantId = &tenantId
		}
	}

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

	// Set property "V1LegacyMode":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.V1LegacyMode != nil {
			v1LegacyMode := *typedInput.Properties.V1LegacyMode
			workspace.V1LegacyMode = &v1LegacyMode
		}
	}

	// Set property "WorkspaceHubConfig":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.WorkspaceHubConfig != nil {
			var workspaceHubConfig1 WorkspaceHubConfig_STATUS
			err := workspaceHubConfig1.PopulateFromARM(owner, *typedInput.Properties.WorkspaceHubConfig)
			if err != nil {
				return err
			}
			workspaceHubConfig := workspaceHubConfig1
			workspace.WorkspaceHubConfig = &workspaceHubConfig
		}
	}

	// Set property "WorkspaceId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.WorkspaceId != nil {
			workspaceId := *typedInput.Properties.WorkspaceId
			workspace.WorkspaceId = &workspaceId
		}
	}

	// No error
	return nil
}