Skip to content

Commit

Permalink
update ML SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Nov 3, 2020
1 parent fcdf09b commit 2dc7f40
Show file tree
Hide file tree
Showing 168 changed files with 761 additions and 545 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.nio.file.Files;

import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -21,6 +22,8 @@
import io.vrap.rmf.base.client.*;


import static io.vrap.rmf.base.client.utils.ClientUtils.blockingWait;

/**
* <p>Get the current image search config.</p>
*/
Expand Down Expand Up @@ -59,21 +62,15 @@ public ApiHttpRequest createHttpRequest() {
}

public ApiHttpResponse<com.commercetools.ml.models.image_search_config.ImageSearchConfigResponse> executeBlocking(){
try {
return execute().get();
} catch (Exception e) {
throw new RuntimeException(e);
}
return executeBlocking(Duration.ofSeconds(60));
}

public ApiHttpResponse<com.commercetools.ml.models.image_search_config.ImageSearchConfigResponse> executeBlocking(Duration timeout){
return blockingWait(execute(), timeout);
}

public CompletableFuture<ApiHttpResponse<com.commercetools.ml.models.image_search_config.ImageSearchConfigResponse>> execute(){
return apiHttpClient().execute(this.createHttpRequest())
.thenApply(response -> {
if(response.getStatusCode() >= 400){
throw new ApiHttpException(response.getStatusCode(), new String(response.getBody()), response.getHeaders());
}
return Utils.convertResponse(response,com.commercetools.ml.models.image_search_config.ImageSearchConfigResponse.class);
});
return apiHttpClient().execute(this.createHttpRequest(), com.commercetools.ml.models.image_search_config.ImageSearchConfigResponse.class);
}

