Skip to content

Commit

Permalink
build(codegen): updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Jan 31, 2024
1 parent aff9a51 commit d47dd3d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
1 change: 1 addition & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<details>
<summary>Added Property(s)</summary>

- added property `perMethodExternalTaxRate` to type `CartAddLineItemAction`
- added property `shippingMode` to type `MyCartDraft`
</details>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public async void CustomLogger()
var p = s.BuildServiceProvider();

var apiRoot = p.GetService<ProjectApiRoot>();

await apiRoot.Get().ExecuteAsync();

var messages = logger.GetLogMessages();
Assert.Equal("GET https://api.europe-west1.gcp.commercetools.com/" + clientConfiguration.ProjectKey, messages.TrimEnd());
}

public class CustomLoggerHandler : DelegatingHandler
{
private readonly ILogger logger;
Expand All @@ -68,7 +68,7 @@ public CustomLoggerHandler(ILoggerFactory loggerFactory)
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
// Send the request without logging the request details
logger.Log(LogLevel.Information, "{method} {uri}", request.Method.Method, request.RequestUri?.AbsoluteUri);
logger.Log(LogLevel.Information, "{method} {uri}", request.Method.Method, request.RequestUri?.AbsoluteUri);
var response = await base.SendAsync(request, cancellationToken);

return response;
Expand Down Expand Up @@ -142,8 +142,8 @@ public string GetLogMessages()
return stringBuilder.ToString();
}
}
class CustomLoggerHandlerFactory: ILoggerHandlerFactory

class CustomLoggerHandlerFactory : ILoggerHandlerFactory
{
private readonly ILoggerFactory loggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using commercetools.Sdk.Api.Models.Common;
using commercetools.Sdk.Api.Models.Types;
using System;
using System.Collections.Generic;
using System.Linq;


namespace commercetools.Sdk.Api.Models.Carts
Expand Down Expand Up @@ -33,6 +35,10 @@ public partial class CartAddLineItemAction : ICartAddLineItemAction

public IExternalTaxRateDraft ExternalTaxRate { get; set; }

public IList<IMethodExternalTaxRateDraft> PerMethodExternalTaxRate { get; set; }
public IEnumerable<IMethodExternalTaxRateDraft> PerMethodExternalTaxRateEnumerable { set => PerMethodExternalTaxRate = value.ToList(); }


public IInventoryMode InventoryMode { get; set; }

public IItemShippingDetailsDraft ShippingDetails { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using commercetools.Sdk.Api.Models.Common;
using commercetools.Sdk.Api.Models.Types;
using System;
using System.Collections.Generic;
using System.Linq;
using commercetools.Base.CustomAttributes;

// ReSharper disable CheckNamespace
Expand Down Expand Up @@ -32,6 +34,10 @@ public partial interface ICartAddLineItemAction : ICartUpdateAction

IExternalTaxRateDraft ExternalTaxRate { get; set; }

IList<IMethodExternalTaxRateDraft> PerMethodExternalTaxRate { get; set; }
IEnumerable<IMethodExternalTaxRateDraft> PerMethodExternalTaxRateEnumerable { set => PerMethodExternalTaxRate = value.ToList(); }


IInventoryMode InventoryMode { get; set; }

IItemShippingDetailsDraft ShippingDetails { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ public CombinationQueryPredicate<CartAddLineItemActionQueryBuilderDsl> ExternalT
CartAddLineItemActionQueryBuilderDsl.Of);
}

public CombinationQueryPredicate<CartAddLineItemActionQueryBuilderDsl> PerMethodExternalTaxRate(
Func<commercetools.Sdk.Api.Predicates.Query.Carts.MethodExternalTaxRateDraftQueryBuilderDsl, CombinationQueryPredicate<commercetools.Sdk.Api.Predicates.Query.Carts.MethodExternalTaxRateDraftQueryBuilderDsl>> fn)
{
return new CombinationQueryPredicate<CartAddLineItemActionQueryBuilderDsl>(ContainerQueryPredicate.Of()
.Parent(ConstantQueryPredicate.Of().Constant("perMethodExternalTaxRate"))
.Inner(fn.Invoke(commercetools.Sdk.Api.Predicates.Query.Carts.MethodExternalTaxRateDraftQueryBuilderDsl.Of())),
CartAddLineItemActionQueryBuilderDsl.Of);
}
public ICollectionPredicateBuilder<CartAddLineItemActionQueryBuilderDsl> PerMethodExternalTaxRate()
{
return new CollectionPredicateBuilder<CartAddLineItemActionQueryBuilderDsl>(BinaryQueryPredicate.Of().Left(new ConstantQueryPredicate("perMethodExternalTaxRate")),
p => new CombinationQueryPredicate<CartAddLineItemActionQueryBuilderDsl>(p, CartAddLineItemActionQueryBuilderDsl.Of));
}
public IComparisonPredicateBuilder<CartAddLineItemActionQueryBuilderDsl, string> InventoryMode()
{
return new ComparisonPredicateBuilder<CartAddLineItemActionQueryBuilderDsl, string>(BinaryQueryPredicate.Of().Left(new ConstantQueryPredicate("inventoryMode")),
Expand Down
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,4 @@ bbed21a27bf83c8ac16f323969d71a8855623523
e3a178953d3d929a58092a0c86d666fee6400c75
d10443de67d8c8e684b4e63415b5720fc3bcf169
886f8d7e51ee9afd3dea683e0b6ed042eec469f1
5b5166eedb28e48364c82c3fcf2d795983fe9fa8

0 comments on commit d47dd3d

Please sign in to comment.