com.aliyun.nlp_automl20191111.Client Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nlp_automl20191111 Show documentation
Show all versions of nlp_automl20191111 Show documentation
Alibaba Cloud nlp-automl (20191111) SDK for Java
The newest version!
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.nlp_automl20191111;
import com.aliyun.tea.*;
import com.aliyun.nlp_automl20191111.models.*;
public class Client extends com.aliyun.teaopenapi.Client {
public Client(com.aliyun.teaopenapi.models.Config config) throws Exception {
super(config);
this._endpointRule = "regional";
this.checkConfig(config);
this._endpoint = this.getEndpoint("nlp-automl", _regionId, _endpointRule, _network, _suffix, _endpointMap, _endpoint);
}
public String getEndpoint(String productId, String regionId, String endpointRule, String network, String suffix, java.util.Map endpointMap, String endpoint) throws Exception {
if (!com.aliyun.teautil.Common.empty(endpoint)) {
return endpoint;
}
if (!com.aliyun.teautil.Common.isUnset(endpointMap) && !com.aliyun.teautil.Common.empty(endpointMap.get(regionId))) {
return endpointMap.get(regionId);
}
return com.aliyun.endpointutil.Client.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
public CreateAsyncPredictResponse createAsyncPredictWithOptions(CreateAsyncPredictRequest request, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map body = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.content)) {
body.put("Content", request.content);
}
if (!com.aliyun.teautil.Common.isUnset(request.detailTag)) {
body.put("DetailTag", request.detailTag);
}
if (!com.aliyun.teautil.Common.isUnset(request.fetchContent)) {
body.put("FetchContent", request.fetchContent);
}
if (!com.aliyun.teautil.Common.isUnset(request.fileContent)) {
body.put("FileContent", request.fileContent);
}
if (!com.aliyun.teautil.Common.isUnset(request.fileType)) {
body.put("FileType", request.fileType);
}
if (!com.aliyun.teautil.Common.isUnset(request.fileUrl)) {
body.put("FileUrl", request.fileUrl);
}
if (!com.aliyun.teautil.Common.isUnset(request.modelId)) {
body.put("ModelId", request.modelId);
}
if (!com.aliyun.teautil.Common.isUnset(request.modelVersion)) {
body.put("ModelVersion", request.modelVersion);
}
if (!com.aliyun.teautil.Common.isUnset(request.serviceName)) {
body.put("ServiceName", request.serviceName);
}
if (!com.aliyun.teautil.Common.isUnset(request.serviceVersion)) {
body.put("ServiceVersion", request.serviceVersion);
}
if (!com.aliyun.teautil.Common.isUnset(request.topK)) {
body.put("TopK", request.topK);
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "CreateAsyncPredict"),
new TeaPair("version", "2019-11-11"),
new TeaPair("protocol", "HTTPS"),
new TeaPair("pathname", "/"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "RPC"),
new TeaPair("reqBodyType", "formData"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.callApi(params, req, runtime), new CreateAsyncPredictResponse());
}
public CreateAsyncPredictResponse createAsyncPredict(CreateAsyncPredictRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
return this.createAsyncPredictWithOptions(request, runtime);
}
public FindUserReport4AlinlpResponse findUserReport4AlinlpWithOptions(FindUserReport4AlinlpRequest request, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map body = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.beginTime)) {
body.put("BeginTime", request.beginTime);
}
if (!com.aliyun.teautil.Common.isUnset(request.customerUserParentId)) {
body.put("CustomerUserParentId", request.customerUserParentId);
}
if (!com.aliyun.teautil.Common.isUnset(request.endTime)) {
body.put("EndTime", request.endTime);
}
if (!com.aliyun.teautil.Common.isUnset(request.modelType)) {
body.put("ModelType", request.modelType);
}
if (!com.aliyun.teautil.Common.isUnset(request.type)) {
body.put("Type", request.type);
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "FindUserReport4Alinlp"),
new TeaPair("version", "2019-11-11"),
new TeaPair("protocol", "HTTPS"),
new TeaPair("pathname", "/"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "RPC"),
new TeaPair("reqBodyType", "formData"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.callApi(params, req, runtime), new FindUserReport4AlinlpResponse());
}
public FindUserReport4AlinlpResponse findUserReport4Alinlp(FindUserReport4AlinlpRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
return this.findUserReport4AlinlpWithOptions(request, runtime);
}
public GetAsyncPredictResponse getAsyncPredictWithOptions(GetAsyncPredictRequest request, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map query = com.aliyun.openapiutil.Client.query(com.aliyun.teautil.Common.toMap(request));
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("query", com.aliyun.openapiutil.Client.query(query))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "GetAsyncPredict"),
new TeaPair("version", "2019-11-11"),
new TeaPair("protocol", "HTTPS"),
new TeaPair("pathname", "/"),
new TeaPair("method", "GET"),
new TeaPair("authType", "AK"),
new TeaPair("style", "RPC"),
new TeaPair("reqBodyType", "formData"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.callApi(params, req, runtime), new GetAsyncPredictResponse());
}
public GetAsyncPredictResponse getAsyncPredict(GetAsyncPredictRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
return this.getAsyncPredictWithOptions(request, runtime);
}
public GetPredictResultResponse getPredictResultWithOptions(GetPredictResultRequest request, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map body = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.content)) {
body.put("Content", request.content);
}
if (!com.aliyun.teautil.Common.isUnset(request.detailTag)) {
body.put("DetailTag", request.detailTag);
}
if (!com.aliyun.teautil.Common.isUnset(request.modelId)) {
body.put("ModelId", request.modelId);
}
if (!com.aliyun.teautil.Common.isUnset(request.modelVersion)) {
body.put("ModelVersion", request.modelVersion);
}
if (!com.aliyun.teautil.Common.isUnset(request.topK)) {
body.put("TopK", request.topK);
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "GetPredictResult"),
new TeaPair("version", "2019-11-11"),
new TeaPair("protocol", "HTTPS"),
new TeaPair("pathname", "/"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "RPC"),
new TeaPair("reqBodyType", "formData"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.callApi(params, req, runtime), new GetPredictResultResponse());
}
public GetPredictResultResponse getPredictResult(GetPredictResultRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
return this.getPredictResultWithOptions(request, runtime);
}
public RunPreTrainServiceResponse runPreTrainServiceWithOptions(RunPreTrainServiceRequest request, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map body = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.predictContent)) {
body.put("PredictContent", request.predictContent);
}
if (!com.aliyun.teautil.Common.isUnset(request.serviceName)) {
body.put("ServiceName", request.serviceName);
}
if (!com.aliyun.teautil.Common.isUnset(request.serviceVersion)) {
body.put("ServiceVersion", request.serviceVersion);
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "RunPreTrainService"),
new TeaPair("version", "2019-11-11"),
new TeaPair("protocol", "HTTPS"),
new TeaPair("pathname", "/"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "RPC"),
new TeaPair("reqBodyType", "formData"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.callApi(params, req, runtime), new RunPreTrainServiceResponse());
}
public RunPreTrainServiceResponse runPreTrainService(RunPreTrainServiceRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
return this.runPreTrainServiceWithOptions(request, runtime);
}
public RunPreTrainServiceNewResponse runPreTrainServiceNewWithOptions(RunPreTrainServiceNewRequest request, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map body = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.predictContent)) {
body.put("PredictContent", request.predictContent);
}
if (!com.aliyun.teautil.Common.isUnset(request.serviceName)) {
body.put("ServiceName", request.serviceName);
}
if (!com.aliyun.teautil.Common.isUnset(request.serviceVersion)) {
body.put("ServiceVersion", request.serviceVersion);
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("body", com.aliyun.openapiutil.Client.parseToMap(body))
));
com.aliyun.teaopenapi.models.Params params = com.aliyun.teaopenapi.models.Params.build(TeaConverter.buildMap(
new TeaPair("action", "RunPreTrainServiceNew"),
new TeaPair("version", "2019-11-11"),
new TeaPair("protocol", "HTTPS"),
new TeaPair("pathname", "/"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "RPC"),
new TeaPair("reqBodyType", "formData"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.callApi(params, req, runtime), new RunPreTrainServiceNewResponse());
}
public RunPreTrainServiceNewResponse runPreTrainServiceNew(RunPreTrainServiceNewRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
return this.runPreTrainServiceNewWithOptions(request, runtime);
}
}