public String getProjectKey() {return this.projectKey;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.nio.file.Files;

import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -21,6 +22,8 @@
import io.vrap.rmf.base.client.*;


import static io.vrap.rmf.base.client.utils.ClientUtils.blockingWait;

/**
* <p>Endpoint to update the image search config.</p>
*/
Expand Down Expand Up @@ -57,26 +60,20 @@ public ApiHttpRequest createHttpRequest() {
httpRequest.setUri(httpRequestPath);
httpRequest.setMethod(ApiHttpMethod.POST);
httpRequest.setHeaders(getHeaders());
try{httpRequest.setBody(VrapJsonUtils.toJsonByteArray(imageSearchConfigRequest));}catch(Exception e){e.printStackTrace();}
try{httpRequest.setBody(apiHttpClient().getSerializerService().toJsonByteArray(imageSearchConfigRequest));}catch(Exception e){e.printStackTrace();}
return httpRequest;
}

public ApiHttpResponse<com.commercetools.ml.models.image_search_config.ImageSearchConfigResponse> executeBlocking(){
try {
return execute().get();
} catch (Exception e) {
throw new RuntimeException(e);
}
return executeBlocking(Duration.ofSeconds(60));
}

public ApiHttpResponse<com.commercetools.ml.models.image_search_config.ImageSearchConfigResponse> executeBlocking(Duration timeout){
return blockingWait(execute(), timeout);
}

public CompletableFuture<ApiHttpResponse<com.commercetools.ml.models.image_search_config.ImageSearchConfigResponse>> execute(){
return apiHttpClient().execute(this.createHttpRequest())
.thenApply(response -> {
if(response.getStatusCode() >= 400){
throw new ApiHttpException(response.getStatusCode(), new String(response.getBody()), response.getHeaders());
}
return Utils.convertResponse(response,com.commercetools.ml.models.image_search_config.ImageSearchConfigResponse.class);
});
return apiHttpClient().execute(this.createHttpRequest(), com.commercetools.ml.models.image_search_config.ImageSearchConfigResponse.class);
}

public String getProjectKey() {return this.projectKey;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.nio.file.Files;

import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -21,6 +22,8 @@
import io.vrap.rmf.base.client.*;


import static io.vrap.rmf.base.client.utils.ClientUtils.blockingWait;

/**
* <p>Accepts an image file and returns similar products from product catalogue.</p>
*/
Expand Down Expand Up @@ -62,21 +65,15 @@ public ApiHttpRequest createHttpRequest() {
}

public ApiHttpResponse<com.commercetools.ml.models.image_search.ImageSearchResponse> executeBlocking(){
try {
return execute().get();
} catch (Exception e) {
throw new RuntimeException(e);
}
return executeBlocking(Duration.ofSeconds(60));
}

public ApiHttpResponse<com.commercetools.ml.models.image_search.ImageSearchResponse> executeBlocking(Duration timeout){
return blockingWait(execute(), timeout);
}

public CompletableFuture<ApiHttpResponse<com.commercetools.ml.models.image_search.ImageSearchResponse>> execute(){
return apiHttpClient().execute(this.createHttpRequest())
.thenApply(response -> {
if(response.getStatusCode() >= 400){
throw new ApiHttpException(response.getStatusCode(), new String(response.getBody()), response.getHeaders());
}
return Utils.convertResponse(response,com.commercetools.ml.models.image_search.ImageSearchResponse.class);
});
return apiHttpClient().execute(this.createHttpRequest(), com.commercetools.ml.models.image_search.ImageSearchResponse.class);
}

public String getProjectKey() {return this.projectKey;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.nio.file.Files;

import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -21,6 +22,8 @@
import io.vrap.rmf.base.client.*;


import static io.vrap.rmf.base.client.utils.ClientUtils.blockingWait;

@Generated(
value = "io.vrap.rmf.codegen.rendring.CoreCodeGenerator",
comments = "https://github.com/vrapio/rmf-codegen"
Expand Down Expand Up @@ -54,26 +57,20 @@ public ApiHttpRequest createHttpRequest() {
httpRequest.setUri(httpRequestPath);
httpRequest.setMethod(ApiHttpMethod.POST);
httpRequest.setHeaders(getHeaders());
try{httpRequest.setBody(VrapJsonUtils.toJsonByteArray(missingAttributesSearchRequest));}catch(Exception e){e.printStackTrace();}
try{httpRequest.setBody(apiHttpClient().getSerializerService().toJsonByteArray(missingAttributesSearchRequest));}catch(Exception e){e.printStackTrace();}
return httpRequest;
}

public ApiHttpResponse<com.commercetools.ml.models.common.TaskToken> executeBlocking(){
try {
return execute().get();
} catch (Exception e) {
throw new RuntimeException(e);
}
return executeBlocking(Duration.ofSeconds(60));
}

public ApiHttpResponse<com.commercetools.ml.models.common.TaskToken> executeBlocking(Duration timeout){
return blockingWait(execute(), timeout);
}

public CompletableFuture<ApiHttpResponse<com.commercetools.ml.models.common.TaskToken>> execute(){
return apiHttpClient().execute(this.createHttpRequest())
.thenApply(response -> {
if(response.getStatusCode() >= 400){
throw new ApiHttpException(response.getStatusCode(), new String(response.getBody()), response.getHeaders());
}
return Utils.convertResponse(response,com.commercetools.ml.models.common.TaskToken.class);
});
return apiHttpClient().execute(this.createHttpRequest(), com.commercetools.ml.models.common.TaskToken.class);
}

public String getProjectKey() {return this.projectKey;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.nio.file.Files;

import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -21,6 +22,8 @@
import io.vrap.rmf.base.client.*;


import static io.vrap.rmf.base.client.utils.ClientUtils.blockingWait;

@Generated(
value = "io.vrap.rmf.codegen.rendring.CoreCodeGenerator",
comments = "https://github.com/vrapio/rmf-codegen"
Expand Down Expand Up @@ -59,21 +62,15 @@ public ApiHttpRequest createHttpRequest() {
}

public ApiHttpResponse<com.commercetools.ml.models.missing_data.MissingDataTaskStatus> executeBlocking(){
try {
return execute().get();
} catch (Exception e) {
throw new RuntimeException(e);
}
return executeBlocking(Duration.ofSeconds(60));
}

public ApiHttpResponse<com.commercetools.ml.models.missing_data.MissingDataTaskStatus> executeBlocking(Duration timeout){
return blockingWait(execute(), timeout);
}

public CompletableFuture<ApiHttpResponse<com.commercetools.ml.models.missing_data.MissingDataTaskStatus>> execute(){
return apiHttpClient().execute(this.createHttpRequest())
.thenApply(response -> {
if(response.getStatusCode() >= 400){
throw new ApiHttpException(response.getStatusCode(), new String(response.getBody()), response.getHeaders());
}
return Utils.convertResponse(response,com.commercetools.ml.models.missing_data.MissingDataTaskStatus.class);
});
return apiHttpClient().execute(this.createHttpRequest(), com.commercetools.ml.models.missing_data.MissingDataTaskStatus.class);
}

public String getProjectKey() {return this.projectKey;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.nio.file.Files;

import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -21,6 +22,8 @@
import io.vrap.rmf.base.client.*;


import static io.vrap.rmf.base.client.utils.ClientUtils.blockingWait;

@Generated(
value = "io.vrap.rmf.codegen.rendring.CoreCodeGenerator",
comments = "https://github.com/vrapio/rmf-codegen"
Expand Down Expand Up @@ -54,26 +57,20 @@ public ApiHttpRequest createHttpRequest() {
httpRequest.setUri(httpRequestPath);
httpRequest.setMethod(ApiHttpMethod.POST);
httpRequest.setHeaders(getHeaders());
try{httpRequest.setBody(VrapJsonUtils.toJsonByteArray(missingImagesSearchRequest));}catch(Exception e){e.printStackTrace();}
try{httpRequest.setBody(apiHttpClient().getSerializerService().toJsonByteArray(missingImagesSearchRequest));}catch(Exception e){e.printStackTrace();}
return httpRequest;
}

public ApiHttpResponse<com.commercetools.ml.models.common.TaskToken> executeBlocking(){
try {
return execute().get();
} catch (Exception e) {
throw new RuntimeException(e);
}
return executeBlocking(Duration.ofSeconds(60));
}

public ApiHttpResponse<com.commercetools.ml.models.common.TaskToken> executeBlocking(Duration timeout){
return blockingWait(execute(), timeout);
}

public CompletableFuture<ApiHttpResponse<com.commercetools.ml.models.common.TaskToken>> execute(){
return apiHttpClient().execute(this.createHttpRequest())
.thenApply(response -> {
if(response.getStatusCode() >= 400){
throw new ApiHttpException(response.getStatusCode(), new String(response.getBody()), response.getHeaders());
}
return Utils.convertResponse(response,com.commercetools.ml.models.common.TaskToken.class);
});
return apiHttpClient().execute(this.createHttpRequest(), com.commercetools.ml.models.common.TaskToken.class);
}

public String getProjectKey() {return this.projectKey;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.nio.file.Files;

import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -21,6 +22,8 @@
import io.vrap.rmf.base.client.*;


import static io.vrap.rmf.base.client.utils.ClientUtils.blockingWait;

@Generated(
value = "io.vrap.rmf.codegen.rendring.CoreCodeGenerator",
comments = "https://github.com/vrapio/rmf-codegen"
Expand Down Expand Up @@ -59,21 +62,15 @@ public ApiHttpRequest createHttpRequest() {
}

public ApiHttpResponse<com.commercetools.ml.models.missing_data.MissingImagesTaskStatus> executeBlocking(){
try {
return execute().get();
} catch (Exception e) {
throw new RuntimeException(e);
}
return executeBlocking(Duration.ofSeconds(60));
}

public ApiHttpResponse<com.commercetools.ml.models.missing_data.MissingImagesTaskStatus> executeBlocking(Duration timeout){
return blockingWait(execute(), timeout);
}

public CompletableFuture<ApiHttpResponse<com.commercetools.ml.models.missing_data.MissingImagesTaskStatus>> execute(){
return apiHttpClient().execute(this.createHttpRequest())
.thenApply(response -> {
if(response.getStatusCode() >= 400){
throw new ApiHttpException(response.getStatusCode(), new String(response.getBody()), response.getHeaders());
}
return Utils.convertResponse(response,com.commercetools.ml.models.missing_data.MissingImagesTaskStatus.class);
});
return apiHttpClient().execute(this.createHttpRequest(), com.commercetools.ml.models.missing_data.MissingImagesTaskStatus.class);
}

public String getProjectKey() {return this.projectKey;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.nio.file.Files;

import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -21,6 +22,8 @@
import io.vrap.rmf.base.client.*;


import static io.vrap.rmf.base.client.utils.ClientUtils.blockingWait;

@Generated(
value = "io.vrap.rmf.codegen.rendring.CoreCodeGenerator",
comments = "https://github.com/vrapio/rmf-codegen"
Expand Down Expand Up @@ -54,26 +57,20 @@ public ApiHttpRequest createHttpRequest() {
httpRequest.setUri(httpRequestPath);
httpRequest.setMethod(ApiHttpMethod.POST);
httpRequest.setHeaders(getHeaders());
try{httpRequest.setBody(VrapJsonUtils.toJsonByteArray(missingPricesSearchRequest));}catch(Exception e){e.printStackTrace();}
try{httpRequest.setBody(apiHttpClient().getSerializerService().toJsonByteArray(missingPricesSearchRequest));}catch(Exception e){e.printStackTrace();}
return httpRequest;
}

public ApiHttpResponse<com.commercetools.ml.models.common.TaskToken> executeBlocking(){
try {
return execute().get();
} catch (Exception e) {
throw new RuntimeException(e);
}
return executeBlocking(Duration.ofSeconds(60));
}

public ApiHttpResponse<com.commercetools.ml.models.common.TaskToken> executeBlocking(Duration timeout){
return blockingWait(execute(), timeout);
}

public CompletableFuture<ApiHttpResponse<com.commercetools.ml.models.common.TaskToken>> execute(){
return apiHttpClient().execute(this.createHttpRequest())
.thenApply(response -> {
if(response.getStatusCode() >= 400){
throw new ApiHttpException(response.getStatusCode(), new String(response.getBody()), response.getHeaders());
}
return Utils.convertResponse(response,com.commercetools.ml.models.common.TaskToken.class);
});
return apiHttpClient().execute(this.createHttpRequest(), com.commercetools.ml.models.common.TaskToken.class);
}

public String getProjectKey() {return this.projectKey;}
Expand Down
Loading

0 comments on commit 2dc7f40

Please sign in to comment.