Class DomainCapiInterviewersClient
public class DomainCapiInterviewersClient
- Inheritance
-
DomainCapiInterviewersClient
- Inherited Members
Constructors
DomainCapiInterviewersClient(string, HttpClient)
public DomainCapiInterviewersClient(string baseUrl, HttpClient httpClient)
Parameters
baseUrlstringhttpClientHttpClient
Properties
BaseUrl
public string BaseUrl { get; set; }
Property Value
JsonSerializerSettings
protected JsonSerializerSettings JsonSerializerSettings { get; }
Property Value
- JsonSerializerSettings
ReadResponseAsString
public bool ReadResponseAsString { get; set; }
Property Value
Methods
DeleteAsync(string, CancellationToken)
This method deletes a specified interviewer.
public virtual Task DeleteAsync(string interviewerId, CancellationToken cancellationToken = default)
Parameters
interviewerIdstringThe id of the interviewer that is to be deleted
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
No content
Exceptions
- NfieldSdkException
A server side error occurred.
DeleteOfficeAssignmentAsync(string, string, CancellationToken)
Delete fieldwork office(s) from an interviewer. If fieldwork office doesn't exist on interviewer it will be ignored.
public virtual Task DeleteOfficeAssignmentAsync(string interviewerId, string officeId, CancellationToken cancellationToken = default)
Parameters
interviewerIdstringInterviewer interviewerId
officeIdstringfieldwork officeId
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
Fieldwork office removed
Exceptions
- NfieldSdkException
A server side error occurred.
GetAllAsync(CancellationToken)
This method retrieve a list of interviewers. This list can be
filtered and sorted using standard OData syntax.
public virtual Task<ICollection<Interviewer>> GetAllAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ICollection<Interviewer>>
Capi Interviewers
Exceptions
- NfieldSdkException
A server side error occurred.
GetAssignmentsAsync(string, CancellationToken)
This method retrieves all assignments with counts for the interviewer. It is only allowed for CAPI surveys.
Gets all assignments types, Survey and Sampling points. (Free intercept, Individual target, Sampling points)
public virtual Task<ICollection<InterviewerAssignmentResponseModel>> GetAssignmentsAsync(string interviewerId, CancellationToken cancellationToken = default)
Parameters
interviewerIdstringThe id of the interviewer
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ICollection<InterviewerAssignmentResponseModel>>
Successful
Exceptions
- NfieldSdkException
A server side error occurred.
GetAsync(string, CancellationToken)
This method retrieve details of a specific interviewer using the interviewerId.
public virtual Task<Interviewer> GetAsync(string interviewerId, CancellationToken cancellationToken = default)
Parameters
interviewerIdstringThe id of the interviewer
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<Interviewer>
Capi Interviewer
Exceptions
- NfieldSdkException
A server side error occurred.
GetByClientIdAsync(string, CancellationToken)
This method retrieve the details of a specific interviewer using the clientInterviewerId.
public virtual Task<Interviewer> GetByClientIdAsync(string clientInterviewerId, CancellationToken cancellationToken = default)
Parameters
clientInterviewerIdstringThe ClientInterviewerId of the ClientInterviewer
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<Interviewer>
Capi Interviewer by ClientId
Exceptions
- NfieldSdkException
A server side error occurred.
GetOfficesAsync(string, CancellationToken)
Returns fieldwork offices assigned to the specified interviewer.
public virtual Task<ICollection<string>> GetOfficesAsync(string interviewerId, CancellationToken cancellationToken = default)
Parameters
interviewerIdstringInterviewer interviewerId
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ICollection<string>>
Fieldwork offices
Exceptions
- NfieldSdkException
A server side error occurred.
PatchAsync(string, EditCapiInterviewerRequestModel, CancellationToken)
Update an interviewer with the specified specified fields
public virtual Task<CapiInterviewerResponseModel> PatchAsync(string interviewerId, EditCapiInterviewerRequestModel interviewer, CancellationToken cancellationToken = default)
Parameters
interviewerIdstringThe id of the interviewer that is updated.
interviewerEditCapiInterviewerRequestModelSupply Interviewer object with only the properties and values you would like to update: FirstName, LastName, EmailAddress, TelephoneNumber, IsSupervisor
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<CapiInterviewerResponseModel>
Capi Interviewer updated
Exceptions
- NfieldSdkException
A server side error occurred.
PatchOfficeAssignmentAsync(string, string, CancellationToken)
Add fieldwork office to an interviewer. If fieldwork office already exist on interviewer it will be ignored.
public virtual Task PatchOfficeAssignmentAsync(string interviewerId, string officeId, CancellationToken cancellationToken = default)
Parameters
interviewerIdstringInterviewer interviewerId
officeIdstringFieldworkOffice Id
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
Fieldwork office added
Exceptions
- NfieldSdkException
A server side error occurred.
PostAsync(NewCapiInterviewerRequestModel, CancellationToken)
This method creates a new interviewer.
public virtual Task<CapiInterviewerResponseModel> PostAsync(NewCapiInterviewerRequestModel interviewer, CancellationToken cancellationToken = default)
Parameters
interviewerNewCapiInterviewerRequestModelAn object describing the details for the new interviewer
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<CapiInterviewerResponseModel>
New Capi Interviewer
Exceptions
- NfieldSdkException
A server side error occurred.
PutAsync(string, ResetPasswordModel, CancellationToken)
This method is used to reset an interviewer's password.
public virtual Task<CapiInterviewerResponseModel> PutAsync(string interviewerId, ResetPasswordModel resetPassword, CancellationToken cancellationToken = default)
Parameters
interviewerIdstringThe id of the interviewer to reset the password for
resetPasswordResetPasswordModelAn object containing the new password
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<CapiInterviewerResponseModel>
Capi Interviewer password updated
Exceptions
- NfieldSdkException
A server side error occurred.
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)
protected virtual Task<DomainCapiInterviewersClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T