// This is not autogenerated.
package core

import "github.com/gofrs/uuid"

// ResolvedAliasFromNonResolved constructs a ResolvedAlias from a NonResolvedAlias
// by supplying the resolved parent UUID and the fully resolved field path.
func ResolvedAliasFromNonResolved(nonResolved NonResolvedAlias, resolvedParentId uuid.UUID, resolvedRefFieldPath []string) ResolvedAlias {
	immediatePath := append([]string(nil), nonResolved.ImmediateRefFieldPath...)
	resolvedPath := append([]string(nil), resolvedRefFieldPath...)

	return ResolvedAlias{
		AliasComponentId:      nonResolved.AliasComponentId,
		ImmediateParentId:     nonResolved.ImmediateParentId,
		ImmediateRefFieldPath: immediatePath,
		RelationshipId:        nonResolved.RelationshipId,
		ResolvedParentId:      resolvedParentId,
		ResolvedRefFieldPath:  resolvedPath,
	}
}
