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 Feb 18, 2021
1 parent 3802ecb commit 68e2283
Show file tree
Hide file tree
Showing 144 changed files with 3,729 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=bca95352454183c812bbfdf11183a5f237f6fdff
hash=94c76cdcbfae7688755b30c1f97f9c82bdd9cf86
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hash=bca95352454183c812bbfdf11183a5f237f6fdff
hash=94c76cdcbfae7688755b30c1f97f9c82bdd9cf86
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Text.Json;
using commercetools.Base.Client;
using commercetools.Base.Serialization;


namespace commercetools.MLApi.Client.RequestBuilders.ImageSearch
{
public partial class ByProjectKeyImageSearchConfigGet : ApiMethod<ByProjectKeyImageSearchConfigGet> {


private IClient ApiHttpClient { get; }

public override HttpMethod Method => HttpMethod.Get;

private string ProjectKey { get; }


public ByProjectKeyImageSearchConfigGet(IClient apiHttpClient, string projectKey) {
this.ApiHttpClient = apiHttpClient;
this.ProjectKey = projectKey;
this.RequestUrl = $"/{ProjectKey}/image-search/config";
}



public async Task<commercetools.MLApi.Models.ImageSearchConfigs.ImageSearchConfigResponse> ExecuteAsync()
{
var requestMessage = Build();
return await ApiHttpClient.ExecuteAsync<commercetools.MLApi.Models.ImageSearchConfigs.ImageSearchConfigResponse>(requestMessage);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Text.Json;
using commercetools.Base.Client;
using commercetools.Base.Serialization;


namespace commercetools.MLApi.Client.RequestBuilders.ImageSearch
{
public partial class ByProjectKeyImageSearchConfigPost : ApiMethod<ByProjectKeyImageSearchConfigPost> {


private ISerializerService SerializerService { get; }

private IClient ApiHttpClient { get; }

public override HttpMethod Method => HttpMethod.Post;

private string ProjectKey { get; }

private commercetools.MLApi.Models.ImageSearchConfigs.IImageSearchConfigRequest ImageSearchConfigRequest;

public ByProjectKeyImageSearchConfigPost(IClient apiHttpClient, ISerializerService serializerService, string projectKey, commercetools.MLApi.Models.ImageSearchConfigs.IImageSearchConfigRequest imageSearchConfigRequest) {
this.ApiHttpClient = apiHttpClient;
this.SerializerService = serializerService;
this.ProjectKey = projectKey;
this.ImageSearchConfigRequest = imageSearchConfigRequest;
this.RequestUrl = $"/{ProjectKey}/image-search/config";
}



public async Task<commercetools.MLApi.Models.ImageSearchConfigs.ImageSearchConfigResponse> ExecuteAsync()
{
var requestMessage = Build();
return await ApiHttpClient.ExecuteAsync<commercetools.MLApi.Models.ImageSearchConfigs.ImageSearchConfigResponse>(requestMessage);
}

public override HttpRequestMessage Build()
{
var request = base.Build();
if (SerializerService != null)
{
var body = this.SerializerService.Serialize(ImageSearchConfigRequest);
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,31 @@
using System.IO;
using System.Text.Json;
using commercetools.Base.Client;
using commercetools.Base.Serialization;

namespace commercetools.MLApi.Client.RequestBuilders.ImageSearch
{
public class ByProjectKeyImageSearchConfigRequestBuilder {

private IClient ApiHttpClient { get; }

private ISerializerService SerializerService { get; }

private string ProjectKey { get; }

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

public ByProjectKeyImageSearchConfigGet Get() {
return new ByProjectKeyImageSearchConfigGet(ApiHttpClient, ProjectKey);
}

public ByProjectKeyImageSearchConfigPost Post(commercetools.MLApi.Models.ImageSearchConfigs.IImageSearchConfigRequest imageSearchConfigRequest) {
return new ByProjectKeyImageSearchConfigPost(ApiHttpClient, SerializerService, ProjectKey, imageSearchConfigRequest);
}

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


namespace commercetools.MLApi.Client.RequestBuilders.ImageSearch
{
public partial class ByProjectKeyImageSearchPost : ApiMethod<ByProjectKeyImageSearchPost> {


private ISerializerService SerializerService { get; }

private IClient ApiHttpClient { get; }

public override HttpMethod Method => HttpMethod.Post;

private string ProjectKey { get; }

private Stream Stream;

public ByProjectKeyImageSearchPost(IClient apiHttpClient, ISerializerService serializerService, string projectKey, Stream stream) {
this.ApiHttpClient = apiHttpClient;
this.SerializerService = serializerService;
this.ProjectKey = projectKey;
this.Stream = stream;
this.RequestUrl = $"/{ProjectKey}/image-search";
}

public List<string> GetLimit() {
return this.GetQueryParam("limit");
}

public List<string> GetOffset() {
return this.GetQueryParam("offset");
}

public ByProjectKeyImageSearchPost WithLimit(int limit){
return this.AddQueryParam("limit", limit.ToString());
}

public ByProjectKeyImageSearchPost WithOffset(int offset){
return this.AddQueryParam("offset", offset.ToString());
}

public async Task<commercetools.MLApi.Models.ImageSearches.ImageSearchResponse> ExecuteAsync()
{
var requestMessage = Build();
return await ApiHttpClient.ExecuteAsync<commercetools.MLApi.Models.ImageSearches.ImageSearchResponse>(requestMessage);
}

public override HttpRequestMessage Build()
{
var request = base.Build();
if (Stream != null && Stream.Length > 0)
{
request.Content = new StreamContent(Stream);
}
return request;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.IO;
using System.Text.Json;
using commercetools.Base.Client;
using commercetools.Base.Serialization;
using commercetools.MLApi.Client.RequestBuilders.ImageSearch;

namespace commercetools.MLApi.Client.RequestBuilders.ImageSearch
{
public class ByProjectKeyImageSearchRequestBuilder {

private IClient ApiHttpClient { get; }

private ISerializerService SerializerService { get; }

private string ProjectKey { get; }

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

public ByProjectKeyImageSearchPost Post(Stream stream) {
return new ByProjectKeyImageSearchPost(ApiHttpClient, SerializerService, ProjectKey, stream);
}

public ByProjectKeyImageSearchConfigRequestBuilder Config() {
return new ByProjectKeyImageSearchConfigRequestBuilder(ApiHttpClient, SerializerService, ProjectKey);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Text.Json;
using commercetools.Base.Client;
using commercetools.Base.Serialization;


namespace commercetools.MLApi.Client.RequestBuilders.MissingData
{
public partial class ByProjectKeyMissingDataAttributesPost : ApiMethod<ByProjectKeyMissingDataAttributesPost> {


private ISerializerService SerializerService { get; }

private IClient ApiHttpClient { get; }

public override HttpMethod Method => HttpMethod.Post;

private string ProjectKey { get; }

private commercetools.MLApi.Models.MissingData.IMissingAttributesSearchRequest MissingAttributesSearchRequest;

public ByProjectKeyMissingDataAttributesPost(IClient apiHttpClient, ISerializerService serializerService, string projectKey, commercetools.MLApi.Models.MissingData.IMissingAttributesSearchRequest missingAttributesSearchRequest) {
this.ApiHttpClient = apiHttpClient;
this.SerializerService = serializerService;
this.ProjectKey = projectKey;
this.MissingAttributesSearchRequest = missingAttributesSearchRequest;
this.RequestUrl = $"/{ProjectKey}/missing-data/attributes";
}



public async Task<commercetools.MLApi.Models.Common.TaskToken> ExecuteAsync()
{
var requestMessage = Build();
return await ApiHttpClient.ExecuteAsync<commercetools.MLApi.Models.Common.TaskToken>(requestMessage);
}

public override HttpRequestMessage Build()
{
var request = base.Build();
if (SerializerService != null)
{
var body = this.SerializerService.Serialize(MissingAttributesSearchRequest);
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,31 @@
using System.IO;
using System.Text.Json;
using commercetools.Base.Client;
using commercetools.Base.Serialization;
using commercetools.MLApi.Client.RequestBuilders.MissingData;

namespace commercetools.MLApi.Client.RequestBuilders.MissingData
{
public class ByProjectKeyMissingDataAttributesRequestBuilder {

private IClient ApiHttpClient { get; }

private ISerializerService SerializerService { get; }

private string ProjectKey { get; }

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

public ByProjectKeyMissingDataAttributesPost Post(commercetools.MLApi.Models.MissingData.IMissingAttributesSearchRequest missingAttributesSearchRequest) {
return new ByProjectKeyMissingDataAttributesPost(ApiHttpClient, SerializerService, ProjectKey, missingAttributesSearchRequest);
}

public ByProjectKeyMissingDataAttributesStatusRequestBuilder Status() {
return new ByProjectKeyMissingDataAttributesStatusRequestBuilder(ApiHttpClient, SerializerService, ProjectKey);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Text.Json;
using commercetools.Base.Client;
using commercetools.Base.Serialization;


namespace commercetools.MLApi.Client.RequestBuilders.MissingData
{
public partial class ByProjectKeyMissingDataAttributesStatusByTaskIdGet : ApiMethod<ByProjectKeyMissingDataAttributesStatusByTaskIdGet> {


private IClient ApiHttpClient { get; }

public override HttpMethod Method => HttpMethod.Get;

private string ProjectKey { get; }

private string TaskId { get; }


public ByProjectKeyMissingDataAttributesStatusByTaskIdGet(IClient apiHttpClient, string projectKey, string taskId) {
this.ApiHttpClient = apiHttpClient;
this.ProjectKey = projectKey;
this.TaskId = taskId;
this.RequestUrl = $"/{ProjectKey}/missing-data/attributes/status/{TaskId}";
}



public async Task<commercetools.MLApi.Models.MissingData.MissingDataTaskStatus> ExecuteAsync()
{
var requestMessage = Build();
return await ApiHttpClient.ExecuteAsync<commercetools.MLApi.Models.MissingData.MissingDataTaskStatus>(requestMessage);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.IO;
using System.Text.Json;
using commercetools.Base.Client;
using commercetools.Base.Serialization;

namespace commercetools.MLApi.Client.RequestBuilders.MissingData
{
public class ByProjectKeyMissingDataAttributesStatusByTaskIdRequestBuilder {

private IClient ApiHttpClient { get; }

private ISerializerService SerializerService { get; }

private string ProjectKey { get; }

private string TaskId { get; }

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

public ByProjectKeyMissingDataAttributesStatusByTaskIdGet Get() {
return new ByProjectKeyMissingDataAttributesStatusByTaskIdGet(ApiHttpClient, ProjectKey, TaskId);
}

}
}
Loading

0 comments on commit 68e2283

Please sign in to comment.