-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathIMatchV2Service.cs
More file actions
129 lines (113 loc) · 7.15 KB
/
IMatchV2Service.cs
File metadata and controls
129 lines (113 loc) · 7.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// Copyright © 2023 Textkernel BV. All rights reserved.
// This file is provided for use by, or on behalf of, Textkernel licensees
// within the terms of their license of Textkernel products or Textkernel customers
// within the Terms of Service pertaining to the Textkernel SaaS products.
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Textkernel.Tx.Models.API;
using Textkernel.Tx.Models.API.MatchV2.Request;
using Textkernel.Tx.Models.API.MatchV2.Response;
using Textkernel.Tx.Models.Job;
using Textkernel.Tx.Models.Resume;
namespace Textkernel.Tx.Services
{
/// <summary>
/// Use <see cref="TxClient.SearchMatchV2"/>
/// </summary>
public interface IMatchV2Service
{
#region Candidates
/// <summary>
/// Upload a candidates CV to the search and match V2 environment.
/// </summary>
/// <param name="documentId">The id to use for the document</param>
/// <param name="resume">Parsed output from the Textkernel CV/Resume Parser</param>
/// <param name="roles">The roles associated with the request. Defaults to ["All"] if none are provided.</param>
/// <param name="anonymize">A boolean flag to strip PII data out of the resume before indexing.</param>
/// <param name="customFields">A collection of custom fields represented as key-value pairs.</param>
/// <exception cref="TxException">Thrown when an API error occurs</exception>
Task<ApiResponse<object>> AddCandidate(string documentId, ParsedResume resume, IEnumerable<string> roles = null, bool anonymize = false, Dictionary<string, string> customFields = null);
/// <summary>
/// Delete candidate documents from environment
/// </summary>
/// <param name="documentIds">The document IDs to delete</param>
/// <exception cref="TxException">Thrown when an API error occurred</exception>
Task<DeleteDocumentsResponse> DeleteCandidates(IEnumerable<string> documentIds);
/// <summary>
/// Match an existing candidate document with filters provided.
/// </summary>
/// <param name="query">The query object that will be combined with the match query to drive the search</param>
/// <param name="options">Options for the Match request</param>
/// <param name="sourceDocument">The document to generate the search query from</param>
/// <exception cref="TxException">Thrown when an API error occurred</exception>
Task<SearchResponse> MatchCandidates(DocumentSource sourceDocument, Options options, SearchQuery query = null);
/// <summary>
/// Search for a candidate based on the query provided.
/// </summary>
/// <param name="query">The query object that will drive the search.</param>
/// <param name="options">Options for the search request</param>
/// <exception cref="TxException">Thrown when an API error occurred</exception>
Task<SearchResponse> SearchCandidates(SearchQuery query, Options options);
/// <summary>
/// Returns a list of suggested Completions. This endpoint is used to give a user instant
/// feedback while typing a query. If the given field is the FULLTEXT field, the service
/// returns suggestions from all configured dictionaries that are not explicitly excluded from full-text suggestions.
/// </summary>
/// <param name="field">Which field to use to retrieve completions</param>
/// <param name="input">The user-typed input string.</param>
/// <param name="languages">
/// Optional 2-letter ISO-639-1 language codes. The first language is used for field label translations.
/// All languages are used to retrieve completions when the environment doesn't have default languages set.
/// </param>
/// <exception cref="TxException">Thrown when an API error occurs</exception>
Task<AutocompleteResponse> AutocompleteCandidates(AutocompleteCandidatesField field, string input, params string[] languages);
#endregion
#region Jobs
/// <summary>
/// Upload a job to the search and match V2 environment.
/// </summary>
/// <param name="documentId">The id to use for the document</param>
/// <param name="job">Parsed output from the Textkernel Job Parser</param>
/// <param name="roles">The roles associated with the request. Defaults to ["All"] if none are provided.</param>
/// <param name="customFields">A collection of custom fields represented as key-value pairs.</param>
/// <exception cref="TxException">Thrown when an API error occurs</exception>
Task<ApiResponse<object>> AddJob(string documentId, ParsedJob job, IEnumerable<string> roles = null, Dictionary<string, string> customFields = null);
/// <summary>
/// Delete job documents from environment
/// </summary>
/// <param name="documentIds">The document IDs to delete</param>
/// <exception cref="TxException">Thrown when an API error occurred</exception>
Task<DeleteDocumentsResponse> DeleteJobs(IEnumerable<string> documentIds);
/// <summary>
/// Match an existing job document with filters provided.
/// </summary>
/// <param name="query">The query object that will be combined with the match query to drive the search</param>
/// <param name="options">Options for the Match request</param>
/// <param name="sourceDocument">The document to generate the search query from</param>
/// <exception cref="TxException">Thrown when an API error occurred</exception>
Task<SearchResponse> MatchJobs(DocumentSource sourceDocument, Options options, SearchQuery query = null);
/// <summary>
/// Search for a job based on the query provided.
/// </summary>
/// <param name="query">The query object that will drive the search.</param>
/// <param name="options">Options for the search request</param>
/// <exception cref="TxException">Thrown when an API error occurred</exception>
Task<SearchResponse> SearchJobs(SearchQuery query, Options options);
/// <summary>
/// Returns a list of suggested Completions. This endpoint is used to give a user instant
/// feedback while typing a query. If the given field is the FULLTEXT field, the service
/// returns suggestions from all configured dictionaries that are not explicitly excluded from full-text suggestions.
/// </summary>
/// <param name="field">Which field to use to retrieve completions</param>
/// <param name="input">The user-typed input string.</param>
/// <param name="languages">
/// Optional 2-letter ISO-639-1 language codes. The first language is used for field label translations.
/// All languages are used to retrieve completions when the environment doesn't have default languages set.
/// </param>
/// <exception cref="TxException">Thrown when an API error occurs</exception>
Task<AutocompleteResponse> AutocompleteJobs(AutocompleteJobsField field, string input, params string[] languages);
#endregion
}
}