func()

in v2/api/storage/v1api20210401/storage_account_types_gen.go [1605:2034]


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

	// Set property "AccessTier":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AccessTier != nil {
			var temp string
			temp = string(*typedInput.Properties.AccessTier)
			accessTier := StorageAccountProperties_AccessTier_STATUS(temp)
			account.AccessTier = &accessTier
		}
	}

	// Set property "AllowBlobPublicAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AllowBlobPublicAccess != nil {
			allowBlobPublicAccess := *typedInput.Properties.AllowBlobPublicAccess
			account.AllowBlobPublicAccess = &allowBlobPublicAccess
		}
	}

	// Set property "AllowCrossTenantReplication":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AllowCrossTenantReplication != nil {
			allowCrossTenantReplication := *typedInput.Properties.AllowCrossTenantReplication
			account.AllowCrossTenantReplication = &allowCrossTenantReplication
		}
	}

	// Set property "AllowSharedKeyAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AllowSharedKeyAccess != nil {
			allowSharedKeyAccess := *typedInput.Properties.AllowSharedKeyAccess
			account.AllowSharedKeyAccess = &allowSharedKeyAccess
		}
	}

	// Set property "AzureFilesIdentityBasedAuthentication":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AzureFilesIdentityBasedAuthentication != nil {
			var azureFilesIdentityBasedAuthentication1 AzureFilesIdentityBasedAuthentication_STATUS
			err := azureFilesIdentityBasedAuthentication1.PopulateFromARM(owner, *typedInput.Properties.AzureFilesIdentityBasedAuthentication)
			if err != nil {
				return err
			}
			azureFilesIdentityBasedAuthentication := azureFilesIdentityBasedAuthentication1
			account.AzureFilesIdentityBasedAuthentication = &azureFilesIdentityBasedAuthentication
		}
	}

	// Set property "BlobRestoreStatus":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.BlobRestoreStatus != nil {
			var blobRestoreStatus1 BlobRestoreStatus_STATUS
			err := blobRestoreStatus1.PopulateFromARM(owner, *typedInput.Properties.BlobRestoreStatus)
			if err != nil {
				return err
			}
			blobRestoreStatus := blobRestoreStatus1
			account.BlobRestoreStatus = &blobRestoreStatus
		}
	}

	// no assignment for property "Conditions"

	// Set property "CreationTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreationTime != nil {
			creationTime := *typedInput.Properties.CreationTime
			account.CreationTime = &creationTime
		}
	}

	// Set property "CustomDomain":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CustomDomain != nil {
			var customDomain1 CustomDomain_STATUS
			err := customDomain1.PopulateFromARM(owner, *typedInput.Properties.CustomDomain)
			if err != nil {
				return err
			}
			customDomain := customDomain1
			account.CustomDomain = &customDomain
		}
	}

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

	// Set property "ExtendedLocation":
	if typedInput.ExtendedLocation != nil {
		var extendedLocation1 ExtendedLocation_STATUS
		err := extendedLocation1.PopulateFromARM(owner, *typedInput.ExtendedLocation)
		if err != nil {
			return err
		}
		extendedLocation := extendedLocation1
		account.ExtendedLocation = &extendedLocation
	}

	// Set property "FailoverInProgress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.FailoverInProgress != nil {
			failoverInProgress := *typedInput.Properties.FailoverInProgress
			account.FailoverInProgress = &failoverInProgress
		}
	}

	// Set property "GeoReplicationStats":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.GeoReplicationStats != nil {
			var geoReplicationStats1 GeoReplicationStats_STATUS
			err := geoReplicationStats1.PopulateFromARM(owner, *typedInput.Properties.GeoReplicationStats)
			if err != nil {
				return err
			}
			geoReplicationStats := geoReplicationStats1
			account.GeoReplicationStats = &geoReplicationStats
		}
	}

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

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

	// Set property "IsHnsEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsHnsEnabled != nil {
			isHnsEnabled := *typedInput.Properties.IsHnsEnabled
			account.IsHnsEnabled = &isHnsEnabled
		}
	}

	// Set property "IsNfsV3Enabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsNfsV3Enabled != nil {
			isNfsV3Enabled := *typedInput.Properties.IsNfsV3Enabled
			account.IsNfsV3Enabled = &isNfsV3Enabled
		}
	}

	// Set property "KeyCreationTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.KeyCreationTime != nil {
			var keyCreationTime1 KeyCreationTime_STATUS
			err := keyCreationTime1.PopulateFromARM(owner, *typedInput.Properties.KeyCreationTime)
			if err != nil {
				return err
			}
			keyCreationTime := keyCreationTime1
			account.KeyCreationTime = &keyCreationTime
		}
	}

	// Set property "KeyPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.KeyPolicy != nil {
			var keyPolicy1 KeyPolicy_STATUS
			err := keyPolicy1.PopulateFromARM(owner, *typedInput.Properties.KeyPolicy)
			if err != nil {
				return err
			}
			keyPolicy := keyPolicy1
			account.KeyPolicy = &keyPolicy
		}
	}

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

	// Set property "LargeFileSharesState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LargeFileSharesState != nil {
			var temp string
			temp = string(*typedInput.Properties.LargeFileSharesState)
			largeFileSharesState := StorageAccountProperties_LargeFileSharesState_STATUS(temp)
			account.LargeFileSharesState = &largeFileSharesState
		}
	}

	// Set property "LastGeoFailoverTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LastGeoFailoverTime != nil {
			lastGeoFailoverTime := *typedInput.Properties.LastGeoFailoverTime
			account.LastGeoFailoverTime = &lastGeoFailoverTime
		}
	}

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

	// Set property "MinimumTlsVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MinimumTlsVersion != nil {
			var temp string
			temp = string(*typedInput.Properties.MinimumTlsVersion)
			minimumTlsVersion := StorageAccountProperties_MinimumTlsVersion_STATUS(temp)
			account.MinimumTlsVersion = &minimumTlsVersion
		}
	}

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

	// Set property "NetworkAcls":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkAcls != nil {
			var networkAcls1 NetworkRuleSet_STATUS
			err := networkAcls1.PopulateFromARM(owner, *typedInput.Properties.NetworkAcls)
			if err != nil {
				return err
			}
			networkAcls := networkAcls1
			account.NetworkAcls = &networkAcls
		}
	}

	// Set property "PrimaryEndpoints":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrimaryEndpoints != nil {
			var primaryEndpoints1 Endpoints_STATUS
			err := primaryEndpoints1.PopulateFromARM(owner, *typedInput.Properties.PrimaryEndpoints)
			if err != nil {
				return err
			}
			primaryEndpoints := primaryEndpoints1
			account.PrimaryEndpoints = &primaryEndpoints
		}
	}

	// Set property "PrimaryLocation":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrimaryLocation != nil {
			primaryLocation := *typedInput.Properties.PrimaryLocation
			account.PrimaryLocation = &primaryLocation
		}
	}

	// 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
			}
			account.PrivateEndpointConnections = append(account.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 := StorageAccountProperties_ProvisioningState_STATUS(temp)
			account.ProvisioningState = &provisioningState
		}
	}

	// Set property "RoutingPreference":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RoutingPreference != nil {
			var routingPreference1 RoutingPreference_STATUS
			err := routingPreference1.PopulateFromARM(owner, *typedInput.Properties.RoutingPreference)
			if err != nil {
				return err
			}
			routingPreference := routingPreference1
			account.RoutingPreference = &routingPreference
		}
	}

	// Set property "SasPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SasPolicy != nil {
			var sasPolicy1 SasPolicy_STATUS
			err := sasPolicy1.PopulateFromARM(owner, *typedInput.Properties.SasPolicy)
			if err != nil {
				return err
			}
			sasPolicy := sasPolicy1
			account.SasPolicy = &sasPolicy
		}
	}

	// Set property "SecondaryEndpoints":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SecondaryEndpoints != nil {
			var secondaryEndpoints1 Endpoints_STATUS
			err := secondaryEndpoints1.PopulateFromARM(owner, *typedInput.Properties.SecondaryEndpoints)
			if err != nil {
				return err
			}
			secondaryEndpoints := secondaryEndpoints1
			account.SecondaryEndpoints = &secondaryEndpoints
		}
	}

	// Set property "SecondaryLocation":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SecondaryLocation != nil {
			secondaryLocation := *typedInput.Properties.SecondaryLocation
			account.SecondaryLocation = &secondaryLocation
		}
	}

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

	// Set property "StatusOfPrimary":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.StatusOfPrimary != nil {
			var temp string
			temp = string(*typedInput.Properties.StatusOfPrimary)
			statusOfPrimary := StorageAccountProperties_StatusOfPrimary_STATUS(temp)
			account.StatusOfPrimary = &statusOfPrimary
		}
	}

	// Set property "StatusOfSecondary":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.StatusOfSecondary != nil {
			var temp string
			temp = string(*typedInput.Properties.StatusOfSecondary)
			statusOfSecondary := StorageAccountProperties_StatusOfSecondary_STATUS(temp)
			account.StatusOfSecondary = &statusOfSecondary
		}
	}

	// Set property "SupportsHttpsTrafficOnly":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SupportsHttpsTrafficOnly != nil {
			supportsHttpsTrafficOnly := *typedInput.Properties.SupportsHttpsTrafficOnly
			account.SupportsHttpsTrafficOnly = &supportsHttpsTrafficOnly
		}
	}

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

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

	// No error
	return nil
}