Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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());
        }
Esempio n. 4
0
        private string BuildUri(LevelUpApiVersion version, string path)
        {
            LevelUpUriBuilder builder = new LevelUpUriBuilder(_targetEnviornment);

            return(builder.SetApiVersion(version).SetPath(path).Build());
        }