Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated SDKs #244

Merged
merged 12 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
335 changes: 18 additions & 317 deletions changes.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task GraphQLQuery()

var client = provider.GetService<ProjectApiRoot>().GraphQLClient();

var response = await client.Query( o => o.Products(selector: r => new { results = r.Results(product => new { product.Id }) }));
var response = await client.Query(o => o.Products(selector: r => new { results = r.Results(product => new { product.Id }) }));

Assert.Null(response.Errors);
Assert.NotNull(response.Data?.results);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,37 @@ public static IEnumerable<object[]> GetData()
ApiRoot
.WithProjectKeyValue("test_projectKey")
.Get()
.WithType("type")
.WithClientId("clientId")
.Build(),
"Get",
"/test_projectKey?type=type",
"/test_projectKey?clientId=clientId",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.Get()
.WithClientId("clientId")
.WithCustomerId("customerId")
.Build(),
"Get",
"/test_projectKey?clientId=clientId",
"/test_projectKey?customerId=customerId",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.Get()
.WithAssociateId("associateId")
.Build(),
"Get",
"/test_projectKey?associateId=associateId",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.Get()
.WithType("type")
.Build(),
"Get",
"/test_projectKey?type=type",
},
new Object[] {
ApiRoot
Expand Down Expand Up @@ -136,15 +154,6 @@ public static IEnumerable<object[]> GetData()
"Get",
"/test_projectKey?stores=stores",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.Get()
.WithCustomerId("customerId")
.Build(),
"Get",
"/test_projectKey?customerId=customerId",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,65 +80,76 @@ public static IEnumerable<object[]> GetData()
.WithResourceTypeValue("test_resourceType")
.WithIDValue("test_ID")
.Get()
.WithType("type")
.WithClientId("clientId")
.Build(),
"Get",
"/test_projectKey/test_resourceType/test_ID?type=type",
"/test_projectKey/test_resourceType/test_ID?clientId=clientId",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.WithIDValue("test_ID")
.Get()
.WithClientId("clientId")
.WithCustomerId("customerId")
.Build(),
"Get",
"/test_projectKey/test_resourceType/test_ID?clientId=clientId",
"/test_projectKey/test_resourceType/test_ID?customerId=customerId",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.WithIDValue("test_ID")
.Get()
.WithSource("source")
.WithAssociateId("associateId")
.Build(),
"Get",
"/test_projectKey/test_resourceType/test_ID?source=source",
"/test_projectKey/test_resourceType/test_ID?associateId=associateId",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.WithIDValue("test_ID")
.Get()
.WithChanges("changes")
.WithType("type")
.Build(),
"Get",
"/test_projectKey/test_resourceType/test_ID?changes=changes",
"/test_projectKey/test_resourceType/test_ID?type=type",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.WithIDValue("test_ID")
.Get()
.WithStores("stores")
.WithSource("source")
.Build(),
"Get",
"/test_projectKey/test_resourceType/test_ID?stores=stores",
"/test_projectKey/test_resourceType/test_ID?source=source",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.WithIDValue("test_ID")
.Get()
.WithCustomerId("customerId")
.WithChanges("changes")
.Build(),
"Get",
"/test_projectKey/test_resourceType/test_ID?customerId=customerId",
"/test_projectKey/test_resourceType/test_ID?changes=changes",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.WithIDValue("test_ID")
.Get()
.WithStores("stores")
.Build(),
"Get",
"/test_projectKey/test_resourceType/test_ID?stores=stores",
},
new Object[] {
ApiRoot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,70 +74,80 @@ public static IEnumerable<object[]> GetData()
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.Get()
.WithType("type")
.WithClientId("clientId")
.Build(),
"Get",
"/test_projectKey/test_resourceType?type=type",
"/test_projectKey/test_resourceType?clientId=clientId",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.Get()
.WithClientId("clientId")
.WithCustomerId("customerId")
.Build(),
"Get",
"/test_projectKey/test_resourceType?clientId=clientId",
"/test_projectKey/test_resourceType?customerId=customerId",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.Get()
.WithResourceKey("resourceKey")
.WithAssociateId("associateId")
.Build(),
"Get",
"/test_projectKey/test_resourceType?resourceKey=resourceKey",
"/test_projectKey/test_resourceType?associateId=associateId",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.Get()
.WithSource("source")
.WithType("type")
.Build(),
"Get",
"/test_projectKey/test_resourceType?source=source",
"/test_projectKey/test_resourceType?type=type",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.Get()
.WithChanges("changes")
.WithResourceKey("resourceKey")
.Build(),
"Get",
"/test_projectKey/test_resourceType?changes=changes",
"/test_projectKey/test_resourceType?resourceKey=resourceKey",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.Get()
.WithStores("stores")
.WithSource("source")
.Build(),
"Get",
"/test_projectKey/test_resourceType?stores=stores",
"/test_projectKey/test_resourceType?source=source",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.Get()
.WithCustomerId("customerId")
.WithChanges("changes")
.Build(),
"Get",
"/test_projectKey/test_resourceType?customerId=customerId",
"/test_projectKey/test_resourceType?changes=changes",
},
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.WithResourceTypeValue("test_resourceType")
.Get()
.WithStores("stores")
.Build(),
"Get",
"/test_projectKey/test_resourceType?stores=stores",
},
new Object[] {
ApiRoot
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 ILineItemDraft

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
@@ -0,0 +1,14 @@
using commercetools.Base.CustomAttributes;

// ReSharper disable CheckNamespace
namespace commercetools.Sdk.Api.Models.Carts
{
[DeserializeAs(typeof(commercetools.Sdk.Api.Models.Carts.MethodExternalTaxRateDraft))]
public partial interface IMethodExternalTaxRateDraft
{
string ShippingMethodKey { get; set; }

IExternalTaxRateDraft TaxRate { get; set; }

}
}
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 @@ -31,6 +33,10 @@ public partial class LineItemDraft : ILineItemDraft

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
@@ -0,0 +1,10 @@
namespace commercetools.Sdk.Api.Models.Carts
{

public partial class MethodExternalTaxRateDraft : IMethodExternalTaxRateDraft
{
public string ShippingMethodKey { get; set; }

public IExternalTaxRateDraft TaxRate { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ namespace commercetools.Sdk.Api.Models.Messages
[SubTypeDiscriminator("QuoteCreated", typeof(commercetools.Sdk.Api.Models.Messages.QuoteCreatedMessage))]
[SubTypeDiscriminator("QuoteCustomerChanged", typeof(commercetools.Sdk.Api.Models.Messages.QuoteCustomerChangedMessage))]
[SubTypeDiscriminator("QuoteDeleted", typeof(commercetools.Sdk.Api.Models.Messages.QuoteDeletedMessage))]
[SubTypeDiscriminator("QuoteRenegotiationRequested", typeof(commercetools.Sdk.Api.Models.Messages.QuoteRenegotiationRequestedMessage))]
[SubTypeDiscriminator("QuoteRequestCreated", typeof(commercetools.Sdk.Api.Models.Messages.QuoteRequestCreatedMessage))]
[SubTypeDiscriminator("QuoteRequestCustomerChanged", typeof(commercetools.Sdk.Api.Models.Messages.QuoteRequestCustomerChangedMessage))]
[SubTypeDiscriminator("QuoteRequestDeleted", typeof(commercetools.Sdk.Api.Models.Messages.QuoteRequestDeletedMessage))]
Expand Down Expand Up @@ -995,6 +996,12 @@ static commercetools.Sdk.Api.Models.Messages.QuoteDeletedMessage QuoteDeleted(Ac
init?.Invoke(t);
return t;
}
static commercetools.Sdk.Api.Models.Messages.QuoteRenegotiationRequestedMessage QuoteRenegotiationRequested(Action<commercetools.Sdk.Api.Models.Messages.QuoteRenegotiationRequestedMessage> init = null)
{
var t = new commercetools.Sdk.Api.Models.Messages.QuoteRenegotiationRequestedMessage();
init?.Invoke(t);
return t;
}
static commercetools.Sdk.Api.Models.Messages.QuoteRequestCreatedMessage QuoteRequestCreated(Action<commercetools.Sdk.Api.Models.Messages.QuoteRequestCreatedMessage> init = null)
{
var t = new commercetools.Sdk.Api.Models.Messages.QuoteRequestCreatedMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ namespace commercetools.Sdk.Api.Models.Messages
[SubTypeDiscriminator("QuoteCreated", typeof(commercetools.Sdk.Api.Models.Messages.QuoteCreatedMessagePayload))]
[SubTypeDiscriminator("QuoteCustomerChanged", typeof(commercetools.Sdk.Api.Models.Messages.QuoteCustomerChangedMessagePayload))]
[SubTypeDiscriminator("QuoteDeleted", typeof(commercetools.Sdk.Api.Models.Messages.QuoteDeletedMessagePayload))]
[SubTypeDiscriminator("QuoteRenegotiationRequested", typeof(commercetools.Sdk.Api.Models.Messages.QuoteRenegotiationRequestedMessagePayload))]
[SubTypeDiscriminator("QuoteRequestCreated", typeof(commercetools.Sdk.Api.Models.Messages.QuoteRequestCreatedMessagePayload))]
[SubTypeDiscriminator("QuoteRequestCustomerChanged", typeof(commercetools.Sdk.Api.Models.Messages.QuoteRequestCustomerChangedMessagePayload))]
[SubTypeDiscriminator("QuoteRequestDeleted", typeof(commercetools.Sdk.Api.Models.Messages.QuoteRequestDeletedMessagePayload))]
Expand Down Expand Up @@ -975,6 +976,12 @@ static commercetools.Sdk.Api.Models.Messages.QuoteDeletedMessagePayload QuoteDel
init?.Invoke(t);
return t;
}
static commercetools.Sdk.Api.Models.Messages.QuoteRenegotiationRequestedMessagePayload QuoteRenegotiationRequested(Action<commercetools.Sdk.Api.Models.Messages.QuoteRenegotiationRequestedMessagePayload> init = null)
{
var t = new commercetools.Sdk.Api.Models.Messages.QuoteRenegotiationRequestedMessagePayload();
init?.Invoke(t);
return t;
}
static commercetools.Sdk.Api.Models.Messages.QuoteRequestCreatedMessagePayload QuoteRequestCreated(Action<commercetools.Sdk.Api.Models.Messages.QuoteRequestCreatedMessagePayload> init = null)
{
var t = new commercetools.Sdk.Api.Models.Messages.QuoteRequestCreatedMessagePayload();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using commercetools.Base.CustomAttributes;

// ReSharper disable CheckNamespace
namespace commercetools.Sdk.Api.Models.Messages
{
[DeserializeAs(typeof(commercetools.Sdk.Api.Models.Messages.QuoteRenegotiationRequestedMessage))]
public partial interface IQuoteRenegotiationRequestedMessage : IMessage
{
string BuyerComment { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using commercetools.Base.CustomAttributes;

// ReSharper disable CheckNamespace
namespace commercetools.Sdk.Api.Models.Messages
{
[DeserializeAs(typeof(commercetools.Sdk.Api.Models.Messages.QuoteRenegotiationRequestedMessagePayload))]
public partial interface IQuoteRenegotiationRequestedMessagePayload : IMessagePayload
{
string BuyerComment { get; set; }

}
}
Loading
Loading