示例#1
0
        /// <summary>
        /// Create a Matching UI session to view a single result from an AI Matching API response
        /// </summary>
        /// <param name="sovClient">The SovrenClient</param>
        /// <param name="matchResponse">The AI Matching API response containing the result you want to view</param>
        /// <param name="matchId">The id of the specific result in the result set that you want to view</param>
        /// <param name="sourceDocType">The type of document this result was scored against</param>
        /// <param name="htmlDocument">Optionally, the HTML resume/job to display in the details view</param>
        /// <exception cref="SovrenException">Thrown when an API error occurs</exception>
        public static async Task <GenerateUIResponse> ViewDetails(
            this SovrenClientWithUI sovClient,
            MatchResponseValue matchResponse,
            string matchId,
            Models.Matching.IndexType sourceDocType,
            string htmlDocument = null)
        {
            AIMatchDetails details = new AIMatchDetails
            {
                Result = matchResponse.Matches.Single(m => m.Id == matchId),
                AppliedCategoryWeights = matchResponse.AppliedCategoryWeights,
                SourceDocumentType     = sourceDocType,
                HtmlDocument           = htmlDocument
            };

            UIMatchDetailsRequest uiRequest = new UIMatchDetailsRequest(details, sovClient.UISessionOptions?.UIOptions);

            return(await sovClient.InternalClient.UIViewDetails(uiRequest));
        }
示例#2
0
        /// <summary>
        /// Create a Matching UI session to view a single job from a Bimetric Score API response
        /// </summary>
        /// <param name="sovClient">The SovrenClient</param>
        /// <param name="bimetricResponse">The Bimetric Score API response containing the result you want to view</param>
        /// <param name="job">The specific job/id in the result set that you want to view</param>
        /// <param name="sourceDocType">The type of document this result was scored against</param>
        /// <param name="htmlJob">Optionally, the HTML job to display in the details view</param>
        /// <exception cref="SovrenException">Thrown when an API error occurs</exception>
        public static async Task <GenerateUIResponse> ViewDetails(
            this SovrenClientWithUI sovClient,
            BimetricScoreResponseValue bimetricResponse,
            ParsedJobWithId job,
            Models.Matching.IndexType sourceDocType,
            string htmlJob = null)
        {
            BimetricScoreJobDetails details = new BimetricScoreJobDetails
            {
                Result = bimetricResponse.Matches.Single(m => m.Id == job.Id),
                AppliedCategoryWeights = bimetricResponse.AppliedCategoryWeights,
                JobData            = job.JobData,
                SourceDocumentType = sourceDocType,
                HtmlDocument       = htmlJob
            };

            UIBimetricScoreJobDetailsRequest uiRequest = new UIBimetricScoreJobDetailsRequest(details, sovClient.UISessionOptions?.UIOptions);

            return(await sovClient.InternalClient.UIViewDetails(uiRequest));
        }