public void UriBuilderExtensionWithQuery()
        {
            //-- Arrange
            UriBuilder uriBulder   = new UriBuilder();
            QueryType  queryObject = new QueryType()
            {
                Property = "test_property_value",
                Array    = new string[] { "test_array_value_1", "test_array_value_2" }
            };
            string queryExpectedSerializedObject = "?property_test=test_property_value&array_test=test_array_value_1&array_test=test_array_value_2";

            // Act
            uriBulder = UriBuilderExtension.WithQuery <QueryType>(uriBulder, queryObject);

            // Assert
            Assert.Equal(queryExpectedSerializedObject, uriBulder.Query);
        }
Exemplo n.º 2
0
        public async Task <DataModel.Results.RedemptionRedeem> Redeem(DataModel.Queries.RedemptionRedeem query, DataModel.Contexts.RedemptionRedeem context)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/redeem"), query);

            return(await this.client.DoPostRequest <DataModel.Results.RedemptionRedeem, DataModel.Contexts.RedemptionRedeem>(uriBuilder.Uri, context).ConfigureAwait(false));
        }
Exemplo n.º 3
0
        public async Task Delete(string code, Core.DataModel.ForcedOperation query)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/vouchers/{0}", UriBuilderExtension.EnsureEscapedDataString("code", code))), query);

            await this.client.DoDeleteRequest(uriBuilder.Uri).ConfigureAwait(false);
        }
Exemplo n.º 4
0
        public void Delete(string code, Core.DataModel.ForcedOperation query, Action <ApiResponse> callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/vouchers/{0}", Uri.EscapeDataString(code))), query);

            this.client.DoDeleteRequest(uriBuilder.Uri, callback);
        }
Exemplo n.º 5
0
        public void List(DataModel.Queries.PromotionTiersFilter filter, Action <ApiResponse <DataModel.PromotionTierList> > callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/promotions/tiers"), filter);

            this.client.DoGetRequest <DataModel.PromotionTierList>(uriBuilder.Uri, callback);
        }
Exemplo n.º 6
0
        public void Redeem(DataModel.Queries.RedemptionRedeem query, DataModel.Contexts.RedemptionRedeem context, Action <ApiResponse <DataModel.Results.RedemptionRedeem> > callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/redeem"), query);

            this.client.DoPostRequest(uriBuilder.Uri, context, callback);
        }
Exemplo n.º 7
0
        public async Task DeleteSku(string productId, string skuId, Core.DataModel.ForcedOperation query)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/products/{0}/skus/{1}", Uri.EscapeDataString(productId), Uri.EscapeDataString(skuId))), query);

            await this.client.DoDeleteRequest(uriBuilder.Uri).ConfigureAwait(false);
        }
        public async Task Publish(DataModel.Queries.VoucherPublish query, DataModel.Contexts.VoucherPublish context)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/vouchers/publish"), query);

            await this.client.DoPostRequest <Core.DataModel.Empty, DataModel.Contexts.VoucherPublish>(uriBuilder.Uri, context).ConfigureAwait(false);
        }
Exemplo n.º 9
0
        public void Delete(string name, Core.DataModel.ForcedOperation query, Action <ApiResponse> callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/campaigns/{0}", UriBuilderExtension.EnsureEscapedDataString("name", name))), query);

            this.client.DoDeleteRequest(uriBuilder.Uri, callback);
        }
Exemplo n.º 10
0
        public async Task <DataModel.BusinessValidationRuleAssignmentList> ListAssignments(string validationRuleId, DataModel.Queries.BusinessValidationRuleAssignmentFilter filter)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/validation-rules/{0}/assignments", Uri.EscapeDataString(validationRuleId))), filter);

            return(await this.client.DoGetRequest <DataModel.BusinessValidationRuleAssignmentList>(uriBuilder.Uri).ConfigureAwait(false));
        }
Exemplo n.º 11
0
        public async Task <DataModel.BusinessValidationRuleList> List(DataModel.Queries.BusinessValidationRuleFilter filter)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/validation-rules/"), filter);

            return(await this.client.DoGetRequest <DataModel.BusinessValidationRuleList>(uriBuilder.Uri).ConfigureAwait(false));
        }
