Skip to content

Commit 86ac622

Browse files
committed
build(codegen): updating SDK
1 parent 24682db commit 86ac622

File tree

44 files changed

+101
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+101
-99
lines changed

commercetools.Sdk/commercetools.Sdk.Api/Extensions/ResponseExtensions.cs

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,52 @@ public static class ResponseExtensions
1010
/**
1111
* Tries to access the first element of the result list.
1212
* Use case: query by slug which should contain zero or one element in the result list.
13-
*/
14-
static T? Head<T>(this IResourcePagedQueryResponse<T> response) {
13+
*/
14+
static T? Head<T>(this IResourcePagedQueryResponse<T> response)
15+
{
1516
return response.Results.FirstOrDefault();
1617
}
1718

1819
/**
1920
* Calculates the page number of the result, the pages are indexed staring 0, which means that {@code getPageIndex()}
2021
* returns a value in [0,n) , given 'n' is the total number of pages
2122
*/
22-
static long PageIndex<T>(this IResourcePagedQueryResponse<T> response) {
23-
if (response.Total == null || response.Limit == 0) {
23+
static long PageIndex<T>(this IResourcePagedQueryResponse<T> response)
24+
{
25+
if (response.Total == null || response.Limit == 0)
26+
{
2427
throw new ArgumentException("Can only be used if the limit & total are known and limit is non-zero.");
2528
}
26-
return (long) Math.Floor(response.Offset / Convert.ToDecimal(response.Limit));
29+
return (long)Math.Floor(response.Offset / Convert.ToDecimal(response.Limit));
2730
}
2831

2932
/**
3033
* Calculates the total number of pages matching the request.
3134
*/
32-
static long TotalPages<T>(this IResourcePagedQueryResponse<T> response) {
33-
if (response.Total == null || response.Limit == 0) {
35+
static long TotalPages<T>(this IResourcePagedQueryResponse<T> response)
36+
{
37+
if (response.Total == null || response.Limit == 0)
38+
{
3439
throw new ArgumentException("Can only be used if the limit & total are known and limit is non-zero.");
3540
}
36-
return (long) Math.Ceiling((response.Total ?? 0) / Convert.ToDecimal(response.Limit));
41+
return (long)Math.Ceiling((response.Total ?? 0) / Convert.ToDecimal(response.Limit));
3742
}
3843

3944
/**
4045
* Checks if this is the first page of a result.
4146
*/
42-
static bool IsFirst<T>(this IResourcePagedQueryResponse<T> response) {
47+
static bool IsFirst<T>(this IResourcePagedQueryResponse<T> response)
48+
{
4349
return response.Offset == 0;
4450
}
4551

4652
/**
4753
* Checks if it is the last possible page.
4854
*/
49-
static bool IsLast<T>(this IResourcePagedQueryResponse<T> response) {
50-
if (response.Total == null) {
55+
static bool IsLast<T>(this IResourcePagedQueryResponse<T> response)
56+
{
57+
if (response.Total == null)
58+
{
5159
throw new ArgumentException("Can only be used if the offset & total are known.");
5260
}
5361
//currently counting the total amount is performed in a second database call, so it is possible
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.ApiClients;
22

3-
public partial interface IApiClientPagedQueryResponse: IResourcePagedQueryResponse<IApiClient>
3+
public partial interface IApiClientPagedQueryResponse : IResourcePagedQueryResponse<IApiClient>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.ApprovalFlows;
22

3-
public partial interface IApprovalFlowPagedQueryResponse: IResourcePagedQueryResponse<IApprovalFlow>
3+
public partial interface IApprovalFlowPagedQueryResponse : IResourcePagedQueryResponse<IApprovalFlow>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.ApprovalRules;
22

3-
public partial interface IApprovalRulePagedQueryResponse: IResourcePagedQueryResponse<IApprovalRule>
3+
public partial interface IApprovalRulePagedQueryResponse : IResourcePagedQueryResponse<IApprovalRule>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.AssociateRoles;
22

3-
public partial interface IAssociateRolePagedQueryResponse: IResourcePagedQueryResponse<IAssociateRole>
3+
public partial interface IAssociateRolePagedQueryResponse : IResourcePagedQueryResponse<IAssociateRole>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.AttributeGroups;
22

3-
public partial interface IAttributeGroupPagedQueryResponse: IResourcePagedQueryResponse<IAttributeGroup>
3+
public partial interface IAttributeGroupPagedQueryResponse : IResourcePagedQueryResponse<IAttributeGroup>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.BusinessUnits;
22

3-
public partial interface IBusinessUnitPagedQueryResponse: IResourcePagedQueryResponse<IBusinessUnit>
3+
public partial interface IBusinessUnitPagedQueryResponse : IResourcePagedQueryResponse<IBusinessUnit>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.CartDiscounts;
22

3-
public partial interface ICartDiscountPagedQueryResponse: IResourcePagedQueryResponse<ICartDiscount>
3+
public partial interface ICartDiscountPagedQueryResponse : IResourcePagedQueryResponse<ICartDiscount>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Carts;
22

3-
public partial interface ICartPagedQueryResponse: IResourcePagedQueryResponse<ICart>
3+
public partial interface ICartPagedQueryResponse : IResourcePagedQueryResponse<ICart>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Categories;
22

3-
public partial interface ICategoryPagedQueryResponse: IResourcePagedQueryResponse<ICategory>
3+
public partial interface ICategoryPagedQueryResponse : IResourcePagedQueryResponse<ICategory>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Channels;
22

3-
public partial interface IChannelPagedQueryResponse: IResourcePagedQueryResponse<IChannel>
3+
public partial interface IChannelPagedQueryResponse : IResourcePagedQueryResponse<IChannel>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.CustomObjects;
22

3-
public partial interface ICustomObjectPagedQueryResponse: IResourcePagedQueryResponse<ICustomObject>
3+
public partial interface ICustomObjectPagedQueryResponse : IResourcePagedQueryResponse<ICustomObject>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.CustomerGroups;
22

3-
public partial interface ICustomerGroupPagedQueryResponse: IResourcePagedQueryResponse<ICustomerGroup>
3+
public partial interface ICustomerGroupPagedQueryResponse : IResourcePagedQueryResponse<ICustomerGroup>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Customers;
22

3-
public partial interface ICustomerPagedQueryResponse: IResourcePagedQueryResponse<ICustomer>
3+
public partial interface ICustomerPagedQueryResponse : IResourcePagedQueryResponse<ICustomer>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.DiscountCodes;
22

3-
public partial interface IDiscountCodePagedQueryResponse: IResourcePagedQueryResponse<IDiscountCode>
3+
public partial interface IDiscountCodePagedQueryResponse : IResourcePagedQueryResponse<IDiscountCode>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Extensions;
22

3-
public partial interface IExtensionPagedQueryResponse: IResourcePagedQueryResponse<IExtension>
3+
public partial interface IExtensionPagedQueryResponse : IResourcePagedQueryResponse<IExtension>
44
{
5-
5+
66
}

commercetools.Sdk/commercetools.Sdk.Api/Models/IResourcePageableQueryResponse.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
using System.Collections.Generic;
2-
using System.Linq;
3-
41
namespace commercetools.Sdk.Api.Models;
52

6-
public interface IResourcePageableQueryResponse<T>: IResourceQueryResponse<T>
3+
public interface IResourcePageableQueryResponse<T> : IResourceQueryResponse<T>
74
{
85
public long? Limit { get; set; }
96

commercetools.Sdk/commercetools.Sdk.Api/Models/IResourcePagedQueryResponse.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
using System.Collections.Generic;
2-
using System.Linq;
3-
41
namespace commercetools.Sdk.Api.Models;
52

6-
public interface IResourcePagedQueryResponse<T>: IResourceQueryResponse<T>
3+
public interface IResourcePagedQueryResponse<T> : IResourceQueryResponse<T>
74
{
85
public long Limit { get; set; }
96

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Inventories;
22

3-
public partial interface IInventoryPagedQueryResponse: IResourcePagedQueryResponse<IInventoryEntry>
3+
public partial interface IInventoryPagedQueryResponse : IResourcePagedQueryResponse<IInventoryEntry>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Messages;
22

3-
public partial interface IMessagePagedQueryResponse: IResourcePagedQueryResponse<IMessage>
3+
public partial interface IMessagePagedQueryResponse : IResourcePagedQueryResponse<IMessage>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.OrderEdits;
22

3-
public partial interface IOrderEditPagedQueryResponse: IResourcePagedQueryResponse<IOrderEdit>
3+
public partial interface IOrderEditPagedQueryResponse : IResourcePagedQueryResponse<IOrderEdit>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Orders;
22

3-
public partial interface IOrderPagedQueryResponse: IResourcePagedQueryResponse<IOrder>
3+
public partial interface IOrderPagedQueryResponse : IResourcePagedQueryResponse<IOrder>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Payments;
22

3-
public partial interface IPaymentPagedQueryResponse: IResourcePagedQueryResponse<IPayment>
3+
public partial interface IPaymentPagedQueryResponse : IResourcePagedQueryResponse<IPayment>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.ProductDiscounts;
22

3-
public partial interface IProductDiscountPagedQueryResponse: IResourcePagedQueryResponse<IProductDiscount>
3+
public partial interface IProductDiscountPagedQueryResponse : IResourcePagedQueryResponse<IProductDiscount>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.ProductSelections;
22

3-
public partial interface IProductSelectionPagedQueryResponse: IResourcePagedQueryResponse<IProductSelection>
3+
public partial interface IProductSelectionPagedQueryResponse : IResourcePagedQueryResponse<IProductSelection>
44
{
5-
5+
66
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
using commercetools.Sdk.Api.Models.Products;
2-
31
namespace commercetools.Sdk.Api.Models.ProductTailorings;
42

5-
public partial interface IProductTailoringPagedQueryResponse: IResourcePagedQueryResponse<IProductTailoring>
3+
public partial interface IProductTailoringPagedQueryResponse : IResourcePagedQueryResponse<IProductTailoring>
64
{
7-
5+
86
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.ProductTypes;
22

3-
public partial interface IProductTypePagedQueryResponse: IResourcePagedQueryResponse<IProductType>
3+
public partial interface IProductTypePagedQueryResponse : IResourcePagedQueryResponse<IProductType>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Products;
22

3-
public partial interface IProductPagedQueryResponse: IResourcePagedQueryResponse<IProduct>
3+
public partial interface IProductPagedQueryResponse : IResourcePagedQueryResponse<IProduct>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Products;
22

3-
public partial interface IProductProjectionPagedQueryResponse: IResourcePagedQueryResponse<IProductProjection>
3+
public partial interface IProductProjectionPagedQueryResponse : IResourcePagedQueryResponse<IProductProjection>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.QuoteRequests;
22

3-
public partial interface IQuoteRequestPagedQueryResponse: IResourcePagedQueryResponse<IQuoteRequest>
3+
public partial interface IQuoteRequestPagedQueryResponse : IResourcePagedQueryResponse<IQuoteRequest>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Quotes;
22

3-
public partial interface IQuotePagedQueryResponse: IResourcePagedQueryResponse<IQuote>
3+
public partial interface IQuotePagedQueryResponse : IResourcePagedQueryResponse<IQuote>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.Reviews;
22

3-
public partial interface IReviewPagedQueryResponse: IResourcePagedQueryResponse<IReview>
3+
public partial interface IReviewPagedQueryResponse : IResourcePagedQueryResponse<IReview>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.ShippingMethods;
22

3-
public partial interface IShippingMethodPagedQueryResponse: IResourcePageableQueryResponse<IShippingMethod>
3+
public partial interface IShippingMethodPagedQueryResponse : IResourcePageableQueryResponse<IShippingMethod>
44
{
5-
5+
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace commercetools.Sdk.Api.Models.ShoppingLists;
22

3-
public partial interface IShoppingListPagedQueryResponse: IResourcePagedQueryResponse<IShoppingList>
3+
public partial interface IShoppingListPagedQueryResponse : IResourcePagedQueryResponse<IShoppingList>
44
{
5-
5+
66
}

0 commit comments

Comments
 (0)