/// <summary> /// Creates a merge analysis for the current person and the potential duplicate person specified by the search result entry from <see cref="P:Results.Entries"/>. /// </summary> /// <param name="entry">The search result entry to perform the merge analysis upon.</param> /// <param name="options">The options to apply before executing the REST API call.</param> /// <returns> /// A <see cref="PersonMergeState"/> instance containing the REST API response. /// </returns> public PersonMergeState ReadMergeAnalysis(Gx.Atom.Entry entry, params IStateTransitionOption[] options) { Link link = entry.GetLink(Rel.MERGE); if (link == null || link.Href == null) { return(null); } IRestRequest request = RequestUtil.ApplyFamilySearchConneg(CreateAuthenticatedRequest()).Build(link.Href, Method.GET); return(((FamilySearchStateFactory)this.stateFactory).NewPersonMergeState(request, Invoke(request, options), this.Client, this.CurrentAccessToken)); }
/// <summary> /// Declares the specified search result entry (from <see cref="P:Results.Entries"/>) as not a match for the current person. /// </summary> /// <param name="entry">The search result entry from <see cref="P:Results.Entries"/>.</param> /// <param name="options">The options to apply before executing the REST API call.</param> /// <returns> /// A <see cref="PersonNonMatchesState"/> instance containing the REST API response. /// </returns> public PersonNonMatchesState AddNonMatch(Gx.Atom.Entry entry, params IStateTransitionOption[] options) { Link link = GetLink(Rel.NOT_A_MATCHES); if (link == null || link.Href == null) { return(null); } Gx.Gedcomx entity = new Gx.Gedcomx(); entity.AddPerson(new Person() { Id = entry.Id }); IRestRequest request = RequestUtil.ApplyFamilySearchConneg(CreateAuthenticatedRequest()).SetEntity(entity).Build(link.Href, Method.POST); return(((FamilySearchStateFactory)this.stateFactory).NewPersonNonMatchesState(request, Invoke(request, options), this.Client, this.CurrentAccessToken)); }
/// <summary> /// Declares the match status for the current person the specified search result entry from <see cref="P:Results.Entries"/>. /// </summary> /// <param name="entry">The search result entry (from <see cref="P:Results.Entries"/>) to have the match status updated.</param> /// <param name="status">The new status to apply to the specified search result entry from <see cref="P:Results.Entries"/>.</param> /// <param name="options">The options to apply before executing the REST API call.</param> /// <returns> /// A <see cref="PersonMatchResultsState"/> instance containing the REST API response. /// </returns> public PersonMatchResultsState UpdateMatchStatus(Gx.Atom.Entry entry, MatchStatus status, params IStateTransitionOption[] options) { String updateStatusUri = GetSelfUri().SetQueryParam(FamilySearchOptions.STATUS, status.ToString().ToLower()).ToString(); IRestRequest request = CreateAuthenticatedRequest().ContentType(MediaTypes.GEDCOMX_JSON_MEDIA_TYPE) .SetEntity(new Gx.Gedcomx() { Persons = new List <Person>() { new Person() { Identifiers = new List <Identifier>() { new Identifier() { KnownType = IdentifierType.Persistent, Value = entry.Id } } } } }) .Build(updateStatusUri, Method.POST); return(((FamilySearchStateFactory)this.stateFactory).NewPersonMatchResultsState(request, Invoke(request, options), this.Client, this.CurrentAccessToken)); }