public ResultsPage <Person> GetNearbyPage(short pageSize, PagingTokens pagingTokens, GetNearbyPeopleParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsValidPageSize(pageSize); var url = UrlProvider.GetV1PersonNearbyUrl(pageSize, pagingTokens, parameters); return(GetJson <ResultsPage <Person> >(url, cancellationToken).Payload); }
/// <summary> /// Searches for people near a location defined by latitude and longitude as pages of results /// </summary> /// <param name="parameters">The attributes used to search for people</param> /// <param name="pageSize">The size of the pages of results to return from the server. If null it will use the default value.</param> /// <returns>A cursor that can be used to iterate through the pages of people either syncronously or asyncronously</returns> public IAsyncCursor <ResultsPage <Person> > GetNearbyAsPages(GetNearbyPeopleParameters parameters, short?pageSize = null) { Ensure.IsNotNull(parameters, nameof(parameters)); Ensure.IsValidExplicitPageSize(pageSize); var actualPageSize = GetPageSize(pageSize); return(new AsyncPageCursor <Person>( (size, tokens, token) => GetNearbyPage(actualPageSize, tokens, parameters, token), async(size, tokens, token) => await GetNearbyPageAsync(actualPageSize, tokens, parameters, token), actualPageSize)); }
/// <inheritDoc/> public string GetV1PersonNearbyUrl(short pageSize, PagingTokens pagingTokens, GetNearbyPeopleParameters parameters) { var queryValues = CreateQueryStringValues(pageSize, pagingTokens, parameters); return("api/v1/people/nearby" + queryValues.ToString(true)); }
/// <summary> /// Searches for people near a location defined by latitude and longitude /// </summary> /// <param name="parameters">The attributes used to search for people</param> /// <param name="pageSize">The size of the pages of results to return from the server. If null it will use the default value.</param> /// <returns>A cursor that can be used to iterate through the people either syncronously or asyncronously</returns> public IAsyncCursor <Person> GetNearby(GetNearbyPeopleParameters parameters, short?pageSize = null) { return(new AsyncPagedEntityCursor <Person>(GetNearbyAsPages(parameters, pageSize))); }