code: func ConvertLinkToModel(appLink app.WorkItemLinkSingle) (*link.WorkItemLink, error) {
  	modelLink := link.WorkItemLink{}
  	attrs := appLink.Data.Attributes
  	rel := appLink.Data.Relationships
  	if appLink.Data.ID != nil {
  		modelLink.ID = *appLink.Data.ID
  	}
  
  	if attrs != nil && attrs.Version != nil {
  		modelLink.Version = *attrs.Version
  	}
  
  	if rel != nil && rel.LinkType != nil && rel.LinkType.Data != nil {
  		modelLink.LinkTypeID = rel.LinkType.Data.ID
  	}
  
  	if rel != nil && rel.Source != nil && rel.Source.Data != nil {
  		d := rel.Source.Data
  		// The the work item id MUST NOT be empty
  		if d.ID == uuid.Nil {
  			return nil, errors.NewBadParameterError("data.relationships.source.data.id", d.ID)
  		}
  		modelLink.SourceID = d.ID
  	}
  
  	if rel != nil && rel.Target != nil && rel.Target.Data != nil {
  		d := rel.Target.Data
  		// If the the target type is not nil, it MUST be "workitems"
  		// The the work item id MUST NOT be empty
  		if d.ID == uuid.Nil {
  			return nil, errors.NewBadParameterError("data.relationships.target.data.id", d.ID)
  		}
  		modelLink.TargetID = d.ID
  	}
  
  	return &modelLink, nil
  }
docs: // ConvertLinkToModel converts the incoming app representation of a work item link to the model layout.
  // Values are only overwrriten if they are set in "in", otherwise the values in "out" remain.
  // NOTE: Only the LinkTypeID, SourceID, and TargetID fields will be set.
  //       You need to preload the elements after calling this function.