Skip to content

Commit

Permalink
TASK: Updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Auto Mation committed Oct 2, 2023
1 parent 99ae1d1 commit aa4d5b6
Show file tree
Hide file tree
Showing 12 changed files with 254 additions and 39 deletions.
10 changes: 10 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@
</details>


<details>
<summary>Changed MethodResponseBody(s)</summary>

- :warning: changed response body for `200: application/json` of method `get /{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/approval-rules` from type `<<resourceQueryType>>` to `ApprovalRulePagedQueryResponse`
- :warning: changed response body for `200: application/json` of method `get /{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/approval-flows` from type `<<resourceQueryType>>` to `ApprovalFlowPagedQueryResponse`
</details>


<details>
<summary>Added Type(s)</summary>

- added type `ApprovalFlowPagedQueryResponse`
- added type `ApprovalRulePagedQueryResponse`
- added type `CartDiscountTotalPriceTarget`
- added type `DiscountOnTotalPrice`
- added type `DiscountedTotalPricePortion`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public static IEnumerable<object[]> GetData()
.WithAssociateIdValue("test_associateId")
.InBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey")
.ApprovalRules()
.Post(null)
.Get()
.WithExpand("expand")
.Build(),
"Post",
"Get",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?expand=expand",
},
new Object[] {
Expand All @@ -39,10 +39,11 @@ public static IEnumerable<object[]> GetData()
.WithAssociateIdValue("test_associateId")
.InBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey")
.ApprovalRules()
.Post(null)
.Get()
.WithSort("sort")
.Build(),
"Post",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules",
"Get",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?sort=sort",
},
new Object[] {
ApiRoot
Expand All @@ -52,10 +53,10 @@ public static IEnumerable<object[]> GetData()
.InBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey")
.ApprovalRules()
.Get()
.WithExpand("expand")
.WithLimit(7)
.Build(),
"Get",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?expand=expand",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?limit=7",
},
new Object[] {
ApiRoot
Expand All @@ -65,10 +66,10 @@ public static IEnumerable<object[]> GetData()
.InBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey")
.ApprovalRules()
.Get()
.WithSort("sort")
.WithOffset(3)
.Build(),
"Get",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?sort=sort",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?offset=3",
},
new Object[] {
ApiRoot
Expand All @@ -78,10 +79,10 @@ public static IEnumerable<object[]> GetData()
.InBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey")
.ApprovalRules()
.Get()
.WithLimit(7)
.WithWithTotal(true)
.Build(),
"Get",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?limit=7",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?withTotal=true",
},
new Object[] {
ApiRoot
Expand All @@ -91,10 +92,10 @@ public static IEnumerable<object[]> GetData()
.InBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey")
.ApprovalRules()
.Get()
.WithOffset(3)
.WithWhere("where")
.Build(),
"Get",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?offset=3",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?where=where",
},
new Object[] {
ApiRoot
Expand All @@ -104,10 +105,10 @@ public static IEnumerable<object[]> GetData()
.InBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey")
.ApprovalRules()
.Get()
.WithWithTotal(true)
.WithPredicateVar("varName", "var.varName")
.Build(),
"Get",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?withTotal=true",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?var.varName=var.varName",
},
new Object[] {
ApiRoot
Expand All @@ -117,10 +118,9 @@ public static IEnumerable<object[]> GetData()
.InBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey")
.ApprovalRules()
.Get()
.WithWhere("where")
.Build(),
"Get",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?where=where",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules",
},
new Object[] {
ApiRoot
Expand All @@ -129,11 +129,11 @@ public static IEnumerable<object[]> GetData()
.WithAssociateIdValue("test_associateId")
.InBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey")
.ApprovalRules()
.Get()
.WithPredicateVar("varName", "var.varName")
.Post(null)
.WithExpand("expand")
.Build(),
"Get",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?var.varName=var.varName",
"Post",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules?expand=expand",
},
new Object[] {
ApiRoot
Expand All @@ -142,9 +142,9 @@ public static IEnumerable<object[]> GetData()
.WithAssociateIdValue("test_associateId")
.InBusinessUnitKeyWithBusinessUnitKeyValue("test_businessUnitKey")
.ApprovalRules()
.Get()
.Post(null)
.Build(),
"Get",
"Post",
"/test_projectKey/as-associate/test_associateId/in-business-unit/key=test_businessUnitKey/approval-rules",
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Globalization;
using System.Collections.Generic;
using System.Net.Http;
Expand All @@ -11,7 +10,7 @@
namespace commercetools.Sdk.Api.Client.RequestBuilders.AsAssociate
{

public partial class ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet : ApiMethod<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, IApiMethod<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet, Object>, commercetools.Sdk.Api.Client.IExpandableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, commercetools.Sdk.Api.Client.ISortableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, commercetools.Sdk.Api.Client.IPagingTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, commercetools.Sdk.Api.Client.IQueryTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, commercetools.Sdk.Api.Client.IErrorableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, commercetools.Sdk.Api.Client.IDeprecatable200Trait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>
public partial class ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet : ApiMethod<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, IApiMethod<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet, commercetools.Sdk.Api.Models.ApprovalFlows.IApprovalFlowPagedQueryResponse>, commercetools.Sdk.Api.Client.IExpandableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, commercetools.Sdk.Api.Client.ISortableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, commercetools.Sdk.Api.Client.IPagingTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, commercetools.Sdk.Api.Client.IQueryTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, commercetools.Sdk.Api.Client.IErrorableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>, commercetools.Sdk.Api.Client.IDeprecatable200Trait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalFlowsGet>
{


Expand Down Expand Up @@ -100,11 +99,11 @@ public ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApp
return this.AddQueryParam($"var.{varName}", predicateVar);
}

public async Task<Object> ExecuteAsync(CancellationToken cancellationToken = default)
public async Task<commercetools.Sdk.Api.Models.ApprovalFlows.IApprovalFlowPagedQueryResponse> ExecuteAsync(CancellationToken cancellationToken = default)
{

var requestMessage = Build();
return await ApiHttpClient.ExecuteAsync<Object>(requestMessage, cancellationToken);
return await ApiHttpClient.ExecuteAsync<commercetools.Sdk.Api.Models.ApprovalFlows.IApprovalFlowPagedQueryResponse>(requestMessage, cancellationToken);

}

Expand All @@ -114,11 +113,11 @@ public async Task<string> ExecuteAsJsonAsync(CancellationToken cancellationToken
return await ApiHttpClient.ExecuteAsJsonAsync(requestMessage, cancellationToken);
}

public async Task<IApiResponse<Object>> SendAsync(CancellationToken cancellationToken = default)
public async Task<IApiResponse<commercetools.Sdk.Api.Models.ApprovalFlows.IApprovalFlowPagedQueryResponse>> SendAsync(CancellationToken cancellationToken = default)
{

var requestMessage = Build();
return await ApiHttpClient.SendAsync<Object>(requestMessage, cancellationToken);
return await ApiHttpClient.SendAsync<commercetools.Sdk.Api.Models.ApprovalFlows.IApprovalFlowPagedQueryResponse>(requestMessage, cancellationToken);

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Globalization;
using System.Collections.Generic;
using System.Net.Http;
Expand All @@ -11,7 +10,7 @@
namespace commercetools.Sdk.Api.Client.RequestBuilders.AsAssociate
{

public partial class ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet : ApiMethod<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, IApiMethod<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet, Object>, commercetools.Sdk.Api.Client.IExpandableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, commercetools.Sdk.Api.Client.ISortableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, commercetools.Sdk.Api.Client.IPagingTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, commercetools.Sdk.Api.Client.IQueryTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, commercetools.Sdk.Api.Client.IErrorableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, commercetools.Sdk.Api.Client.IDeprecatable200Trait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>
public partial class ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet : ApiMethod<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, IApiMethod<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet, commercetools.Sdk.Api.Models.ApprovalRules.IApprovalRulePagedQueryResponse>, commercetools.Sdk.Api.Client.IExpandableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, commercetools.Sdk.Api.Client.ISortableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, commercetools.Sdk.Api.Client.IPagingTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, commercetools.Sdk.Api.Client.IQueryTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, commercetools.Sdk.Api.Client.IErrorableTrait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>, commercetools.Sdk.Api.Client.IDeprecatable200Trait<ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet>
{


Expand Down Expand Up @@ -100,11 +99,11 @@ public ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApp
return this.AddQueryParam($"var.{varName}", predicateVar);
}

public async Task<Object> ExecuteAsync(CancellationToken cancellationToken = default)
public async Task<commercetools.Sdk.Api.Models.ApprovalRules.IApprovalRulePagedQueryResponse> ExecuteAsync(CancellationToken cancellationToken = default)
{

var requestMessage = Build();
return await ApiHttpClient.ExecuteAsync<Object>(requestMessage, cancellationToken);
return await ApiHttpClient.ExecuteAsync<commercetools.Sdk.Api.Models.ApprovalRules.IApprovalRulePagedQueryResponse>(requestMessage, cancellationToken);

}

Expand All @@ -114,11 +113,11 @@ public async Task<string> ExecuteAsJsonAsync(CancellationToken cancellationToken
return await ApiHttpClient.ExecuteAsJsonAsync(requestMessage, cancellationToken);
}

public async Task<IApiResponse<Object>> SendAsync(CancellationToken cancellationToken = default)
public async Task<IApiResponse<commercetools.Sdk.Api.Models.ApprovalRules.IApprovalRulePagedQueryResponse>> SendAsync(CancellationToken cancellationToken = default)
{

var requestMessage = Build();
return await ApiHttpClient.SendAsync<Object>(requestMessage, cancellationToken);
return await ApiHttpClient.SendAsync<commercetools.Sdk.Api.Models.ApprovalRules.IApprovalRulePagedQueryResponse>(requestMessage, cancellationToken);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApp
this.BusinessUnitKey = businessUnitKey;
}

public ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesPost Post(commercetools.Sdk.Api.Models.ApprovalRules.IApprovalRuleDraft approvalRuleDraft)
public ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet Get()
{
return new ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesPost(ApiHttpClient, SerializerService, ProjectKey, AssociateId, BusinessUnitKey, approvalRuleDraft);
return new ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet(ApiHttpClient, ProjectKey, AssociateId, BusinessUnitKey);
}

public ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet Get()
public ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesPost Post(commercetools.Sdk.Api.Models.ApprovalRules.IApprovalRuleDraft approvalRuleDraft)
{
return new ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesGet(ApiHttpClient, ProjectKey, AssociateId, BusinessUnitKey);
return new ByProjectKeyAsAssociateByAssociateIdInBusinessUnitKeyByBusinessUnitKeyApprovalRulesPost(ApiHttpClient, SerializerService, ProjectKey, AssociateId, BusinessUnitKey, approvalRuleDraft);
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Collections.Generic;
using System.Linq;


namespace commercetools.Sdk.Api.Models.ApprovalFlows
{

public partial class ApprovalFlowPagedQueryResponse : IApprovalFlowPagedQueryResponse
{
public long Limit { get; set; }

public long Offset { get; set; }

public long Count { get; set; }

public long? Total { get; set; }

public IList<IApprovalFlow> Results { get; set; }
public IEnumerable<IApprovalFlow> ResultsEnumerable { set => Results = value.ToList(); }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Collections.Generic;
using System.Linq;
using commercetools.Base.CustomAttributes;

// ReSharper disable CheckNamespace
namespace commercetools.Sdk.Api.Models.ApprovalFlows
{
[DeserializeAs(typeof(commercetools.Sdk.Api.Models.ApprovalFlows.ApprovalFlowPagedQueryResponse))]
public partial interface IApprovalFlowPagedQueryResponse
{
long Limit { get; set; }

long Offset { get; set; }

long Count { get; set; }

long? Total { get; set; }

IList<IApprovalFlow> Results { get; set; }
IEnumerable<IApprovalFlow> ResultsEnumerable { set => Results = value.ToList(); }


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Collections.Generic;
using System.Linq;


namespace commercetools.Sdk.Api.Models.ApprovalRules
{

public partial class ApprovalRulePagedQueryResponse : IApprovalRulePagedQueryResponse
{
public long Limit { get; set; }

public long Offset { get; set; }

public long Count { get; set; }

public long? Total { get; set; }

public IList<IApprovalRule> Results { get; set; }
public IEnumerable<IApprovalRule> ResultsEnumerable { set => Results = value.ToList(); }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Collections.Generic;
using System.Linq;
using commercetools.Base.CustomAttributes;

// ReSharper disable CheckNamespace
namespace commercetools.Sdk.Api.Models.ApprovalRules
{
[DeserializeAs(typeof(commercetools.Sdk.Api.Models.ApprovalRules.ApprovalRulePagedQueryResponse))]
public partial interface IApprovalRulePagedQueryResponse
{
long Limit { get; set; }

long Offset { get; set; }

long Count { get; set; }

long? Total { get; set; }

IList<IApprovalRule> Results { get; set; }
IEnumerable<IApprovalRule> ResultsEnumerable { set => Results = value.ToList(); }


}
}
Loading

0 comments on commit aa4d5b6

Please sign in to comment.