Exemplo n.º 12
0
 public async Task<DataModel.PromotionTierList> List(DataModel.Queries.PromotionTiersFilter filter)
 {
     UriBuilder uriBuilder =  UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/promotions/tiers"), filter);
     return await this.client.DoGetRequest<DataModel.PromotionTierList>(uriBuilder.Uri).ConfigureAwait(false);
 }
        public async Task <DataModel.Results.RedemptionRollback> Rollback(string redemptionId, DataModel.Queries.RedemptionRollback query, DataModel.Contexts.RedemptionRollback context)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/redemptions/{0}/rollback", Uri.EscapeDataString(redemptionId))), query);

            return(await this.client.DoPostRequest <DataModel.Results.RedemptionRollback, DataModel.Contexts.RedemptionRollback>(uriBuilder.Uri, context).ConfigureAwait(false));
        }
        public async Task <DataModel.Results.RedemptionRedeem> Redeem(string code, DataModel.Queries.RedemptionRedeem query, DataModel.Contexts.RedemptionRedeem context)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/vouchers/{0}/redemption", Uri.EscapeDataString(code))), query);

            return(await this.client.DoPostRequest <DataModel.Results.RedemptionRedeem, DataModel.Contexts.RedemptionRedeem>(uriBuilder.Uri, context).ConfigureAwait(false));
        }
        public void Publish(DataModel.Queries.VoucherPublish query, DataModel.Contexts.VoucherPublish context, Action <ApiResponse <Core.DataModel.Empty> > callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/vouchers/publish"), query);

            this.client.DoPostRequest(uriBuilder.Uri, context, callback);
        }
Exemplo n.º 16
0
        public async Task Delete(string name, Core.DataModel.ForcedOperation query)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/campaigns/{0}", Uri.EscapeDataString(name))), query);

            await this.client.DoDeleteRequest(uriBuilder.Uri).ConfigureAwait(false);
        }
        public void List(DataModel.Queries.BusinessValidationRuleFilter filter, Action <ApiResponse <DataModel.BusinessValidationRuleList> > callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/validation-rules/"), filter);

            this.client.DoGetRequest(uriBuilder.Uri, callback);
        }
        public void ListAssignments(string validationRuleId, DataModel.Queries.BusinessValidationRuleAssignmentFilter filter, Action <ApiResponse <DataModel.BusinessValidationRuleAssignmentList> > callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/validation-rules/{0}/assignments", Uri.EscapeDataString(validationRuleId))), filter);

            this.client.DoGetRequest(uriBuilder.Uri, callback);
        }
Exemplo n.º 19
0
        public void DeleteSku(string productId, string skuId, Core.DataModel.ForcedOperation query, Action <ApiResponse> callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/products/{0}/skus/{1}", Uri.EscapeDataString(productId), Uri.EscapeDataString(skuId))), query);

            this.client.DoDeleteRequest(uriBuilder.Uri, callback);
        }
Exemplo n.º 20
0
        public void Redeem(string code, DataModel.Queries.RedemptionRedeem query, DataModel.Contexts.RedemptionRedeem context, Action <ApiResponse <DataModel.Results.RedemptionRedeem> > callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/vouchers/{0}/redemption", Uri.EscapeDataString(code))), query);

            this.client.DoPostRequest(uriBuilder.Uri, context, callback);
        }
Exemplo n.º 21
0
        public async Task <DataModel.CustomerList> List(DataModel.Queries.CustomerFilter filter)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/customers/"), filter);

            return(await this.client.DoGetRequest <DataModel.CustomerList>(uriBuilder.Uri).ConfigureAwait(false));
        }
Exemplo n.º 22
0
        public void Rollback(string redemptionId, DataModel.Queries.RedemptionRollback query, DataModel.Contexts.RedemptionRollback context, Action <ApiResponse <DataModel.Results.RedemptionRollback> > callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/redemptions/{0}/rollback", Uri.EscapeDataString(redemptionId))), query);

            this.client.DoPostRequest(uriBuilder.Uri, context, callback);
        }
        public void List(DataModel.Queries.OrderFilter filter, Action <ApiResponse <DataModel.OrderList> > callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/orders/"), filter);

            this.client.DoGetRequest(uriBuilder.Uri, callback);
        }
Exemplo n.º 24
0
        public void ValidateVoucher(DataModel.Queries.VoucherValidation query, Action <ApiResponse <DataModel.Results.VoucherValidation> > callback)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/validate"), query);

            this.client.DoGetRequest(uriBuilder.Uri, callback);
        }
        public async Task <DataModel.Validation> ValidateVoucher(DataModel.Queries.VoucherValidation query)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder("/validate"), query);

            return(await this.client.DoGetRequest <DataModel.Validation>(uriBuilder.Uri).ConfigureAwait(false));
        }
        public async Task Delete(string code, DataModel.Queries.VoucherDelete query)
        {
            UriBuilder uriBuilder = UriBuilderExtension.WithQuery(this.client.GetUriBuilder(string.Format("/vouchers/{0}", Uri.EscapeDataString(code))), query);

            await this.client.DoDeleteRequest(uriBuilder.Uri).ConfigureAwait(false);
        }