diff --git a/README.md b/README.md
new file mode 100644
index 000000000..c755bebc1
--- /dev/null
+++ b/README.md
@@ -0,0 +1,161 @@
+![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)
+
+# YuanJing OpenAPI SDK for Java
+
+## Requirements
+
+Building the API client library requires:
+1. Java 1.7+
+2. Maven
+
+## Installation
+
+### Maven users
+
+Add this dependency to your project's POM:
+
+```xml
+
+ com.alibaba
+ alibabacloud-yjopenapi-java-client
+ 1.1.20241024
+
+
+or
+
+
+ com.alibaba
+ alibabacloud-yjopenapi-java-client
+ 1.1.20241024
+ shaded
+
+
+ *
+ *
+
+
+
+```
+
+## Usage
+
+```java
+import com.alibaba.yjopenapi.client.api.*;
+import com.alibaba.yjopenapi.client.model.*;
+
+Configuration configuration = Configuration.getDefaultConfiguration();
+configuration
+ .host("host")
+ .accessKey("Your Access Key")
+ .secretKey("Your Secret Key");
+
+try {
+ // {{Api}},{{Method}},{{Param}},{{Result}} is placeholder, take a look at Explain Of Usage Placeholder
+ {{Api}} api = new {{Api}}(new ApiClient(), configuration);
+ // OpenAPI result
+ {{Result}} result = api.{{Method}}({{Param}});
+
+ // OpenAPI result with header
+ ApiResponse<{{Result}}> tripleWithHttpInfo = api. {{Method}}WithHttpInfo();
+ result = tripleWithHttpInfo.getData();
+ // OpenAPI TraceId
+ String traceId = tripleWithHttpInfo.getHeaders().get(ApiClient.Trace_Id).get(0);
+ // OpenAPI Status Code
+ String resultStatus = tripleWithHttpInfo.getHeaders().get(ApiClient.Result_Status).get(0);
+
+} catch (ApiException e) {
+ // handle exception
+}
+```
+
+## Explain Of Usage Placeholder
+
+| Api | Method | Params | Result | Description |
+| ------------ | ------------- | ------------- | ------------- | ------------- |
+ | *AdaptApi* | **createAndSubmitAll** | *createAndSubmitAllForms* | *AdaptCreateAndSubmitAllResult* | createAndSubmitAll |
+ | *AdaptApi* | **queryRequestById** | *queryRequestByIdForms* | *AdaptQueryRequestByIdResult* | queryRequestById |
+ | *AiApi* | **batchUpdateKbVersion** | *batchUpdateKbVersionForms* | *AiBatchUpdateKbVersionResult* | |
+ | *AiApi* | **cancelQueue** | *cancelQueueForms* | *AiCancelQueueResult* | 取消排队 |
+ | *AiApi* | **createNpcRole** | *createNpcRoleForms* | *AiCreateNpcRoleResult* | |
+ | *AiApi* | **deleteModels** | *deleteModelsForms* | *AiDeleteModelsResult* | 删除私有模型 |
+ | *AiApi* | **getQueue** | *getQueueForms* | *AiGetQueueResult* | 查询排队 |
+ | *AiApi* | **listModels** | *listModelsForms* | *AiListModelsResult* | 查看私有模型列表 |
+ | *AiApi* | **updateModels** | *updateModelsForms* | *AiUpdateModelsResult* | 修改私有模型信息 |
+ | *AiApi* | **updateNpcRole** | *updateNpcRoleForms* | *AiUpdateNpcRoleResult* | |
+ | *AiApi* | **uploadModels** | *uploadModelsForms* | *AiUploadModelsResult* | 上传私有模型 |
+ | *ConsoleAdminApi* | **activateDeployment** | *activateDeploymentForms* | *ConsoleAdminActivateDeploymentResult* | |
+ | *ConsoleAdminApi* | **adaptGameVersion** | *adaptGameVersionForms* | *ConsoleAdminAdaptGameVersionResult* | |
+ | *ConsoleAdminApi* | **addGameToProject** | *addGameToProjectForms* | *ConsoleAdminAddGameToProjectResult* | |
+ | *ConsoleAdminApi* | **batchUpdateDispatchConfig** | *batchUpdateDispatchConfigForms* | *ConsoleAdminBatchUpdateDispatchConfigResult* | 批量更新游戏各自调度配置 |
+ | *ConsoleAdminApi* | **createGame** | *createGameForms* | *ConsoleAdminCreateGameResult* | |
+ | *ConsoleAdminApi* | **createOrder** | *createOrderForms* | *ConsoleAdminCreateOrderResult* | 订单下单 |
+ | *ConsoleAdminApi* | **createProject** | *createProjectForms* | *ConsoleAdminCreateProjectResult* | |
+ | *ConsoleAdminApi* | **deleteGame** | *deleteGameForms* | *ConsoleAdminDeleteGameResult* | |
+ | *ConsoleAdminApi* | **deleteGameVersion** | *deleteGameVersionForms* | *ConsoleAdminDeleteGameVersionResult* | |
+ | *ConsoleAdminApi* | **deleteProject** | *deleteProjectForms* | *ConsoleAdminDeleteProjectResult* | |
+ | *ConsoleAdminApi* | **getBillFlowInfo** | *getBillFlowInfoForms* | *ConsoleAdminGetBillFlowInfoResult* | |
+ | *ConsoleAdminApi* | **getGameInstanceContainerRatio** | *getGameInstanceContainerRatioForms* | *ConsoleAdminGetGameInstanceContainerRatioResult* | |
+ | *ConsoleAdminApi* | **getGameRecommendedInstance** | *getGameRecommendedInstanceForms* | *ConsoleAdminGetGameRecommendedInstanceResult* | |
+ | *ConsoleAdminApi* | **getGameVersion** | *getGameVersionForms* | *ConsoleAdminGetGameVersionResult* | |
+ | *ConsoleAdminApi* | **getGameVersionProgress** | *getGameVersionProgressForms* | *ConsoleAdminGetGameVersionProgressResult* | |
+ | *ConsoleAdminApi* | **getOrder** | *getOrderForms* | *ConsoleAdminGetOrderResult* | 查询订单 |
+ | *ConsoleAdminApi* | **listActivateableInstances** | *listActivateableInstancesForms* | *ConsoleAdminListActivateableInstancesResult* | |
+ | *ConsoleAdminApi* | **listActivatedInstances** | *listActivatedInstancesForms* | *ConsoleAdminListActivatedInstancesResult* | |
+ | *ConsoleAdminApi* | **listControllersOfGame** | *listControllersOfGameForms* | *ConsoleAdminListControllersOfGameResult* | |
+ | *ConsoleAdminApi* | **listDeployableInstances** | *listDeployableInstancesForms* | *ConsoleAdminListDeployableInstancesResult* | |
+ | *ConsoleAdminApi* | **listGameCcu** | *listGameCcuForms* | *ConsoleAdminListGameCcuResult* | 分游戏实时并发 |
+ | *ConsoleAdminApi* | **listGameDeployDetailsOfProject** | *listGameDeployDetailsOfProjectForms* | *ConsoleAdminListGameDeployDetailsOfProjectResult* | 获取项目下游戏部署版本信息。 |
+ | *ConsoleAdminApi* | **listGameVersions** | *listGameVersionsForms* | *ConsoleAdminListGameVersionsResult* | |
+ | *ConsoleAdminApi* | **listGames** | *listGamesForms* | *ConsoleAdminListGamesResult* | |
+ | *ConsoleAdminApi* | **listInstancesOfProject** | *listInstancesOfProjectForms* | *ConsoleAdminListInstancesOfProjectResult* | 分页获取项目中的实例 |
+ | *ConsoleAdminApi* | **listMonthBill** | *listMonthBillForms* | *ConsoleAdminListMonthBillResult* | 月度账单列表 |
+ | *ConsoleAdminApi* | **listProjects** | *listProjectsForms* | *ConsoleAdminListProjectsResult* | |
+ | *ConsoleAdminApi* | **listVersionDeployInstances** | *listVersionDeployInstancesForms* | *ConsoleAdminListVersionDeployInstancesResult* | 获取项目下游戏版本的部署实例信息。 |
+ | *ConsoleAdminApi* | **queryAdaptResultByVersionId** | *queryAdaptResultByVersionIdForms* | *ConsoleAdminQueryAdaptResultByVersionIdResult* | 查询适配结果 |
+ | *ConsoleAdminApi* | **recommendSpecification** | *recommendSpecificationForms* | *ConsoleAdminRecommendSpecificationResult* | |
+ | *ConsoleAdminApi* | **removeGameFromProject** | *removeGameFromProjectForms* | *ConsoleAdminRemoveGameFromProjectResult* | |
+ | *ConsoleAdminApi* | **rtOverView** | *rtOverViewForms* | *ConsoleAdminRtOverViewResult* | 实时并发数 |
+ | *ConsoleAdminApi* | **rtTrend** | *rtTrendForms* | *ConsoleAdminRtTrendResult* | 实时并发趋势图 |
+ | *ConsoleAdminApi* | **submitDeployment** | *submitDeploymentForms* | *ConsoleAdminSubmitDeploymentResult* | |
+ | *ConsoleAdminApi* | **submitRefund** | *submitRefundForms* | *ConsoleAdminSubmitRefundResult* | 订单退订 |
+ | *ConsoleAdminApi* | **uploadGameVersionByDownload** | *uploadGameVersionByDownloadForms* | *ConsoleAdminUploadGameVersionByDownloadResult* | |
+ | *DispatchApi* | **batchStopGame** | *batchStopGameForms* | *BatchStopGameResult* | |
+ | *DispatchApi* | **cancelGameHang** | *cancelGameHangForms* | *CancelGameHangResult* | 取消游戏挂机 |
+ | *DispatchApi* | **clientNotify** | *clientNotifyForms* | *ClientNotifyResult* | clientNotify |
+ | *DispatchApi* | **gameNotify** | *gameNotifyForms* | *GameNotifyResult* | 游戏通知接口 |
+ | *DispatchApi* | **getGameConcurrency** | *getGameConcurrencyForms* | *GetGameConcurrencyResult* | 调用GetGameConcurrency获取游戏当前并发数 |
+ | *DispatchApi* | **getStock** | *getStockForms* | *GetStockResult* | 调用GetStock获取游戏当前库存 |
+ | *DispatchApi* | **getStopGameToken** | *getStopGameTokenForms* | *GetStopGameTokenResult* | 全量踢下线获取token |
+ | *DispatchApi* | **listGameServerIp** | *listGameServerIpForms* | *ListGameServerIpResult* | |
+ | *DispatchApi* | **queryGameHang** | *queryGameHangForms* | *QueryGameHangResult* | 查询游戏挂机状态 |
+ | *DispatchApi* | **querySessionStatus** | *querySessionStatusForms* | *QuerySessionStatusResult* | 查询会话当前状态 |
+ | *DispatchApi* | **replaceSlot** | *replaceSlotForms* | *ReplaceSlotResult* | replaceSlot |
+ | *DispatchApi* | **setGameAlive** | *setGameAliveForms* | *SetGameAliveResult* | 设置游戏可运行时长 |
+ | *DispatchApi* | **setGameHang** | *setGameHangForms* | *SetGameHangResult* | 设置游戏挂机 |
+ | *DispatchApi* | **stopGame** | *stopGameForms* | *StopGameResult* | 服务端发起,停止某个用户的某个游戏的某个会话 |
+ | *DispatchApi* | **stopPreopenContainer** | *stopPreopenContainerForms* | *StopPreopenContainerResult* | 停止预开容器 |
+ | *DispatchApi* | **tryToGetSlot** | *tryToGetSlotForms* | *TryToGetSlotResult* | 为用户调度分配游戏容器,容器一旦分配成功会被锁住,一段时间内不再分配给其他用户,过期释放。 |
+ | *DispatchApi* | **tryToGetSlots** | *tryToGetSlotsForms* | *TryToGetSlotsResult* | tryToGetSlots |
+ | *DispatchApi* | **updatePreopenStrategy** | *updatePreopenStrategyForms* | *UpdatePreopenStrategyResult* | 更新预开预起策略 |
+ | *LiveApi* | **queryStatus** | *queryStatusForms* | *LiveQueryStatusResult* | |
+ | *LiveApi* | **startGameLive** | *startGameLiveForms* | *LiveStartGameLiveResult* | |
+ | *LiveApi* | **stopGameLive** | *stopGameLiveForms* | *LiveStopGameLiveResult* | |
+ | *MultiplayApi* | **close** | *closeForms* | *MultiplayCloseResult* | |
+ | *MultiplayApi* | **init** | *initForms* | *MultiplayInitResult* | |
+ | *MultiplayApi* | **join** | *joinForms* | *MultiplayJoinResult* | |
+ | *MultiplayApi* | **leave** | *leaveForms* | *MultiplayLeaveResult* | |
+ | *MultiplayApi* | **modify** | *modifyForms* | *MultiplayModifyResult* | |
+ | *MultiplayApi* | **query** | *queryForms* | *MultiplayQueryResult* | |
+ | *TokenApi* | **getPair** | | *GetPairResult* | 获取临时安全令牌(二元组) |
+ | *TokenApi* | **getTriple** | | *GetTripleResult* | 获取临时安全令牌 |
+ | *UsercontrollerApi* | **deleteGameArchive** | *deleteGameArchiveForms* | *UsercontrollerDeleteGameArchiveResult* | |
+ | *UsercontrollerApi* | **getGameTrialSurplusDuration** | *getGameTrialSurplusDurationForms* | *UsercontrollerGetGameTrialSurplusDurationResult* | |
+ | *UsercontrollerApi* | **getUserGameArchive** | *getUserGameArchiveForms* | *UsercontrollerGetUserGameArchiveResult* | |
+ | *UsercontrollerApi* | **listLatestGameArchive** | *listLatestGameArchiveForms* | *UsercontrollerListLatestGameArchiveResult* | |
+ | *UsercontrollerApi* | **restoreGameArchive** | *restoreGameArchiveForms* | *UsercontrollerRestoreGameArchiveResult* | |
+ | *UsercontrollerApi* | **updateGameArchiveTagStatus** | *updateGameArchiveTagStatusForms* | *UsercontrollerUpdateGameArchiveTagStatusResult* | |
+
+## License
+[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 000000000..c5e2cd801
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,176 @@
+
+ 4.0.0
+ com.alibaba
+ alibabacloud-yjopenapi-java-client
+ jar
+ alibabacloud-yjopenapi-java-client
+ 1.1.20241024
+ https://github.com/aliyun/alibabacloud-yjopenapi-java-client
+ YuanJing OpenAPI SDK for Java
+
+
+
+ The Apache License, Version 2.0
+ http://www.apache.org/licenses/LICENSE-2.0.txt
+
+
+
+
+
+ yuanjingproducts
+ yuanjing-sdk-team
+
+
+
+
+ sonatype-nexus-snapshots
+ https://s01.oss.sonatype.org/content/repositories/snapshots
+
+
+ sonatype-nexus-staging
+ https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
+
+
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.6.1
+
+
+ 7
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.6
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ 1.6.3
+ true
+
+ sonatype-nexus-staging
+ https://s01.oss.sonatype.org/
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.1.1
+
+ UTF-8
+ none
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.22.1
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 3.2.4
+
+
+ package
+
+ shade
+
+
+
+
+ com.squareup.okhttp
+ com.alibaba.external.okhttp
+
+
+ okio
+ com.alibaba.external.okio
+
+
+ com.alibaba.fastjson
+ com.alibaba.external.fastjson
+
+
+
+
+ org.jacoco:*
+
+
+
+
+ *:*
+
+ META-INF/*.SF
+ META-INF/*.DSA
+ META-INF/*.RSA
+ META-INF/*.MF
+ **/pom.xml
+
+
+
+
+
+
+ true
+ shaded
+
+
+
+
+
+
+
+
+
+
+ com.squareup.okhttp
+ okhttp
+ ${okhttp-version}
+
+
+ com.squareup.okhttp
+ logging-interceptor
+ ${okhttp-version}
+
+
+ com.alibaba
+ fastjson
+ ${fastjson-version}
+
+
+
+
+
+
+ 1.7
+ ${java.version}
+ ${java.version}
+
+ 2.7.5
+ 1.2.83
+ 1.0.0
+ UTF-8
+
+
diff --git a/src/main/java/com/alibaba/yjopenapi/client/api/AdaptApi.java b/src/main/java/com/alibaba/yjopenapi/client/api/AdaptApi.java
new file mode 100644
index 000000000..738391c25
--- /dev/null
+++ b/src/main/java/com/alibaba/yjopenapi/client/api/AdaptApi.java
@@ -0,0 +1,257 @@
+/*
+ *
+ * YuanJing OpenAPI SDK
+ *
+ */
+
+package com.alibaba.yjopenapi.client.api;
+
+import java.io.IOException;
+
+import com.alibaba.yjopenapi.client.model.AdaptCreateAndSubmitAllResult;
+import com.alibaba.yjopenapi.client.model.AdaptQueryRequestByIdResult;
+
+import com.alibaba.yjopenapi.client.model.*;
+
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class AdaptApi {
+ private ApiClient apiClient;
+ private Configuration configuration;
+
+ public AdaptApi() {
+ this(new ApiClient(), Configuration.getDefaultConfiguration());
+ }
+
+ public AdaptApi(ApiClient apiClient, Configuration configuration) {
+ this.apiClient = apiClient;
+ this.configuration = configuration;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public Configuration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(Configuration configuration) {
+ this.configuration = configuration;
+ }
+
+ /**
+ * Build call for createAndSubmitAll
+ * @param varForms AdaptCreateAndSubmitAllForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call createAndSubmitAllCall(AdaptCreateAndSubmitAllForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/adapt/createAndSubmitAll";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ if (varForms.getGameId() != null) {
+ localVarFormParams.put("gameId", varForms.getGameId());
+ }
+ if (varForms.getGameName() != null) {
+ localVarFormParams.put("gameName", varForms.getGameName());
+ }
+ if (varForms.getGameVersionId() != null) {
+ localVarFormParams.put("gameVersionId", varForms.getGameVersionId());
+ }
+ if (varForms.getGameVersion() != null) {
+ localVarFormParams.put("gameVersion", varForms.getGameVersion());
+ }
+ if (varForms.getResolutionList() != null) {
+ localVarFormParams.put("resolutionList", varForms.getResolutionList());
+ }
+ if (varForms.getFrameRateList() != null) {
+ localVarFormParams.put("frameRateList", varForms.getFrameRateList());
+ }
+ localVarFormParams.put("platformType", varForms.getPlatformType());
+ localVarFormParams.put("sourcePlatform", varForms.getSourcePlatform());
+ localVarFormParams.put("records", varForms.getRecords());
+ localVarFormParams.put("mixGameVersionId", varForms.getMixGameVersionId());
+ localVarFormParams.put("mixGameId", varForms.getMixGameId());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call createAndSubmitAllValidateBeforeCall(AdaptCreateAndSubmitAllForms varForms) throws ApiException {
+ // verify the required parameter 'platformType' is set
+ if (varForms.getPlatformType() == null) {
+ throw new ApiException("Missing the required parameter 'platformType' when calling createAndSubmitAll(Async)");
+ }
+ // verify the required parameter 'sourcePlatform' is set
+ if (varForms.getSourcePlatform() == null) {
+ throw new ApiException("Missing the required parameter 'sourcePlatform' when calling createAndSubmitAll(Async)");
+ }
+ // verify the required parameter 'records' is set
+ if (varForms.getRecords() == null) {
+ throw new ApiException("Missing the required parameter 'records' when calling createAndSubmitAll(Async)");
+ }
+ // verify the required parameter 'mixGameVersionId' is set
+ if (varForms.getMixGameVersionId() == null) {
+ throw new ApiException("Missing the required parameter 'mixGameVersionId' when calling createAndSubmitAll(Async)");
+ }
+ // verify the required parameter 'mixGameId' is set
+ if (varForms.getMixGameId() == null) {
+ throw new ApiException("Missing the required parameter 'mixGameId' when calling createAndSubmitAll(Async)");
+ }
+
+ com.squareup.okhttp.Call call = createAndSubmitAllCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ * createAndSubmitAll
+ * @param varForms AdaptCreateAndSubmitAllForms
+ * @return AdaptCreateAndSubmitAllResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public AdaptCreateAndSubmitAllResult createAndSubmitAll(AdaptCreateAndSubmitAllForms varForms) throws ApiException {
+ ApiResponse resp = createAndSubmitAllWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ * createAndSubmitAll
+ * @param varForms AdaptCreateAndSubmitAllForms
+ * @return ApiResponse<AdaptCreateAndSubmitAllResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse createAndSubmitAllWithHttpInfo(AdaptCreateAndSubmitAllForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = createAndSubmitAllValidateBeforeCall(varForms);
+ return apiClient.execute(call, AdaptCreateAndSubmitAllResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ * createAndSubmitAll
+ * @param varForms AdaptCreateAndSubmitAllForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call createAndSubmitAllAsync(AdaptCreateAndSubmitAllForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = createAndSubmitAllValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, AdaptCreateAndSubmitAllResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for queryRequestById
+ * @param varForms AdaptQueryRequestByIdForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call queryRequestByIdCall(AdaptQueryRequestByIdForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/adapt/queryRequestById";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("id", varForms.getId());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call queryRequestByIdValidateBeforeCall(AdaptQueryRequestByIdForms varForms) throws ApiException {
+ // verify the required parameter 'id' is set
+ if (varForms.getId() == null) {
+ throw new ApiException("Missing the required parameter 'id' when calling queryRequestById(Async)");
+ }
+
+ com.squareup.okhttp.Call call = queryRequestByIdCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ * queryRequestById
+ * @param varForms AdaptQueryRequestByIdForms
+ * @return AdaptQueryRequestByIdResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public AdaptQueryRequestByIdResult queryRequestById(AdaptQueryRequestByIdForms varForms) throws ApiException {
+ ApiResponse resp = queryRequestByIdWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ * queryRequestById
+ * @param varForms AdaptQueryRequestByIdForms
+ * @return ApiResponse<AdaptQueryRequestByIdResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse queryRequestByIdWithHttpInfo(AdaptQueryRequestByIdForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = queryRequestByIdValidateBeforeCall(varForms);
+ return apiClient.execute(call, AdaptQueryRequestByIdResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ * queryRequestById
+ * @param varForms AdaptQueryRequestByIdForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call queryRequestByIdAsync(AdaptQueryRequestByIdForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = queryRequestByIdValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, AdaptQueryRequestByIdResult.class, callback);
+ return call;
+ }
+}
diff --git a/src/main/java/com/alibaba/yjopenapi/client/api/AiApi.java b/src/main/java/com/alibaba/yjopenapi/client/api/AiApi.java
new file mode 100644
index 000000000..1009d5562
--- /dev/null
+++ b/src/main/java/com/alibaba/yjopenapi/client/api/AiApi.java
@@ -0,0 +1,989 @@
+/*
+ *
+ * YuanJing OpenAPI SDK
+ *
+ */
+
+package com.alibaba.yjopenapi.client.api;
+
+import java.io.IOException;
+
+import com.alibaba.yjopenapi.client.model.AiBatchUpdateKbVersionResult;
+import com.alibaba.yjopenapi.client.model.AiCancelQueueResult;
+import com.alibaba.yjopenapi.client.model.AiCreateNpcRoleFormsKnowledgeBases;
+import com.alibaba.yjopenapi.client.model.AiCreateNpcRoleResult;
+import com.alibaba.yjopenapi.client.model.AiDeleteModelsResult;
+import com.alibaba.yjopenapi.client.model.AiGetQueueResult;
+import com.alibaba.yjopenapi.client.model.AiListModelsResult;
+import com.alibaba.yjopenapi.client.model.AiUpdateModelsResult;
+import com.alibaba.yjopenapi.client.model.AiUpdateNpcRoleFormsKnowledgeBases;
+import com.alibaba.yjopenapi.client.model.AiUpdateNpcRoleResult;
+import com.alibaba.yjopenapi.client.model.AiUploadModelsFormsModelFiles;
+import com.alibaba.yjopenapi.client.model.AiUploadModelsResult;
+
+import com.alibaba.yjopenapi.client.model.*;
+
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class AiApi {
+ private ApiClient apiClient;
+ private Configuration configuration;
+
+ public AiApi() {
+ this(new ApiClient(), Configuration.getDefaultConfiguration());
+ }
+
+ public AiApi(ApiClient apiClient, Configuration configuration) {
+ this.apiClient = apiClient;
+ this.configuration = configuration;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public Configuration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(Configuration configuration) {
+ this.configuration = configuration;
+ }
+
+ /**
+ * Build call for batchUpdateKbVersion
+ * @param varForms AiBatchUpdateKbVersionForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call batchUpdateKbVersionCall(AiBatchUpdateKbVersionForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/ai/batchUpdateKbVersion";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("roleIds", varForms.getRoleIds());
+ localVarFormParams.put("kbId", varForms.getKbId());
+ localVarFormParams.put("kbVersionId", varForms.getKbVersionId());
+ localVarFormParams.put("operator", varForms.getOperator());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call batchUpdateKbVersionValidateBeforeCall(AiBatchUpdateKbVersionForms varForms) throws ApiException {
+ // verify the required parameter 'roleIds' is set
+ if (varForms.getRoleIds() == null) {
+ throw new ApiException("Missing the required parameter 'roleIds' when calling batchUpdateKbVersion(Async)");
+ }
+ // verify the required parameter 'kbId' is set
+ if (varForms.getKbId() == null) {
+ throw new ApiException("Missing the required parameter 'kbId' when calling batchUpdateKbVersion(Async)");
+ }
+ // verify the required parameter 'kbVersionId' is set
+ if (varForms.getKbVersionId() == null) {
+ throw new ApiException("Missing the required parameter 'kbVersionId' when calling batchUpdateKbVersion(Async)");
+ }
+ // verify the required parameter 'operator' is set
+ if (varForms.getOperator() == null) {
+ throw new ApiException("Missing the required parameter 'operator' when calling batchUpdateKbVersion(Async)");
+ }
+
+ com.squareup.okhttp.Call call = batchUpdateKbVersionCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ *
+ * @param varForms AiBatchUpdateKbVersionForms
+ * @return AiBatchUpdateKbVersionResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public AiBatchUpdateKbVersionResult batchUpdateKbVersion(AiBatchUpdateKbVersionForms varForms) throws ApiException {
+ ApiResponse resp = batchUpdateKbVersionWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ *
+ * @param varForms AiBatchUpdateKbVersionForms
+ * @return ApiResponse<AiBatchUpdateKbVersionResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse batchUpdateKbVersionWithHttpInfo(AiBatchUpdateKbVersionForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = batchUpdateKbVersionValidateBeforeCall(varForms);
+ return apiClient.execute(call, AiBatchUpdateKbVersionResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ *
+ * @param varForms AiBatchUpdateKbVersionForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call batchUpdateKbVersionAsync(AiBatchUpdateKbVersionForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = batchUpdateKbVersionValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, AiBatchUpdateKbVersionResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for cancelQueue
+ * @param varForms AiCancelQueueForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call cancelQueueCall(AiCancelQueueForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/ai/cancelQueue";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("taskId", varForms.getTaskId());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call cancelQueueValidateBeforeCall(AiCancelQueueForms varForms) throws ApiException {
+ // verify the required parameter 'taskId' is set
+ if (varForms.getTaskId() == null) {
+ throw new ApiException("Missing the required parameter 'taskId' when calling cancelQueue(Async)");
+ }
+
+ com.squareup.okhttp.Call call = cancelQueueCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ * 取消排队
+ * @param varForms AiCancelQueueForms
+ * @return AiCancelQueueResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public AiCancelQueueResult cancelQueue(AiCancelQueueForms varForms) throws ApiException {
+ ApiResponse resp = cancelQueueWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ * 取消排队
+ * @param varForms AiCancelQueueForms
+ * @return ApiResponse<AiCancelQueueResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse cancelQueueWithHttpInfo(AiCancelQueueForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = cancelQueueValidateBeforeCall(varForms);
+ return apiClient.execute(call, AiCancelQueueResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ * 取消排队
+ * @param varForms AiCancelQueueForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call cancelQueueAsync(AiCancelQueueForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = cancelQueueValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, AiCancelQueueResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for createNpcRole
+ * @param varForms AiCreateNpcRoleForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call createNpcRoleCall(AiCreateNpcRoleForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/ai/createNpcRole";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("name", varForms.getName());
+ localVarFormParams.put("description", varForms.getDescription());
+ localVarFormParams.put("figureId", varForms.getFigureId());
+ localVarFormParams.put("voiceId", varForms.getVoiceId());
+ localVarFormParams.put("characters", varForms.getCharacters());
+ localVarFormParams.put("greetings", varForms.getGreetings());
+ localVarFormParams.put("guidance", varForms.getGuidance());
+ if (varForms.getKnowledgeBases() != null) {
+ localVarFormParams.put("knowledgeBases", varForms.getKnowledgeBases());
+ }
+ if (varForms.getPluginIds() != null) {
+ localVarFormParams.put("pluginIds", varForms.getPluginIds());
+ }
+ localVarFormParams.put("shortMemoryRound", varForms.getShortMemoryRound());
+ localVarFormParams.put("tenantId", varForms.getTenantId());
+ localVarFormParams.put("operator", varForms.getOperator());
+ localVarFormParams.put("llmModelId", varForms.getLlmModelId());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call createNpcRoleValidateBeforeCall(AiCreateNpcRoleForms varForms) throws ApiException {
+ // verify the required parameter 'name' is set
+ if (varForms.getName() == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling createNpcRole(Async)");
+ }
+ // verify the required parameter 'description' is set
+ if (varForms.getDescription() == null) {
+ throw new ApiException("Missing the required parameter 'description' when calling createNpcRole(Async)");
+ }
+ // verify the required parameter 'figureId' is set
+ if (varForms.getFigureId() == null) {
+ throw new ApiException("Missing the required parameter 'figureId' when calling createNpcRole(Async)");
+ }
+ // verify the required parameter 'voiceId' is set
+ if (varForms.getVoiceId() == null) {
+ throw new ApiException("Missing the required parameter 'voiceId' when calling createNpcRole(Async)");
+ }
+ // verify the required parameter 'characters' is set
+ if (varForms.getCharacters() == null) {
+ throw new ApiException("Missing the required parameter 'characters' when calling createNpcRole(Async)");
+ }
+ // verify the required parameter 'greetings' is set
+ if (varForms.getGreetings() == null) {
+ throw new ApiException("Missing the required parameter 'greetings' when calling createNpcRole(Async)");
+ }
+ // verify the required parameter 'guidance' is set
+ if (varForms.getGuidance() == null) {
+ throw new ApiException("Missing the required parameter 'guidance' when calling createNpcRole(Async)");
+ }
+ // verify the required parameter 'shortMemoryRound' is set
+ if (varForms.getShortMemoryRound() == null) {
+ throw new ApiException("Missing the required parameter 'shortMemoryRound' when calling createNpcRole(Async)");
+ }
+ // verify the required parameter 'tenantId' is set
+ if (varForms.getTenantId() == null) {
+ throw new ApiException("Missing the required parameter 'tenantId' when calling createNpcRole(Async)");
+ }
+ // verify the required parameter 'operator' is set
+ if (varForms.getOperator() == null) {
+ throw new ApiException("Missing the required parameter 'operator' when calling createNpcRole(Async)");
+ }
+ // verify the required parameter 'llmModelId' is set
+ if (varForms.getLlmModelId() == null) {
+ throw new ApiException("Missing the required parameter 'llmModelId' when calling createNpcRole(Async)");
+ }
+
+ com.squareup.okhttp.Call call = createNpcRoleCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ *
+ * @param varForms AiCreateNpcRoleForms
+ * @return AiCreateNpcRoleResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public AiCreateNpcRoleResult createNpcRole(AiCreateNpcRoleForms varForms) throws ApiException {
+ ApiResponse resp = createNpcRoleWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ *
+ * @param varForms AiCreateNpcRoleForms
+ * @return ApiResponse<AiCreateNpcRoleResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse createNpcRoleWithHttpInfo(AiCreateNpcRoleForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = createNpcRoleValidateBeforeCall(varForms);
+ return apiClient.execute(call, AiCreateNpcRoleResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ *
+ * @param varForms AiCreateNpcRoleForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call createNpcRoleAsync(AiCreateNpcRoleForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = createNpcRoleValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, AiCreateNpcRoleResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for deleteModels
+ * @param varForms AiDeleteModelsForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call deleteModelsCall(AiDeleteModelsForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/ai/deleteModels";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("resourceId", varForms.getResourceId());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call deleteModelsValidateBeforeCall(AiDeleteModelsForms varForms) throws ApiException {
+ // verify the required parameter 'resourceId' is set
+ if (varForms.getResourceId() == null) {
+ throw new ApiException("Missing the required parameter 'resourceId' when calling deleteModels(Async)");
+ }
+
+ com.squareup.okhttp.Call call = deleteModelsCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ * 删除私有模型
+ * @param varForms AiDeleteModelsForms
+ * @return AiDeleteModelsResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public AiDeleteModelsResult deleteModels(AiDeleteModelsForms varForms) throws ApiException {
+ ApiResponse resp = deleteModelsWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ * 删除私有模型
+ * @param varForms AiDeleteModelsForms
+ * @return ApiResponse<AiDeleteModelsResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse deleteModelsWithHttpInfo(AiDeleteModelsForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = deleteModelsValidateBeforeCall(varForms);
+ return apiClient.execute(call, AiDeleteModelsResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ * 删除私有模型
+ * @param varForms AiDeleteModelsForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call deleteModelsAsync(AiDeleteModelsForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = deleteModelsValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, AiDeleteModelsResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for getQueue
+ * @param varForms AiGetQueueForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call getQueueCall(AiGetQueueForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/ai/getQueue";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("taskId", varForms.getTaskId());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call getQueueValidateBeforeCall(AiGetQueueForms varForms) throws ApiException {
+ // verify the required parameter 'taskId' is set
+ if (varForms.getTaskId() == null) {
+ throw new ApiException("Missing the required parameter 'taskId' when calling getQueue(Async)");
+ }
+
+ com.squareup.okhttp.Call call = getQueueCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ * 查询排队
+ * @param varForms AiGetQueueForms
+ * @return AiGetQueueResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public AiGetQueueResult getQueue(AiGetQueueForms varForms) throws ApiException {
+ ApiResponse resp = getQueueWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ * 查询排队
+ * @param varForms AiGetQueueForms
+ * @return ApiResponse<AiGetQueueResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse getQueueWithHttpInfo(AiGetQueueForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = getQueueValidateBeforeCall(varForms);
+ return apiClient.execute(call, AiGetQueueResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ * 查询排队
+ * @param varForms AiGetQueueForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call getQueueAsync(AiGetQueueForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = getQueueValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, AiGetQueueResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for listModels
+ * @param varForms AiListModelsForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call listModelsCall(AiListModelsForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/ai/listModels";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ if (varForms.getModelType() != null) {
+ localVarFormParams.put("modelType", varForms.getModelType());
+ }
+ if (varForms.getModelFileType() != null) {
+ localVarFormParams.put("modelFileType", varForms.getModelFileType());
+ }
+ if (varForms.getModelSeries() != null) {
+ localVarFormParams.put("modelSeries", varForms.getModelSeries());
+ }
+ if (varForms.getModelFileName() != null) {
+ localVarFormParams.put("modelFileName", varForms.getModelFileName());
+ }
+ localVarFormParams.put("pageNumber", varForms.getPageNumber());
+ localVarFormParams.put("pageSize", varForms.getPageSize());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call listModelsValidateBeforeCall(AiListModelsForms varForms) throws ApiException {
+ // verify the required parameter 'pageNumber' is set
+ if (varForms.getPageNumber() == null) {
+ throw new ApiException("Missing the required parameter 'pageNumber' when calling listModels(Async)");
+ }
+ // verify the required parameter 'pageSize' is set
+ if (varForms.getPageSize() == null) {
+ throw new ApiException("Missing the required parameter 'pageSize' when calling listModels(Async)");
+ }
+
+ com.squareup.okhttp.Call call = listModelsCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ * 查看私有模型列表
+ * @param varForms AiListModelsForms
+ * @return AiListModelsResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public AiListModelsResult listModels(AiListModelsForms varForms) throws ApiException {
+ ApiResponse resp = listModelsWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ * 查看私有模型列表
+ * @param varForms AiListModelsForms
+ * @return ApiResponse<AiListModelsResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse listModelsWithHttpInfo(AiListModelsForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = listModelsValidateBeforeCall(varForms);
+ return apiClient.execute(call, AiListModelsResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ * 查看私有模型列表
+ * @param varForms AiListModelsForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call listModelsAsync(AiListModelsForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = listModelsValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, AiListModelsResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for updateModels
+ * @param varForms AiUpdateModelsForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call updateModelsCall(AiUpdateModelsForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/ai/updateModels";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("resourceId", varForms.getResourceId());
+ localVarFormParams.put("desc", varForms.getDesc());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call updateModelsValidateBeforeCall(AiUpdateModelsForms varForms) throws ApiException {
+ // verify the required parameter 'resourceId' is set
+ if (varForms.getResourceId() == null) {
+ throw new ApiException("Missing the required parameter 'resourceId' when calling updateModels(Async)");
+ }
+ // verify the required parameter 'desc' is set
+ if (varForms.getDesc() == null) {
+ throw new ApiException("Missing the required parameter 'desc' when calling updateModels(Async)");
+ }
+
+ com.squareup.okhttp.Call call = updateModelsCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ * 修改私有模型信息
+ * @param varForms AiUpdateModelsForms
+ * @return AiUpdateModelsResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public AiUpdateModelsResult updateModels(AiUpdateModelsForms varForms) throws ApiException {
+ ApiResponse resp = updateModelsWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ * 修改私有模型信息
+ * @param varForms AiUpdateModelsForms
+ * @return ApiResponse<AiUpdateModelsResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse updateModelsWithHttpInfo(AiUpdateModelsForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = updateModelsValidateBeforeCall(varForms);
+ return apiClient.execute(call, AiUpdateModelsResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ * 修改私有模型信息
+ * @param varForms AiUpdateModelsForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call updateModelsAsync(AiUpdateModelsForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = updateModelsValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, AiUpdateModelsResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for updateNpcRole
+ * @param varForms AiUpdateNpcRoleForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call updateNpcRoleCall(AiUpdateNpcRoleForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/ai/updateNpcRole";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("id", varForms.getId());
+ localVarFormParams.put("name", varForms.getName());
+ localVarFormParams.put("description", varForms.getDescription());
+ localVarFormParams.put("figureId", varForms.getFigureId());
+ localVarFormParams.put("voiceId", varForms.getVoiceId());
+ localVarFormParams.put("characters", varForms.getCharacters());
+ localVarFormParams.put("greetings", varForms.getGreetings());
+ localVarFormParams.put("guidance", varForms.getGuidance());
+ if (varForms.getKnowledgeBases() != null) {
+ localVarFormParams.put("knowledgeBases", varForms.getKnowledgeBases());
+ }
+ if (varForms.getPluginIds() != null) {
+ localVarFormParams.put("pluginIds", varForms.getPluginIds());
+ }
+ localVarFormParams.put("shortMemoryRound", varForms.getShortMemoryRound());
+ localVarFormParams.put("operator", varForms.getOperator());
+ localVarFormParams.put("llmModelId", varForms.getLlmModelId());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call updateNpcRoleValidateBeforeCall(AiUpdateNpcRoleForms varForms) throws ApiException {
+ // verify the required parameter 'id' is set
+ if (varForms.getId() == null) {
+ throw new ApiException("Missing the required parameter 'id' when calling updateNpcRole(Async)");
+ }
+ // verify the required parameter 'name' is set
+ if (varForms.getName() == null) {
+ throw new ApiException("Missing the required parameter 'name' when calling updateNpcRole(Async)");
+ }
+ // verify the required parameter 'description' is set
+ if (varForms.getDescription() == null) {
+ throw new ApiException("Missing the required parameter 'description' when calling updateNpcRole(Async)");
+ }
+ // verify the required parameter 'figureId' is set
+ if (varForms.getFigureId() == null) {
+ throw new ApiException("Missing the required parameter 'figureId' when calling updateNpcRole(Async)");
+ }
+ // verify the required parameter 'voiceId' is set
+ if (varForms.getVoiceId() == null) {
+ throw new ApiException("Missing the required parameter 'voiceId' when calling updateNpcRole(Async)");
+ }
+ // verify the required parameter 'characters' is set
+ if (varForms.getCharacters() == null) {
+ throw new ApiException("Missing the required parameter 'characters' when calling updateNpcRole(Async)");
+ }
+ // verify the required parameter 'greetings' is set
+ if (varForms.getGreetings() == null) {
+ throw new ApiException("Missing the required parameter 'greetings' when calling updateNpcRole(Async)");
+ }
+ // verify the required parameter 'guidance' is set
+ if (varForms.getGuidance() == null) {
+ throw new ApiException("Missing the required parameter 'guidance' when calling updateNpcRole(Async)");
+ }
+ // verify the required parameter 'shortMemoryRound' is set
+ if (varForms.getShortMemoryRound() == null) {
+ throw new ApiException("Missing the required parameter 'shortMemoryRound' when calling updateNpcRole(Async)");
+ }
+ // verify the required parameter 'operator' is set
+ if (varForms.getOperator() == null) {
+ throw new ApiException("Missing the required parameter 'operator' when calling updateNpcRole(Async)");
+ }
+ // verify the required parameter 'llmModelId' is set
+ if (varForms.getLlmModelId() == null) {
+ throw new ApiException("Missing the required parameter 'llmModelId' when calling updateNpcRole(Async)");
+ }
+
+ com.squareup.okhttp.Call call = updateNpcRoleCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ *
+ * @param varForms AiUpdateNpcRoleForms
+ * @return AiUpdateNpcRoleResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public AiUpdateNpcRoleResult updateNpcRole(AiUpdateNpcRoleForms varForms) throws ApiException {
+ ApiResponse resp = updateNpcRoleWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ *
+ * @param varForms AiUpdateNpcRoleForms
+ * @return ApiResponse<AiUpdateNpcRoleResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse updateNpcRoleWithHttpInfo(AiUpdateNpcRoleForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = updateNpcRoleValidateBeforeCall(varForms);
+ return apiClient.execute(call, AiUpdateNpcRoleResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ *
+ * @param varForms AiUpdateNpcRoleForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call updateNpcRoleAsync(AiUpdateNpcRoleForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = updateNpcRoleValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, AiUpdateNpcRoleResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for uploadModels
+ * @param varForms AiUploadModelsForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call uploadModelsCall(AiUploadModelsForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/ai/uploadModels";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("modelType", varForms.getModelType());
+ localVarFormParams.put("modelName", varForms.getModelName());
+ localVarFormParams.put("modelFilePath", varForms.getModelFilePath());
+ localVarFormParams.put("modelFiles", varForms.getModelFiles());
+ if (varForms.getDesc() != null) {
+ localVarFormParams.put("desc", varForms.getDesc());
+ }
+ localVarFormParams.put("modelFileType", varForms.getModelFileType());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call uploadModelsValidateBeforeCall(AiUploadModelsForms varForms) throws ApiException {
+ // verify the required parameter 'modelType' is set
+ if (varForms.getModelType() == null) {
+ throw new ApiException("Missing the required parameter 'modelType' when calling uploadModels(Async)");
+ }
+ // verify the required parameter 'modelName' is set
+ if (varForms.getModelName() == null) {
+ throw new ApiException("Missing the required parameter 'modelName' when calling uploadModels(Async)");
+ }
+ // verify the required parameter 'modelFilePath' is set
+ if (varForms.getModelFilePath() == null) {
+ throw new ApiException("Missing the required parameter 'modelFilePath' when calling uploadModels(Async)");
+ }
+ // verify the required parameter 'modelFiles' is set
+ if (varForms.getModelFiles() == null) {
+ throw new ApiException("Missing the required parameter 'modelFiles' when calling uploadModels(Async)");
+ }
+ // verify the required parameter 'modelFileType' is set
+ if (varForms.getModelFileType() == null) {
+ throw new ApiException("Missing the required parameter 'modelFileType' when calling uploadModels(Async)");
+ }
+
+ com.squareup.okhttp.Call call = uploadModelsCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ * 上传私有模型
+ * @param varForms AiUploadModelsForms
+ * @return AiUploadModelsResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public AiUploadModelsResult uploadModels(AiUploadModelsForms varForms) throws ApiException {
+ ApiResponse resp = uploadModelsWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ * 上传私有模型
+ * @param varForms AiUploadModelsForms
+ * @return ApiResponse<AiUploadModelsResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse uploadModelsWithHttpInfo(AiUploadModelsForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = uploadModelsValidateBeforeCall(varForms);
+ return apiClient.execute(call, AiUploadModelsResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ * 上传私有模型
+ * @param varForms AiUploadModelsForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call uploadModelsAsync(AiUploadModelsForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = uploadModelsValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, AiUploadModelsResult.class, callback);
+ return call;
+ }
+}
diff --git a/src/main/java/com/alibaba/yjopenapi/client/api/ApiCallback.java b/src/main/java/com/alibaba/yjopenapi/client/api/ApiCallback.java
new file mode 100644
index 000000000..4b3f2a83a
--- /dev/null
+++ b/src/main/java/com/alibaba/yjopenapi/client/api/ApiCallback.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * YuanJing OpenAPI SDK
+ *
+ */
+
+package com.alibaba.yjopenapi.client.api;
+
+import java.io.IOException;
+
+import java.util.Map;
+import java.util.List;
+
+/**
+ * Callback for asynchronous API call.
+ *
+ * @param The return type
+ */
+public interface ApiCallback {
+ /**
+ * This is called when the API call fails.
+ *
+ * @param e The exception causing the failure
+ * @param statusCode Status code of the response if available, otherwise it would be 0
+ * @param responseHeaders Headers of the response if available, otherwise it would be null
+ */
+ void onFailure(ApiException e, int statusCode, Map> responseHeaders);
+
+ /**
+ * This is called when the API call succeeded.
+ *
+ * @param result The result deserialized from response
+ * @param statusCode Status code of the response
+ * @param responseHeaders Headers of the response
+ */
+ void onSuccess(T result, int statusCode, Map> responseHeaders);
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/alibaba/yjopenapi/client/api/ApiClient.java b/src/main/java/com/alibaba/yjopenapi/client/api/ApiClient.java
new file mode 100644
index 000000000..8422978f3
--- /dev/null
+++ b/src/main/java/com/alibaba/yjopenapi/client/api/ApiClient.java
@@ -0,0 +1,745 @@
+/*
+ *
+ * YuanJing OpenAPI SDK
+ *
+ */
+
+package com.alibaba.yjopenapi.client.api;
+
+import com.squareup.okhttp.*;
+import com.squareup.okhttp.internal.http.HttpMethod;
+import javax.xml.bind.DatatypeConverter;
+
+import javax.net.ssl.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.security.MessageDigest;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.Arrays;
+import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import com.alibaba.fastjson.JSON;
+
+public class ApiClient {
+
+ public static final String Trace_Id = "Traceid";
+ public static final String Result_Status = "Result-Status";
+
+ private String basePath = "/";
+
+ private Map defaultHeaderMap = new HashMap();
+
+ private OkHttpClient httpClient;
+
+ /*
+ * Constructor for ApiClient
+ */
+ public ApiClient() {
+ httpClient = new OkHttpClient();
+
+ }
+
+ /**
+ * Get base path
+ *
+ * @return Baes path
+ */
+ public String getBasePath() {
+ return basePath;
+ }
+
+ /**
+ * Set base path
+ *
+ * @param basePath Base path of the URL (e.g /
+ * @return An instance of OkHttpClient
+ */
+ public ApiClient setBasePath(String basePath) {
+ this.basePath = basePath;
+ return this;
+ }
+
+ /**
+ * Get HTTP client
+ *
+ * @return An instance of OkHttpClient
+ */
+ public OkHttpClient getHttpClient() {
+ return httpClient;
+ }
+
+ /**
+ * Set HTTP client
+ *
+ * @param httpClient An instance of OkHttpClient
+ * @return Api Client
+ */
+ public ApiClient setHttpClient(OkHttpClient httpClient) {
+ this.httpClient = httpClient;
+ return this;
+ }
+
+ /**
+ * Add a default header.
+ *
+ * @param key The header's key
+ * @param value The header's value
+ * @return ApiClient
+ */
+ public ApiClient addDefaultHeader(String key, String value) {
+ defaultHeaderMap.put(key, value);
+ return this;
+ }
+
+ /**
+ * Get connection timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public int getConnectTimeout() {
+ return httpClient.getConnectTimeout();
+ }
+
+ /**
+ * Sets the connect timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ *
+ * @param connectionTimeout connection timeout in milliseconds
+ * @return Api client
+ */
+ public ApiClient setConnectTimeout(int connectionTimeout) {
+ httpClient.setConnectTimeout(connectionTimeout, TimeUnit.MILLISECONDS);
+ return this;
+ }
+
+ /**
+ * Get read timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public int getReadTimeout() {
+ return httpClient.getReadTimeout();
+ }
+
+ /**
+ * Sets the read timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link Integer#MAX_VALUE}.
+ *
+ * @param readTimeout read timeout in milliseconds
+ * @return Api client
+ */
+ public ApiClient setReadTimeout(int readTimeout) {
+ httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS);
+ return this;
+ }
+
+ /**
+ * Get write timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public int getWriteTimeout() {
+ return httpClient.getWriteTimeout();
+ }
+
+ /**
+ * Sets the write timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link Integer#MAX_VALUE}.
+ *
+ * @param writeTimeout connection timeout in milliseconds
+ * @return Api client
+ */
+ public ApiClient setWriteTimeout(int writeTimeout) {
+ httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS);
+ return this;
+ }
+
+ /**
+ * Format the given parameter object into string.
+ *
+ * @param param Parameter
+ * @return String representation of the parameter
+ */
+ public static String parameterToString(Object param) {
+
+ List extends Class>> primitives = Arrays.asList(String.class,Boolean.class,Double.class,Integer.class,Long.class,Float.class);
+
+ if (param == null) {
+ return "";
+ } else if (param instanceof Date) {
+ return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format((Date) param);
+ } else if (param.getClass().isPrimitive() || primitives.contains(param.getClass())) {
+ return String.valueOf(param);
+ } else {
+ //Serialize to json string and remove the " enclosing characters
+ return JSON.toJSONString(param);
+ // return jsonStr.substring(1, jsonStr.length() - 1);
+ }
+ }
+
+ /**
+ * Formats the specified query parameter to a list containing a single {@code Pair} object.
+ *
+ * Note that {@code value} must not be a collection.
+ *
+ * @param name The name of the parameter.
+ * @param value The value of the parameter.
+ * @return A list containing a single {@code Pair} object.
+ */
+ //public List parameterToPair(String name, Object value) {
+ // List params = new ArrayList();
+ //
+ // // preconditions
+ // if (name == null || name.isEmpty() || value == null || value instanceof Collection) {
+ // return params;
+ // }
+ //
+ // params.add(new Pair(name, parameterToString(value)));
+ // return params;
+ //}
+
+ /**
+ * Formats the specified collection query parameters to a list of {@code Pair} objects.
+ *
+ * Note that the values of each of the returned Pair objects are percent-encoded.
+ *
+ * @param collectionFormat The collection format of the parameter.
+ * @param name The name of the parameter.
+ * @param value The value of the parameter.
+ * @return A list of {@code Pair} objects.
+ */
+ //public List parameterToPairs(String collectionFormat, String name, Collection value) {
+ // List params = new ArrayList();
+ //
+ // // preconditions
+ // if (name == null || name.isEmpty() || value == null || value.isEmpty()) {
+ // return params;
+ // }
+ //
+ // // create the params based on the collection format
+ // if ("multi".equals(collectionFormat)) {
+ // for (Object item : value) {
+ // params.add(new Pair(name, escapeString(parameterToString(item))));
+ // }
+ // return params;
+ // }
+ //
+ // // collectionFormat is assumed to be "csv" by default
+ // //String delimiter = ",";
+ //
+ // // escape all delimiters except commas, which are URI reserved
+ // // characters
+ // //if ("ssv".equals(collectionFormat)) {
+ // // delimiter = escapeString(" ");
+ // //} else if ("tsv".equals(collectionFormat)) {
+ // // delimiter = escapeString("\t");
+ // //} else if ("pipes".equals(collectionFormat)) {
+ // // delimiter = escapeString("|");
+ // //}
+ //
+ // //StringBuilder sb = new StringBuilder() ;
+ // //for (Object item : value) {
+ // // sb.append(delimiter);
+ // // sb.append(escapeString(parameterToString(item)));
+ // //}
+ //
+ // //params.add(new Pair(name, sb.substring(delimiter.length())));
+ //
+ // return params;
+ //}
+
+ /**
+ * Sanitize filename by removing path.
+ * e.g. ../../sun.gif becomes sun.gif
+ *
+ * @param filename The filename to be sanitized
+ * @return The sanitized filename
+ */
+ public String sanitizeFilename(String filename) {
+ return filename.replaceAll(".*[/\\\\]", "");
+ }
+
+ /**
+ * Check if the given MIME is a JSON MIME.
+ * JSON MIME examples:
+ * application/json
+ * application/json; charset=UTF8
+ * APPLICATION/JSON
+ * application/vnd.company+json
+ * "* / *" is also default to JSON
+ * @param mime MIME (Multipurpose Internet Mail Extensions)
+ * @return True if the given MIME is JSON, false otherwise.
+ */
+ public boolean isJsonMime(String mime) {
+ String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
+ return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
+ }
+
+ /**
+ * Select the Accept header's value from the given accepts array:
+ * if JSON exists in the given array, use it;
+ * otherwise use all of them (joining into a string)
+ *
+ * @param accepts The accepts array to select from
+ * @return The Accept header to use. If the given array is empty,
+ * null will be returned (not to set the Accept header explicitly).
+ */
+ public String selectHeaderAccept(List accepts) {
+ if (accepts == null || accepts.isEmpty()) {
+ return null;
+ }
+ for (String accept : accepts) {
+ if (isJsonMime(accept)) {
+ return accept;
+ }
+ }
+ return join(accepts, ",");
+ }
+
+ /**
+ * Select the Content-Type header's value from the given array:
+ * if JSON exists in the given array, use it;
+ * otherwise use the first one of the array.
+ *
+ * @param contentTypes The Content-Type array to select from
+ * @return The Content-Type header to use. If the given array is empty,
+ * or matches "any", JSON will be used.
+ */
+ public String selectHeaderContentType(List contentTypes) {
+ if (contentTypes == null || contentTypes.isEmpty() || contentTypes.contains("*/*")) {
+ return "application/json";
+ }
+ for (String contentType : contentTypes) {
+ if (isJsonMime(contentType)) {
+ return contentType;
+ }
+ }
+ return contentTypes.get(0);
+ }
+
+ /**
+ * Escape the given string to be used as URL query value.
+ *
+ * @param str String to be escaped
+ * @return Escaped string
+ */
+ public String escapeString(String str) {
+ try {
+ return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
+ } catch (UnsupportedEncodingException e) {
+ return str;
+ }
+ }
+
+ /**
+ * Deserialize response body to Java object, according to the return type and
+ * the Content-Type response header.
+ *
+ * @param Type
+ * @param response HTTP response
+ * @param returnType The type of the Java object
+ * @return The deserialized Java object
+ * @throws ApiException If fail to deserialize response body, i.e. cannot read response body
+ * or the Content-Type of the response is not supported.
+ */
+ public T deserialize(Response response, Class returnType) throws ApiException {
+ if (response == null || returnType == null) {
+ return null;
+ }
+
+ String respBody;
+ try (ResponseBody body = response.body()) {
+ if (body != null) {
+ respBody = body.string();
+ } else {
+ respBody = null;
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+
+ if (respBody == null || "".equals(respBody)) {
+ return null;
+ }
+
+ String contentType = response.headers().get("Content-Type");
+ if (contentType == null) {
+ // ensuring a default content type
+ contentType = "application/json";
+ }
+ if (isJsonMime(contentType)) {
+ return JSON.parseObject(respBody, returnType);
+ } else {
+ throw new ApiException(
+ "Content type \"" + contentType + "\" is not supported for type: " + returnType,
+ response.code(),
+ response.headers().toMultimap(),
+ respBody);
+ }
+ }
+
+ /**
+ * Serialize the given Java object into request body according to the object's
+ * class and the request Content-Type.
+ *
+ * @param obj The Java object
+ * @param contentType The request Content-Type
+ * @return The serialized request body
+ * @throws ApiException If fail to serialize the given object
+ */
+ public RequestBody serialize(Object obj, String contentType) throws ApiException {
+ if (isJsonMime(contentType)) {
+ String content;
+ if (obj != null) {
+ content = JSON.toJSONString(obj);
+ } else {
+ content = "";
+ }
+ return RequestBody.create(MediaType.parse(contentType), content);
+ } else {
+ throw new ApiException("Content type \"" + contentType + "\" is not supported");
+ }
+ }
+
+ /**
+ * {@link #execute(Call, Class)}
+ *
+ * @param Type
+ * @param call An instance of the Call object
+ * @throws ApiException If fail to execute the call
+ * @return ApiResponse<T>
+ */
+ public ApiResponse execute(Call call) throws ApiException {
+ return execute(call, null);
+ }
+
+ /**
+ * Execute HTTP call and deserialize the HTTP response body into the given return type.
+ *
+ * @param returnType The return type used to deserialize HTTP response body
+ * @param The return type corresponding to (same with) returnType
+ * @param call Call
+ * @return ApiResponse object containing response status, headers and
+ * data, which is a Java object deserialized from response body and would be null
+ * when returnType is null.
+ * @throws ApiException If fail to execute the call
+ */
+ public ApiResponse execute(Call call, Class returnType) throws ApiException {
+ try {
+ Response response = call.execute();
+ T data = handleResponse(response, returnType);
+ return new ApiResponse(response.code(), response.headers().toMultimap(), data);
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ }
+
+ /**
+ * {@link #executeAsync(Call, Class, ApiCallback)}
+ *
+ * @param Type
+ * @param call An instance of the Call object
+ * @param callback ApiCallback<T>
+ */
+ public void executeAsync(Call call, ApiCallback callback) {
+ executeAsync(call, null, callback);
+ }
+
+ /**
+ * Execute HTTP call asynchronously.
+ *
+ * @see #execute(Call, Class)
+ * @param Type
+ * @param call The callback to be executed when the API call finishes
+ * @param returnType Return type
+ * @param callback ApiCallback
+ */
+ public void executeAsync(Call call, final Class returnType, final ApiCallback callback) {
+ call.enqueue(new Callback() {
+ @Override
+ public void onFailure(Request request, IOException e) {
+ callback.onFailure(new ApiException(e), 0, null);
+ }
+
+ @Override
+ public void onResponse(Response response) throws IOException {
+ T result;
+ try {
+ result = (T) handleResponse(response, returnType);
+ } catch (ApiException e) {
+ callback.onFailure(e, response.code(), response.headers().toMultimap());
+ return;
+ }
+ callback.onSuccess(result, response.code(), response.headers().toMultimap());
+ }
+ });
+ }
+
+ /**
+ * Handle the given response, return the deserialized object when the response is successful.
+ *
+ * @param Type
+ * @param response Response
+ * @param returnType Return type
+ * @throws ApiException If the response has a unsuccessful status code or
+ * fail to deserialize the response body
+ * @return Type
+ */
+ public T handleResponse(Response response, Class returnType) throws ApiException {
+ if (response.isSuccessful()) {
+ if (returnType == null) {
+ // returning null if the returnType is not defined,
+ // or the status code is 204 (No Content)
+ try (ResponseBody body = response.body()) {
+ return null;
+ } catch (IOException e) {
+ throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
+ }
+ } else {
+ return deserialize(response, returnType);
+ }
+ } else {
+ try (ResponseBody body = response.body()) {
+ String respBody = null;
+ if (body != null) {
+ respBody = body.string();
+ }
+ throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody);
+ } catch (IOException e) {
+ throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
+ }
+ }
+ }
+
+ /**
+ * Build HTTP call with the given options.
+ *
+ * @param path The sub-path of the HTTP URL
+ * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
+ * @param queryParams The query parameters
+ * @param headerParams The header parameters
+ * @param formParams The form parameters
+ * @return The HTTP call
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Call buildCall(String path, String method, Map queryParams, Map headerParams, Map formParams, Configuration configuration) throws ApiException {
+ Request request = buildRequest(path, method, queryParams, headerParams, formParams, configuration);
+
+ return httpClient.newCall(request);
+ }
+
+ /**
+ * Build an HTTP request with the given options.
+ *
+ * @param path The sub-path of the HTTP URL
+ * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
+ * @param queryParams The query parameters
+ * @param headerParams The header parameters
+ * @param formParams The form parameters
+ * @return The HTTP request
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public Request buildRequest(String path, String method, Map queryParams, Map headerParams, Map formParams, Configuration configuration) throws ApiException {
+
+ final String url = buildUrl(path, queryParams);
+ final Request.Builder reqBuilder = new Request.Builder().url(url);
+
+ Map signHeader = prepareSignHeader(queryParams, formParams, method, configuration);
+ headerParams.putAll(signHeader);
+
+ processHeaderParams(headerParams, reqBuilder);
+
+ String contentType = (String) headerParams.get("Content-Type");
+ // ensuring a default content type
+ if (contentType == null) {
+ contentType = "application/json";
+ }
+
+ RequestBody reqBody = null;
+ if (!HttpMethod.permitsRequestBody(method)) {
+ reqBody = null;
+ } else if ("application/x-www-form-urlencoded".equals(contentType)) {
+ reqBody = buildRequestBodyFormEncoding(formParams);
+ } else {
+ // use an empty request body (for POST, PUT and PATCH)
+ reqBody = RequestBody.create(MediaType.parse(contentType), "");
+ // reqBody = serialize(null, contentType);
+ }
+
+ Request request = reqBuilder.method(method, reqBody).build();
+ return request;
+ }
+
+ /**
+ * Build full URL by concatenating base path, the given sub path and query parameters.
+ *
+ * @param path The sub path
+ * @param queryParams The query parameters
+ * @return The full URL
+ */
+ public String buildUrl(String path, Map queryParams) {
+ final StringBuilder url = new StringBuilder(path);
+
+ if (queryParams != null && !queryParams.isEmpty()) {
+ // support (constant) query string in `path`, e.g. "/posts?draft=1"
+ String prefix = path.contains("?") ? "&" : "?";
+ for (Entry param : queryParams.entrySet()) {
+ if (param.getValue() != null) {
+ if (prefix != null) {
+ url.append(prefix);
+ prefix = null;
+ } else {
+ url.append("&");
+ }
+ String value = parameterToString(param.getValue());
+ url.append(escapeString(param.getKey())).append("=").append(escapeString(value));
+ }
+ }
+ }
+
+ //if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) {
+ // String prefix = url.toString().contains("?") ? "&" : "?";
+ // for (Pair param : collectionQueryParams) {
+ // if (param.getValue() != null) {
+ // if (prefix != null) {
+ // url.append(prefix);
+ // prefix = null;
+ // } else {
+ // url.append("&");
+ // }
+ // String value = parameterToString(param.getValue());
+ // // collection query parameter value already escaped as part of parameterToPairs
+ // url.append(escapeString(param.getName())).append("=").append(value);
+ // }
+ // }
+ //}
+
+ return url.toString();
+ }
+
+ /**
+ * Set header parameters to the request builder, including default headers.
+ *
+ * @param headerParams Header parameters in the ofrm of Map
+ * @param reqBuilder Reqeust.Builder
+ */
+ public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) {
+ reqBuilder.header("User-Agent", "cgw-client/1.0.0/java");
+
+ for (Entry param : headerParams.entrySet()) {
+ reqBuilder.header(param.getKey(), parameterToString(param.getValue()));
+ }
+ }
+
+ /**
+ * Build a form-encoding request body with the given form parameters.
+ *
+ * @param formParams Form parameters in the form of Map
+ * @return RequestBody
+ */
+ public RequestBody buildRequestBodyFormEncoding(Map formParams) {
+ FormEncodingBuilder formBuilder = new FormEncodingBuilder();
+ for (Entry param : formParams.entrySet()) {
+ formBuilder.add(param.getKey(), parameterToString(param.getValue()));
+ }
+ return formBuilder.build();
+ }
+
+ private static String join(List array, String separator) {
+ if (array == null || array.isEmpty()) {
+ return "";
+ }
+ StringBuilder out = new StringBuilder();
+ out.append(array.get(0));
+ for (int i = 1; i < array.size(); i++) {
+ out.append(separator).append(array.get(i));
+ }
+ return out.toString();
+ }
+
+ public static Map prepareSignHeader(Map queryParams, Map formParams, String method, Configuration configuration)
+ throws ApiException {
+
+ String nonce = UUID.randomUUID().toString().replaceAll("-", "");
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+ df.setTimeZone(new SimpleTimeZone(0, "GMT"));
+ String timestamp = df.format(new Date());
+ String signatureMethod = configuration.getSignatureMethod();
+ String signatureVersion = configuration.getSignatureVersion();
+ String accessKey = configuration.getAccessKey();
+
+ Map parameters = new HashMap();
+ // 加入公共请求参数
+ parameters.put("SignatureMethod", signatureMethod);
+ parameters.put("SignatureNonce", nonce);
+ parameters.put("SignatureVersion", signatureVersion);
+ parameters.put("AccessKey", accessKey);
+ parameters.put("Timestamp", timestamp);
+
+ if (queryParams != null && !queryParams.isEmpty()) {
+ parameters.putAll(queryParams);
+ }
+
+ if (formParams != null && !formParams.isEmpty()) {
+ for (Entry param : formParams.entrySet()) {
+ parameters.put(param.getKey(), parameterToString(param.getValue()));
+ }
+ }
+
+ try {
+ Map headers = new HashMap();
+ headers.put("Signature", md5(getSignRaw(parameters, method, configuration.getSecretKey())));
+ headers.put("Accesskey", accessKey);
+ headers.put("Signaturenonce", nonce);
+ headers.put("Signatureversion", signatureVersion);
+ headers.put("Timestamp", timestamp);
+ headers.put("Signaturemethod", signatureMethod);
+
+ return headers;
+ } catch (Exception e) {
+ throw new ApiException(e);
+ }
+ }
+
+ private static String getSignRaw(Map parameters, String method, String sk) throws Exception {
+ return sk + "&" + keySignInput(parameters, method);
+ }
+
+ private static String keySignInput(Map parameters, String method) throws Exception {
+
+ Map order = new TreeMap<>(parameters);
+ StringBuilder stringToSign = new StringBuilder();
+ stringToSign.append(method).append("&").append(encode("/"));
+
+ List keyValPairs = new ArrayList<>();
+ for (Entry param : order.entrySet()) {
+ keyValPairs.add(param.getKey() + "=" + encode(param.getValue()));
+ }
+ String queryString = join(keyValPairs, "&");
+
+ stringToSign.append("&").append(encode(queryString));
+ return stringToSign.toString();
+
+ }
+
+ private static String encode(String stringToEncode) throws Exception {
+ return URLEncoder.encode(stringToEncode, "utf8").replaceAll("\\+", "%20").replaceAll("\\*", "%2A").replaceAll("%7E", "~");
+ }
+
+ private static String md5(String str) throws Exception {
+ MessageDigest md = MessageDigest.getInstance("MD5");
+ md.update(str.getBytes());
+ byte[] digest = md.digest();
+ return DatatypeConverter.printHexBinary(digest).toLowerCase();
+ }
+}
diff --git a/src/main/java/com/alibaba/yjopenapi/client/api/ApiException.java b/src/main/java/com/alibaba/yjopenapi/client/api/ApiException.java
new file mode 100644
index 000000000..580630767
--- /dev/null
+++ b/src/main/java/com/alibaba/yjopenapi/client/api/ApiException.java
@@ -0,0 +1,83 @@
+/*
+ *
+ * YuanJing OpenAPI SDK
+ *
+ */
+
+package com.alibaba.yjopenapi.client.api;
+
+import java.util.Map;
+import java.util.List;
+
+public class ApiException extends Exception {
+ private int code = 0;
+ private Map> responseHeaders = null;
+ private String responseBody = null;
+
+ public ApiException() {}
+
+ public ApiException(Throwable throwable) {
+ super(throwable);
+ }
+
+ public ApiException(String message) {
+ super(message);
+ }
+
+ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) {
+ super(message, throwable);
+ this.code = code;
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ public ApiException(String message, int code, Map> responseHeaders, String responseBody) {
+ this(message, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) {
+ this(message, throwable, code, responseHeaders, null);
+ }
+
+ public ApiException(int code, Map> responseHeaders, String responseBody) {
+ this((String) null, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ public ApiException(int code, String message) {
+ super(message);
+ this.code = code;
+ }
+
+ public ApiException(int code, String message, Map> responseHeaders, String responseBody) {
+ this(code, message);
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ /**
+ * Get the HTTP status code.
+ *
+ * @return HTTP status code
+ */
+ public int getCode() {
+ return code;
+ }
+
+ /**
+ * Get the HTTP response headers.
+ *
+ * @return A map of list of string
+ */
+ public Map> getResponseHeaders() {
+ return responseHeaders;
+ }
+
+ /**
+ * Get the HTTP response body.
+ *
+ * @return Response body in the form of string
+ */
+ public String getResponseBody() {
+ return responseBody;
+ }
+}
diff --git a/src/main/java/com/alibaba/yjopenapi/client/api/ApiResponse.java b/src/main/java/com/alibaba/yjopenapi/client/api/ApiResponse.java
new file mode 100644
index 000000000..cd495f22e
--- /dev/null
+++ b/src/main/java/com/alibaba/yjopenapi/client/api/ApiResponse.java
@@ -0,0 +1,52 @@
+/*
+ *
+ * YuanJing OpenAPI SDK
+ *
+ */
+
+package com.alibaba.yjopenapi.client.api;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * API response returned by API call.
+ *
+ * @param The type of data that is deserialized from response body
+ */
+public class ApiResponse {
+ final private int statusCode;
+ final private Map> headers;
+ final private T data;
+
+ /**
+ * @param statusCode The status code of HTTP response
+ * @param headers The headers of HTTP response
+ */
+ public ApiResponse(int statusCode, Map> headers) {
+ this(statusCode, headers, null);
+ }
+
+ /**
+ * @param statusCode The status code of HTTP response
+ * @param headers The headers of HTTP response
+ * @param data The object deserialized from response bod
+ */
+ public ApiResponse(int statusCode, Map> headers, T data) {
+ this.statusCode = statusCode;
+ this.headers = headers;
+ this.data = data;
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public Map> getHeaders() {
+ return headers;
+ }
+
+ public T getData() {
+ return data;
+ }
+}
diff --git a/src/main/java/com/alibaba/yjopenapi/client/api/Configuration.java b/src/main/java/com/alibaba/yjopenapi/client/api/Configuration.java
new file mode 100644
index 000000000..f28a115f0
--- /dev/null
+++ b/src/main/java/com/alibaba/yjopenapi/client/api/Configuration.java
@@ -0,0 +1,212 @@
+/*
+ *
+ * YuanJing OpenAPI SDK
+ *
+ */
+
+package com.alibaba.yjopenapi.client.api;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class Configuration {
+
+ private static Configuration defaultConfiguration = new Configuration();
+
+ /**
+ * DefaultHeaders
+ *
+ */
+ protected Map defaultHeaders = new HashMap();
+
+ /**
+ * SignatureVersion
+ *
+ */
+ protected String signatureVersion = "1.0";
+
+ /**
+ * SignatureMethod
+ *
+ */
+ protected String signatureMethod = "MD5";
+
+ /**
+ * AccessKey
+ *
+ */
+ protected String accessKey = null;
+
+ /**
+ * SecretKey
+ *
+ */
+ protected String secretKey = null;
+
+ /**
+ * HTTP scheme
+ *
+ */
+ protected String scheme = "https";
+
+ /**
+ * Host
+ *
+ */
+ protected String host = "/";
+
+ /**
+ *
+ * @return default configuration
+ */
+ public static Configuration getDefaultConfiguration() {
+ return defaultConfiguration;
+ }
+
+ /**
+ *
+ * @return headers
+ */
+ public Map getDefaultHeaders() {
+ return defaultHeaders;
+ }
+
+ /**
+ * @param key
+ * @param value
+ */
+ public Configuration addHeader(String key, String value) {
+ this.defaultHeaders.put(key, value);
+ return this;
+ }
+
+ public void setHeaders(Map headers) {
+ this.defaultHeaders = headers;
+ }
+
+ /**
+ *
+ * @return signature version
+ */
+ public String getSignatureVersion() {
+ return signatureVersion;
+ }
+
+ /**
+ *
+ * @param signatureVersion
+ */
+ public Configuration signatureVersion(String signatureVersion) {
+ this.signatureVersion = signatureVersion;
+ return this;
+ }
+
+ public void setSignatureVersion(String signatureVersion) {
+ this.signatureVersion = signatureVersion;
+ }
+
+ /**
+ *
+ * @return signature method
+ */
+ public String getSignatureMethod() {
+ return signatureMethod;
+ }
+
+ /**
+ *
+ * @param signatureMethod
+ */
+ public Configuration signatureMethod(String signatureMethod) {
+ this.signatureMethod = signatureMethod;
+ return this;
+ }
+
+ public void setSignatureMethod(String signatureMethod) {
+ this.signatureMethod = signatureMethod;
+ }
+
+ /**
+ *
+ * @return access key
+ */
+ public String getAccessKey() {
+ return accessKey;
+ }
+
+ /**
+ *
+ * @param accessKey
+ */
+ public Configuration accessKey(String accessKey) {
+ this.accessKey = accessKey;
+ return this;
+ }
+
+ public void setAccessKey(String accessKey) {
+ this.accessKey = accessKey;
+ }
+
+ /**
+ *
+ * @return secret key
+ */
+ public String getSecretKey() {
+ return secretKey;
+ }
+
+ /**
+ *
+ * @param secretKey
+ */
+ public Configuration secretKey(String secretKey) {
+ this.secretKey = secretKey;
+ return this;
+ }
+
+ public void setSecretKey(String secretKey) {
+ this.secretKey = secretKey;
+ }
+
+ /**
+ *
+ * @return scheme
+ */
+ public String getScheme() {
+ return scheme;
+ }
+
+ /**
+ *
+ * @param scheme
+ */
+ public Configuration scheme(String scheme) {
+ this.scheme = scheme;
+ return this;
+ }
+
+ public void setScheme(String scheme) {
+ this.scheme = scheme;
+ }
+
+ /**
+ *
+ * @return host
+ */
+ public String getHost() {
+ return host;
+ }
+
+ /**
+ *
+ * @param host
+ */
+ public Configuration host(String host) {
+ this.host = host;
+ return this;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+}
diff --git a/src/main/java/com/alibaba/yjopenapi/client/api/ConsoleAdminApi.java b/src/main/java/com/alibaba/yjopenapi/client/api/ConsoleAdminApi.java
new file mode 100644
index 000000000..926ed0edc
--- /dev/null
+++ b/src/main/java/com/alibaba/yjopenapi/client/api/ConsoleAdminApi.java
@@ -0,0 +1,3391 @@
+/*
+ *
+ * YuanJing OpenAPI SDK
+ *
+ */
+
+package com.alibaba.yjopenapi.client.api;
+
+import java.io.IOException;
+
+import com.alibaba.yjopenapi.client.model.ConsoleAdminActivateDeploymentResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminAdaptGameVersionResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminAddGameToProjectResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminBatchUpdateDispatchConfigFormsConfigList;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminBatchUpdateDispatchConfigResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminCreateGameResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminCreateOrderFormsAttributeRequestList;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminCreateOrderResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminCreateProjectResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminDeleteGameResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminDeleteGameVersionResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminDeleteProjectResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminGetBillFlowInfoResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminGetGameInstanceContainerRatioFormsGames;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminGetGameInstanceContainerRatioResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminGetGameRecommendedInstanceFormsGame;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminGetGameRecommendedInstanceResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminGetGameVersionProgressResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminGetGameVersionResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminGetOrderResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListActivateableInstancesResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListActivatedInstancesResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListControllersOfGameResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListDeployableInstancesResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListGameCcuResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListGameDeployDetailsOfProjectResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListGameVersionsResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListGamesResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListInstancesOfProjectResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListMonthBillResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListProjectsResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminListVersionDeployInstancesResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminQueryAdaptResultByVersionIdResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminRecommendSpecificationResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminRemoveGameFromProjectResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminRtOverViewResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminRtTrendResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminSubmitDeploymentResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminSubmitRefundResult;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminUploadGameVersionByDownloadFormsDownloadType;
+import com.alibaba.yjopenapi.client.model.ConsoleAdminUploadGameVersionByDownloadResult;
+
+import com.alibaba.yjopenapi.client.model.*;
+
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ConsoleAdminApi {
+ private ApiClient apiClient;
+ private Configuration configuration;
+
+ public ConsoleAdminApi() {
+ this(new ApiClient(), Configuration.getDefaultConfiguration());
+ }
+
+ public ConsoleAdminApi(ApiClient apiClient, Configuration configuration) {
+ this.apiClient = apiClient;
+ this.configuration = configuration;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public Configuration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(Configuration configuration) {
+ this.configuration = configuration;
+ }
+
+ /**
+ * Build call for activateDeployment
+ * @param varForms ConsoleAdminActivateDeploymentForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call activateDeploymentCall(ConsoleAdminActivateDeploymentForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/consoleAdmin/activateDeployment";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("gameId", varForms.getGameId());
+ localVarFormParams.put("projectId", varForms.getProjectId());
+ localVarFormParams.put("versionId", varForms.getVersionId());
+ if (varForms.getMaxConcurrency() != null) {
+ localVarFormParams.put("maxConcurrency", varForms.getMaxConcurrency());
+ }
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call activateDeploymentValidateBeforeCall(ConsoleAdminActivateDeploymentForms varForms) throws ApiException {
+ // verify the required parameter 'gameId' is set
+ if (varForms.getGameId() == null) {
+ throw new ApiException("Missing the required parameter 'gameId' when calling activateDeployment(Async)");
+ }
+ // verify the required parameter 'projectId' is set
+ if (varForms.getProjectId() == null) {
+ throw new ApiException("Missing the required parameter 'projectId' when calling activateDeployment(Async)");
+ }
+ // verify the required parameter 'versionId' is set
+ if (varForms.getVersionId() == null) {
+ throw new ApiException("Missing the required parameter 'versionId' when calling activateDeployment(Async)");
+ }
+
+ com.squareup.okhttp.Call call = activateDeploymentCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ *
+ * @param varForms ConsoleAdminActivateDeploymentForms
+ * @return ConsoleAdminActivateDeploymentResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ConsoleAdminActivateDeploymentResult activateDeployment(ConsoleAdminActivateDeploymentForms varForms) throws ApiException {
+ ApiResponse resp = activateDeploymentWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ *
+ * @param varForms ConsoleAdminActivateDeploymentForms
+ * @return ApiResponse<ConsoleAdminActivateDeploymentResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse activateDeploymentWithHttpInfo(ConsoleAdminActivateDeploymentForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = activateDeploymentValidateBeforeCall(varForms);
+ return apiClient.execute(call, ConsoleAdminActivateDeploymentResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ *
+ * @param varForms ConsoleAdminActivateDeploymentForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call activateDeploymentAsync(ConsoleAdminActivateDeploymentForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = activateDeploymentValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, ConsoleAdminActivateDeploymentResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for adaptGameVersion
+ * @param varForms ConsoleAdminAdaptGameVersionForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call adaptGameVersionCall(ConsoleAdminAdaptGameVersionForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/consoleAdmin/adaptGameVersion";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("versionId", varForms.getVersionId());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call adaptGameVersionValidateBeforeCall(ConsoleAdminAdaptGameVersionForms varForms) throws ApiException {
+ // verify the required parameter 'versionId' is set
+ if (varForms.getVersionId() == null) {
+ throw new ApiException("Missing the required parameter 'versionId' when calling adaptGameVersion(Async)");
+ }
+
+ com.squareup.okhttp.Call call = adaptGameVersionCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ *
+ * @param varForms ConsoleAdminAdaptGameVersionForms
+ * @return ConsoleAdminAdaptGameVersionResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ConsoleAdminAdaptGameVersionResult adaptGameVersion(ConsoleAdminAdaptGameVersionForms varForms) throws ApiException {
+ ApiResponse resp = adaptGameVersionWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ *
+ * @param varForms ConsoleAdminAdaptGameVersionForms
+ * @return ApiResponse<ConsoleAdminAdaptGameVersionResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse adaptGameVersionWithHttpInfo(ConsoleAdminAdaptGameVersionForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = adaptGameVersionValidateBeforeCall(varForms);
+ return apiClient.execute(call, ConsoleAdminAdaptGameVersionResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ *
+ * @param varForms ConsoleAdminAdaptGameVersionForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call adaptGameVersionAsync(ConsoleAdminAdaptGameVersionForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = adaptGameVersionValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, ConsoleAdminAdaptGameVersionResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for addGameToProject
+ * @param varForms ConsoleAdminAddGameToProjectForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call addGameToProjectCall(ConsoleAdminAddGameToProjectForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/consoleAdmin/addGameToProject";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("projectId", varForms.getProjectId());
+ localVarFormParams.put("gameId", varForms.getGameId());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call addGameToProjectValidateBeforeCall(ConsoleAdminAddGameToProjectForms varForms) throws ApiException {
+ // verify the required parameter 'projectId' is set
+ if (varForms.getProjectId() == null) {
+ throw new ApiException("Missing the required parameter 'projectId' when calling addGameToProject(Async)");
+ }
+ // verify the required parameter 'gameId' is set
+ if (varForms.getGameId() == null) {
+ throw new ApiException("Missing the required parameter 'gameId' when calling addGameToProject(Async)");
+ }
+
+ com.squareup.okhttp.Call call = addGameToProjectCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ *
+ * @param varForms ConsoleAdminAddGameToProjectForms
+ * @return ConsoleAdminAddGameToProjectResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ConsoleAdminAddGameToProjectResult addGameToProject(ConsoleAdminAddGameToProjectForms varForms) throws ApiException {
+ ApiResponse resp = addGameToProjectWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ *
+ * @param varForms ConsoleAdminAddGameToProjectForms
+ * @return ApiResponse<ConsoleAdminAddGameToProjectResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse addGameToProjectWithHttpInfo(ConsoleAdminAddGameToProjectForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = addGameToProjectValidateBeforeCall(varForms);
+ return apiClient.execute(call, ConsoleAdminAddGameToProjectResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ *
+ * @param varForms ConsoleAdminAddGameToProjectForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call addGameToProjectAsync(ConsoleAdminAddGameToProjectForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = addGameToProjectValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, ConsoleAdminAddGameToProjectResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for batchUpdateDispatchConfig
+ * @param varForms ConsoleAdminBatchUpdateDispatchConfigForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call batchUpdateDispatchConfigCall(ConsoleAdminBatchUpdateDispatchConfigForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/consoleAdmin/batchUpdateDispatchConfig";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("mixProjectId", varForms.getMixProjectId());
+ localVarFormParams.put("instanceId", varForms.getInstanceId());
+ localVarFormParams.put("appName", varForms.getAppName());
+ localVarFormParams.put("configList", varForms.getConfigList());
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call batchUpdateDispatchConfigValidateBeforeCall(ConsoleAdminBatchUpdateDispatchConfigForms varForms) throws ApiException {
+ // verify the required parameter 'mixProjectId' is set
+ if (varForms.getMixProjectId() == null) {
+ throw new ApiException("Missing the required parameter 'mixProjectId' when calling batchUpdateDispatchConfig(Async)");
+ }
+ // verify the required parameter 'instanceId' is set
+ if (varForms.getInstanceId() == null) {
+ throw new ApiException("Missing the required parameter 'instanceId' when calling batchUpdateDispatchConfig(Async)");
+ }
+ // verify the required parameter 'appName' is set
+ if (varForms.getAppName() == null) {
+ throw new ApiException("Missing the required parameter 'appName' when calling batchUpdateDispatchConfig(Async)");
+ }
+ // verify the required parameter 'configList' is set
+ if (varForms.getConfigList() == null) {
+ throw new ApiException("Missing the required parameter 'configList' when calling batchUpdateDispatchConfig(Async)");
+ }
+
+ com.squareup.okhttp.Call call = batchUpdateDispatchConfigCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ * 批量更新游戏各自调度配置
+ * @param varForms ConsoleAdminBatchUpdateDispatchConfigForms
+ * @return ConsoleAdminBatchUpdateDispatchConfigResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ConsoleAdminBatchUpdateDispatchConfigResult batchUpdateDispatchConfig(ConsoleAdminBatchUpdateDispatchConfigForms varForms) throws ApiException {
+ ApiResponse resp = batchUpdateDispatchConfigWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ * 批量更新游戏各自调度配置
+ * @param varForms ConsoleAdminBatchUpdateDispatchConfigForms
+ * @return ApiResponse<ConsoleAdminBatchUpdateDispatchConfigResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse batchUpdateDispatchConfigWithHttpInfo(ConsoleAdminBatchUpdateDispatchConfigForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = batchUpdateDispatchConfigValidateBeforeCall(varForms);
+ return apiClient.execute(call, ConsoleAdminBatchUpdateDispatchConfigResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ * 批量更新游戏各自调度配置
+ * @param varForms ConsoleAdminBatchUpdateDispatchConfigForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call batchUpdateDispatchConfigAsync(ConsoleAdminBatchUpdateDispatchConfigForms varForms, final ApiCallback callback) throws ApiException {
+
+ com.squareup.okhttp.Call call = batchUpdateDispatchConfigValidateBeforeCall(varForms);
+ apiClient.executeAsync(call, ConsoleAdminBatchUpdateDispatchConfigResult.class, callback);
+ return call;
+ }
+ /**
+ * Build call for createGame
+ * @param varForms ConsoleAdminCreateGameForms
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ */
+ public com.squareup.okhttp.Call createGameCall(ConsoleAdminCreateGameForms varForms) throws ApiException {
+
+ // create path and map variables
+ String localVarPath = "/consoleAdmin/createGame";
+
+ Map localVarQueryParams = new HashMap();
+
+ Map localVarHeaderParams = new HashMap();
+
+ Map localVarFormParams = new HashMap();
+ localVarFormParams.put("gameName", varForms.getGameName());
+ localVarFormParams.put("platformType", varForms.getPlatformType());
+ if (varForms.getOsType() != null) {
+ localVarFormParams.put("osType", varForms.getOsType());
+ }
+
+ final List localVarAccepts = Arrays.asList(
+ "application/json"
+ );
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final List localVarContentTypes = Arrays.asList(
+ "application/x-www-form-urlencoded"
+ );
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+
+ String path = configuration.getScheme() + "://" + configuration.getHost() + localVarPath;
+ return apiClient.buildCall(path, "POST", localVarQueryParams, localVarHeaderParams, localVarFormParams, configuration);
+ }
+
+ private com.squareup.okhttp.Call createGameValidateBeforeCall(ConsoleAdminCreateGameForms varForms) throws ApiException {
+ // verify the required parameter 'gameName' is set
+ if (varForms.getGameName() == null) {
+ throw new ApiException("Missing the required parameter 'gameName' when calling createGame(Async)");
+ }
+ // verify the required parameter 'platformType' is set
+ if (varForms.getPlatformType() == null) {
+ throw new ApiException("Missing the required parameter 'platformType' when calling createGame(Async)");
+ }
+
+ com.squareup.okhttp.Call call = createGameCall(varForms);
+ return call;
+ }
+
+ /**
+ *
+ *
+ * @param varForms ConsoleAdminCreateGameForms
+ * @return ConsoleAdminCreateGameResult
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ConsoleAdminCreateGameResult createGame(ConsoleAdminCreateGameForms varForms) throws ApiException {
+ ApiResponse resp = createGameWithHttpInfo(varForms);
+ return resp.getData();
+ }
+
+ /**
+ *
+ *
+ * @param varForms ConsoleAdminCreateGameForms
+ * @return ApiResponse<ConsoleAdminCreateGameResult>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ */
+ public ApiResponse createGameWithHttpInfo(ConsoleAdminCreateGameForms varForms) throws ApiException {
+ com.squareup.okhttp.Call call = createGameValidateBeforeCall(varForms);
+ return apiClient.execute(call, ConsoleAdminCreateGameResult.class);
+ }
+
+ /**
+ * (asynchronously)
+ *
+ * @param varForms ConsoleAdminCreateGameForms
+ * @param callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ */
+ public com.squareup.okhttp.Call createGameAsync(ConsoleAdminCreateGameForms varForms, final ApiCallback