Skip to content

Commit

Permalink
Update generated SDKs (#119)
Browse files Browse the repository at this point in the history
Co-authored-by: Auto Mation <[email protected]>
  • Loading branch information
github-actions[bot] and Auto Mation authored Jan 12, 2022
1 parent 87c1710 commit 38f5026
Show file tree
Hide file tree
Showing 117 changed files with 1,029 additions and 797 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System.Net.Http;
using Xunit;

namespace commercetools.ImportApi.Tests.Client.RequestBuilders.Inventories
namespace commercetools.Api.Tests.Client.RequestBuilders.Orders
{
public class ByProjectKeyInventoriesImportContainersByImportContainerKeyTest : RequestBuilderParentTests
public class ByProjectKeyOrdersSearchTest : RequestBuilderParentTests
{
[Theory]
[MemberData(nameof(GetData))]
Expand All @@ -20,14 +20,23 @@ public static IEnumerable<object[]> GetData()
return new List<object[]> {
new Object[] {
ApiRoot
.WithProjectKeyValue("test_projectKey")
.Inventories()
.ImportContainers()
.WithImportContainerKeyValue("test_importContainerKey")
.WithProjectKey("test_projectKey")
.Orders()
.Search()
.Post(null)
.Build(),
"Post",
"/test_projectKey/inventories/import-containers/test_importContainerKey",
"/test_projectKey/orders/search",
},
new Object[] {
ApiRoot
.WithProjectKey("test_projectKey")
.Orders()
.Search()
.Head()
.Build(),
"Head",
"/test_projectKey/orders/search",
}
};
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@ public ByProjectKeyOrdersByIDRequestBuilder WithId(string ID)
{
return new ByProjectKeyOrdersByIDRequestBuilder(ApiHttpClient, SerializerService, ProjectKey, ID);
}

public ByProjectKeyOrdersSearchRequestBuilder Search()
{
return new ByProjectKeyOrdersSearchRequestBuilder(ApiHttpClient, SerializerService, ProjectKey);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System.Net.Http;
using System.Threading.Tasks;
using System.Text.Json;
using commercetools.Base.Client;


namespace commercetools.Api.Client.RequestBuilders.Orders
{
public partial class ByProjectKeyOrdersSearchHead : ApiMethod<ByProjectKeyOrdersSearchHead>
{


private IClient ApiHttpClient { get; }

public override HttpMethod Method => HttpMethod.Head;

private string ProjectKey { get; }


public ByProjectKeyOrdersSearchHead(IClient apiHttpClient, string projectKey)
{
this.ApiHttpClient = apiHttpClient;
this.ProjectKey = projectKey;
this.RequestUrl = $"/{ProjectKey}/orders/search";
}




public async Task<JsonElement> ExecuteAsync()
{
var requestMessage = Build();
return await ApiHttpClient.ExecuteAsync<JsonElement>(requestMessage);
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using commercetools.Base.Client;
using commercetools.Base.Serialization;


namespace commercetools.Api.Client.RequestBuilders.Orders
{
public partial class ByProjectKeyOrdersSearchPost : ApiMethod<ByProjectKeyOrdersSearchPost>
{


private ISerializerService SerializerService { get; }

private IClient ApiHttpClient { get; }

public override HttpMethod Method => HttpMethod.Post;

private string ProjectKey { get; }

private commercetools.Api.Models.Orders.IOrderSearchRequest OrderSearchRequest;

public ByProjectKeyOrdersSearchPost(IClient apiHttpClient, ISerializerService serializerService, string projectKey, commercetools.Api.Models.Orders.IOrderSearchRequest orderSearchRequest)
{
this.ApiHttpClient = apiHttpClient;
this.SerializerService = serializerService;
this.ProjectKey = projectKey;
this.OrderSearchRequest = orderSearchRequest;
this.RequestUrl = $"/{ProjectKey}/orders/search";
}




public async Task<commercetools.Api.Models.Orders.IOrderPagedSearchResponse> ExecuteAsync()
{
var requestMessage = Build();
return await ApiHttpClient.ExecuteAsync<commercetools.Api.Models.Orders.IOrderPagedSearchResponse>(requestMessage);
}
public override HttpRequestMessage Build()
{
var request = base.Build();
if (SerializerService != null)
{
var body = this.SerializerService.Serialize(OrderSearchRequest);
if (!string.IsNullOrEmpty(body))
{
request.Content = new StringContent(body, Encoding.UTF8, "application/json");
}
}
return request;
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using commercetools.Base.Client;
using commercetools.Base.Serialization;

namespace commercetools.Api.Client.RequestBuilders.Orders
{

public class ByProjectKeyOrdersSearchRequestBuilder
{

private IClient ApiHttpClient { get; }

private ISerializerService SerializerService { get; }

private string ProjectKey { get; }

public ByProjectKeyOrdersSearchRequestBuilder(IClient apiHttpClient, ISerializerService serializerService, string projectKey)
{
this.ApiHttpClient = apiHttpClient;
this.SerializerService = serializerService;
this.ProjectKey = projectKey;
}

public ByProjectKeyOrdersSearchPost Post(commercetools.Api.Models.Orders.IOrderSearchRequest orderSearchRequest)
{
return new ByProjectKeyOrdersSearchPost(ApiHttpClient, SerializerService, ProjectKey, orderSearchRequest);
}

public ByProjectKeyOrdersSearchHead Head()
{
return new ByProjectKeyOrdersSearchHead(ApiHttpClient, ProjectKey);
}

}
}
Loading

0 comments on commit 38f5026

Please sign in to comment.