public async Task <JobsSearchResult> SearchJobs(JobsSearchParameters searchParams) { string queryString = string.Empty; if (searchParams.formId.HasValue) { queryString += "formId=" + searchParams.formId.Value.ToString(); } if (searchParams.isSubmitted.HasValue) { if (queryString != string.Empty) { queryString += "&"; } queryString += "isSubmitted=" + searchParams.isSubmitted.Value.ToString(); } if (searchParams.limit.HasValue) { if (queryString != string.Empty) { queryString += "&"; } queryString += "limit=" + searchParams.limit.Value.ToString(); } if (searchParams.offset.HasValue) { if (queryString != string.Empty) { queryString += "&"; } queryString += "offset=" + searchParams.offset.Value.ToString(); } if (!String.IsNullOrWhiteSpace(searchParams.username)) { if (queryString != string.Empty) { queryString += "&"; } queryString += "username="******"&"; } queryString += "externalId=" + searchParams.externalId.ToString(); } string url = "/jobs?" + queryString; return(await this.oneBlinkApiClient.GetRequest <JobsSearchResult>(url)); }
public async Task <JobsSearchResult> SearchByFormId(int formId) { JobsSearchParameters searchParams = new JobsSearchParameters { formId = formId }; return(await SearchJobs(searchParams)); }
public async Task <JobsSearchResult> SearchByUsername(string username) { JobsSearchParameters searchParams = new JobsSearchParameters { username = username }; return(await SearchJobs(searchParams)); }
public async Task <JobsSearchResult> SearchByExternalId(string externalId) { JobsSearchParameters searchParams = new JobsSearchParameters { externalId = externalId }; return(await SearchJobs(searchParams)); }
public async void can_search_with_multiple_fields() { JobsClient jobs = new JobsClient(ACCESS_KEY, SECRET_KEY, TenantName.ONEBLINK_TEST); JobsSearchParameters searchParams = new JobsSearchParameters() { externalId = "EXT-01", username = "******", formId = 476 }; JobsSearchResult response = await jobs.SearchJobs(searchParams); Assert.NotNull(response); }