public void CanSetApiVersion() { var uriBuilder = new LevelUpUriBuilder(LevelUpEnvironment.Sandbox).SetApiVersion(LevelUpApiVersion.v14); uriBuilder.ApiVersion.Should().Be(LevelUpApiVersion.v14); uriBuilder.SetApiVersion(LevelUpApiVersion.v15); uriBuilder.ApiVersion.Should().Be(LevelUpApiVersion.v15); }
public string GetOrderQueryRequestEndpoint(OrderQueryRequest request) { string path = $"locations/{request.LocationId}/orders"; LevelUpUriBuilder builder = new LevelUpUriBuilder(_targetEnviornment); builder.SetApiVersion(request.ApiVersion).SetPath(path); if (request.PageNumber > 1) { builder.AppendQuery("page", request.PageNumber.ToString()); } return(builder.Build()); }
public string Visit(OrderQueryRequest request) { string path = string.Format("locations/{0}/orders", request.LocationId); LevelUpUriBuilder builder = new LevelUpUriBuilder(TargetEnviornment); builder.SetApiVersion(request.ApiVersion).SetPath(path); if (request.PageNumber > 1) { builder.AppendQuery("page", request.PageNumber.ToString()); } return(builder.Build()); }
private string BuildUri(LevelUpApiVersion version, string path) { LevelUpUriBuilder builder = new LevelUpUriBuilder(_targetEnviornment); return(builder.SetApiVersion(version).SetPath(path).Build()); }