com.aliyun.dingtalkh5package_1_0.Client Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dingtalk Show documentation
Show all versions of dingtalk Show documentation
Alibaba Cloud dingtalk SDK for Java
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.dingtalkh5package_1_0;
import com.aliyun.tea.*;
import com.aliyun.dingtalkh5package_1_0.models.*;
public class Client extends com.aliyun.teaopenapi.Client {
public Client(com.aliyun.teaopenapi.models.Config config) throws Exception {
super(config);
com.aliyun.gateway.dingtalk.Client gatewayClient = new com.aliyun.gateway.dingtalk.Client();
this._spi = gatewayClient;
this._endpointRule = "";
if (com.aliyun.teautil.Common.empty(_endpoint)) {
this._endpoint = "api.dingtalk.com";
}
}
/**
* summary :
* 上传H5离线包
*
* @param request CreatePackageRequest
* @param headers CreatePackageHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return CreatePackageResponse
*/
public CreatePackageResponse createPackageWithOptions(CreatePackageRequest request, CreatePackageHeaders headers, 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.agentId)) {
body.put("agentId", request.agentId);
}
if (!com.aliyun.teautil.Common.isUnset(request.appId)) {
body.put("appId", request.appId);
}
if (!com.aliyun.teautil.Common.isUnset(request.homeUrl)) {
body.put("homeUrl", request.homeUrl);
}
if (!com.aliyun.teautil.Common.isUnset(request.ossObjectKey)) {
body.put("ossObjectKey", request.ossObjectKey);
}
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
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", "CreatePackage"),
new TeaPair("version", "h5package_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/h5package/asyncUpload"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new CreatePackageResponse());
}
/**
* summary :
* 上传H5离线包
*
* @param request CreatePackageRequest
* @return CreatePackageResponse
*/
public CreatePackageResponse createPackage(CreatePackageRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
CreatePackageHeaders headers = new CreatePackageHeaders();
return this.createPackageWithOptions(request, headers, runtime);
}
/**
* summary :
* 获取包上传一次性AccessToken
*
* @param request GetAccessTokenRequest
* @param headers GetAccessTokenHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return GetAccessTokenResponse
*/
public GetAccessTokenResponse getAccessTokenWithOptions(GetAccessTokenRequest request, GetAccessTokenHeaders headers, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map query = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.agentId)) {
query.put("agentId", request.agentId);
}
if (!com.aliyun.teautil.Common.isUnset(request.appId)) {
query.put("appId", request.appId);
}
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
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", "GetAccessToken"),
new TeaPair("version", "h5package_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/h5package/uploadTokens"),
new TeaPair("method", "GET"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new GetAccessTokenResponse());
}
/**
* summary :
* 获取包上传一次性AccessToken
*
* @param request GetAccessTokenRequest
* @return GetAccessTokenResponse
*/
public GetAccessTokenResponse getAccessToken(GetAccessTokenRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
GetAccessTokenHeaders headers = new GetAccessTokenHeaders();
return this.getAccessTokenWithOptions(request, headers, runtime);
}
/**
* summary :
* 获取H5离线包版本创建状态
*
* @param request GetCreateStatusRequest
* @param headers GetCreateStatusHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return GetCreateStatusResponse
*/
public GetCreateStatusResponse getCreateStatusWithOptions(GetCreateStatusRequest request, GetCreateStatusHeaders headers, com.aliyun.teautil.models.RuntimeOptions runtime) throws Exception {
com.aliyun.teautil.Common.validateModel(request);
java.util.Map query = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(request.taskId)) {
query.put("taskId", request.taskId);
}
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
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", "GetCreateStatus"),
new TeaPair("version", "h5package_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/h5package/uploadStatus"),
new TeaPair("method", "GET"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new GetCreateStatusResponse());
}
/**
* summary :
* 获取H5离线包版本创建状态
*
* @param request GetCreateStatusRequest
* @return GetCreateStatusResponse
*/
public GetCreateStatusResponse getCreateStatus(GetCreateStatusRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
GetCreateStatusHeaders headers = new GetCreateStatusHeaders();
return this.getCreateStatusWithOptions(request, headers, runtime);
}
/**
* summary :
* 发布离线包
*
* @param request PublishPackageRequest
* @param headers PublishPackageHeaders
* @param runtime runtime options for this request RuntimeOptions
* @return PublishPackageResponse
*/
public PublishPackageResponse publishPackageWithOptions(PublishPackageRequest request, PublishPackageHeaders headers, 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.agentId)) {
body.put("agentId", request.agentId);
}
if (!com.aliyun.teautil.Common.isUnset(request.appId)) {
body.put("appId", request.appId);
}
if (!com.aliyun.teautil.Common.isUnset(request.version)) {
body.put("version", request.version);
}
java.util.Map realHeaders = new java.util.HashMap<>();
if (!com.aliyun.teautil.Common.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!com.aliyun.teautil.Common.isUnset(headers.xAcsDingtalkAccessToken)) {
realHeaders.put("x-acs-dingtalk-access-token", com.aliyun.teautil.Common.toJSONString(headers.xAcsDingtalkAccessToken));
}
com.aliyun.teaopenapi.models.OpenApiRequest req = com.aliyun.teaopenapi.models.OpenApiRequest.build(TeaConverter.buildMap(
new TeaPair("headers", realHeaders),
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", "PublishPackage"),
new TeaPair("version", "h5package_1.0"),
new TeaPair("protocol", "HTTP"),
new TeaPair("pathname", "/v1.0/h5package/publish"),
new TeaPair("method", "POST"),
new TeaPair("authType", "AK"),
new TeaPair("style", "ROA"),
new TeaPair("reqBodyType", "none"),
new TeaPair("bodyType", "json")
));
return TeaModel.toModel(this.execute(params, req, runtime), new PublishPackageResponse());
}
/**
* summary :
* 发布离线包
*
* @param request PublishPackageRequest
* @return PublishPackageResponse
*/
public PublishPackageResponse publishPackage(PublishPackageRequest request) throws Exception {
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
PublishPackageHeaders headers = new PublishPackageHeaders();
return this.publishPackageWithOptions(request, headers, runtime);
}
}