public void FindVenues_CanFindVenues() { var options = new VenueSearchOptions() { Name = "Terminal 5" }; var results = _client.FindVenues(options); Assert.NotNull(results); Assert.NotEmpty(results.Venues); }
public VenueSearchResult FindVenues(VenueSearchOptions options) { var request = createVenueSearchRequest(options); return executeRequest<VenueSearchResult>(request); }
public void FindVenuesAsync(VenueSearchOptions options, Action<VenueSearchResult> callback) { var request = createVenueSearchRequest(options); executeRequestAsync<VenueSearchResult>(request, callback); }
private RestRequest createVenueSearchRequest(VenueSearchOptions options) { var request = new RestRequest(); request.Resource = "search/venues"; if (!string.IsNullOrEmpty(options.Name)) request.AddParameter("name", options.Name); if (!string.IsNullOrEmpty(options.CityName)) request.AddParameter("cityName", options.CityName); if (!string.IsNullOrEmpty(options.CityId)) request.AddParameter("cityId", options.CityId); if (!string.IsNullOrEmpty(options.StateCode)) request.AddParameter("stateCode", options.StateCode); if (!string.IsNullOrEmpty(options.State)) request.AddParameter("state", options.State); if (!string.IsNullOrEmpty(options.Country)) request.AddParameter("country", options.Country); if (options.Page.HasValue) request.AddParameter("p", options.Page.Value); return request; }