All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alipay.v3.api.AlipayMarketingActivityOrdervoucherApi Maven / Gradle / Ivy

There is a newer version: 3.1.6.ALL
Show newest version
/*
 * 支付宝开放平台API
 * 支付宝开放平台v3协议文档
 *
 * The version of the OpenAPI document: 2024-01-12
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.alipay.v3.api;

import com.alipay.v3.ApiCallback;
import com.alipay.v3.ApiClient;
import com.alipay.v3.ApiException;
import com.alipay.v3.ApiResponse;
import com.alipay.v3.Configuration;
import com.alipay.v3.Pair;
import com.alipay.v3.ProgressRequestBody;
import com.alipay.v3.ProgressResponseBody;
import com.alipay.v3.util.AlipayLogger;
import com.alipay.v3.util.model.CustomizedParams;

import com.google.common.base.Strings;
import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherAppendDefaultResponse;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherAppendModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherAssociateDefaultResponse;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherAssociateModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherAssociateResponseModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherCodecountDefaultResponse;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherCodecountResponseModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherCodedepositDefaultResponse;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherCodedepositModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherCodedepositResponseModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherCreateDefaultResponse;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherCreateModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherCreateResponseModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherDisassociateDefaultResponse;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherDisassociateModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherDisassociateResponseModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherModifyDefaultResponse;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherModifyModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherModifyResponseModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherQueryDefaultResponse;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherQueryResponseModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherRefundDefaultResponse;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherRefundModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherRefundResponseModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherStopDefaultResponse;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherStopModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherUseDefaultResponse;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherUseModel;
import com.alipay.v3.model.AlipayMarketingActivityOrdervoucherUseResponseModel;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;

public class AlipayMarketingActivityOrdervoucherApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

    public AlipayMarketingActivityOrdervoucherApi() {
        this(Configuration.getDefaultApiClient());
    }

    public AlipayMarketingActivityOrdervoucherApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public int getHostIndex() {
        return localHostIndex;
    }

    public void setHostIndex(int hostIndex) {
        this.localHostIndex = hostIndex;
    }

    public String getCustomBaseUrl() {
        return localCustomBaseUrl;
    }

    public void setCustomBaseUrl(String customBaseUrl) {
        this.localCustomBaseUrl = customBaseUrl;
    }

    /**
     * Build call for append
     * @param activityId 活动id (required)
     * @param alipayMarketingActivityOrdervoucherAppendModel  (optional)
     * @param _callback Callback for upload/download progress
     * @param customizedParams
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call appendCall(String activityId, AlipayMarketingActivityOrdervoucherAppendModel alipayMarketingActivityOrdervoucherAppendModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent())) ? customizedParams.getBodyContent() : alipayMarketingActivityOrdervoucherAppendModel; // create path and map variables String localVarPath = "/v3/alipay/marketing/ordervoucher/activity/{activity_id}/append" .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } if (customizedParams != null) { //额外query参数 if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) { for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue())); } } if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) { localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken()); } //额外非全局header参数 if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) { localVarHeaderParams.putAll(customizedParams.getHeaderParams()); } } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call appendValidateBeforeCall(String activityId, AlipayMarketingActivityOrdervoucherAppendModel alipayMarketingActivityOrdervoucherAppendModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { // verify the required parameter 'activityId' is set if (activityId == null) { throw new ApiException("Missing the required parameter 'activityId' when calling append(Async)"); } okhttp3.Call localVarCall = appendCall(activityId, alipayMarketingActivityOrdervoucherAppendModel, _callback, customizedParams); return localVarCall; } /** * 修改商家券活动发券数量上限 * 商家调用该接口修改商家券活动预算上限,以此来追加商家券活动预算。 修改商家券活动预算上限同步返回追加请求受理结果,后续通过alipay.marketing.activity.message.appended消息接口异步发送发券数量上限修改成功事件消息。 code_mode=MERCHANT_UPLOAD场景下,必须先导入券码后,方可追加商家券预算。 * @param activityId 活动id (required) * @param alipayMarketingActivityOrdervoucherAppendModel (optional) * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public Object append(String activityId, AlipayMarketingActivityOrdervoucherAppendModel alipayMarketingActivityOrdervoucherAppendModel) throws ApiException { ApiResponse localVarResp = appendWithHttpInfo(activityId, alipayMarketingActivityOrdervoucherAppendModel, null); return localVarResp.getData(); } public Object append(String activityId, AlipayMarketingActivityOrdervoucherAppendModel alipayMarketingActivityOrdervoucherAppendModel, CustomizedParams customizedParams) throws ApiException { ApiResponse localVarResp = appendWithHttpInfo(activityId, alipayMarketingActivityOrdervoucherAppendModel, customizedParams); return localVarResp.getData(); } /** * 修改商家券活动发券数量上限 * 商家调用该接口修改商家券活动预算上限,以此来追加商家券活动预算。 修改商家券活动预算上限同步返回追加请求受理结果,后续通过alipay.marketing.activity.message.appended消息接口异步发送发券数量上限修改成功事件消息。 code_mode=MERCHANT_UPLOAD场景下,必须先导入券码后,方可追加商家券预算。 * @param activityId 活动id (required) * @param alipayMarketingActivityOrdervoucherAppendModel (optional) * @return ApiResponse<Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public ApiResponse appendWithHttpInfo(String activityId, AlipayMarketingActivityOrdervoucherAppendModel alipayMarketingActivityOrdervoucherAppendModel, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = appendValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherAppendModel, null, customizedParams); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { try { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); } catch (Exception ex) { AlipayLogger.logBizWarn(ex); } throw e; } } /** * 修改商家券活动发券数量上限 (asynchronously) * 商家调用该接口修改商家券活动预算上限,以此来追加商家券活动预算。 修改商家券活动预算上限同步返回追加请求受理结果,后续通过alipay.marketing.activity.message.appended消息接口异步发送发券数量上限修改成功事件消息。 code_mode=MERCHANT_UPLOAD场景下,必须先导入券码后,方可追加商家券预算。 * @param activityId 活动id (required) * @param alipayMarketingActivityOrdervoucherAppendModel (optional) * @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 * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call appendAsync(String activityId, AlipayMarketingActivityOrdervoucherAppendModel alipayMarketingActivityOrdervoucherAppendModel, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = appendValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherAppendModel, _callback, null); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public okhttp3.Call appendAsync(String activityId, AlipayMarketingActivityOrdervoucherAppendModel alipayMarketingActivityOrdervoucherAppendModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = appendValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherAppendModel, _callback, customizedParams); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for associate * @param alipayMarketingActivityOrdervoucherAssociateModel (optional) * @param _callback Callback for upload/download progress * @param customizedParams * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call associateCall(AlipayMarketingActivityOrdervoucherAssociateModel alipayMarketingActivityOrdervoucherAssociateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent())) ? customizedParams.getBodyContent() : alipayMarketingActivityOrdervoucherAssociateModel; // create path and map variables String localVarPath = "/v3/alipay/marketing/activity/ordervoucher/associate"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } if (customizedParams != null) { //额外query参数 if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) { for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue())); } } if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) { localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken()); } //额外非全局header参数 if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) { localVarHeaderParams.putAll(customizedParams.getHeaderParams()); } } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call associateValidateBeforeCall(AlipayMarketingActivityOrdervoucherAssociateModel alipayMarketingActivityOrdervoucherAssociateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = associateCall(alipayMarketingActivityOrdervoucherAssociateModel, _callback, customizedParams); return localVarCall; } /** * 关联订单信息 * 将已发放的商家券券码与订单信息关联,用于后续参与返佣激励等操作的统计。 * @param alipayMarketingActivityOrdervoucherAssociateModel (optional) * @return AlipayMarketingActivityOrdervoucherAssociateResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public AlipayMarketingActivityOrdervoucherAssociateResponseModel associate(AlipayMarketingActivityOrdervoucherAssociateModel alipayMarketingActivityOrdervoucherAssociateModel) throws ApiException { ApiResponse localVarResp = associateWithHttpInfo(alipayMarketingActivityOrdervoucherAssociateModel, null); return localVarResp.getData(); } public AlipayMarketingActivityOrdervoucherAssociateResponseModel associate(AlipayMarketingActivityOrdervoucherAssociateModel alipayMarketingActivityOrdervoucherAssociateModel, CustomizedParams customizedParams) throws ApiException { ApiResponse localVarResp = associateWithHttpInfo(alipayMarketingActivityOrdervoucherAssociateModel, customizedParams); return localVarResp.getData(); } /** * 关联订单信息 * 将已发放的商家券券码与订单信息关联,用于后续参与返佣激励等操作的统计。 * @param alipayMarketingActivityOrdervoucherAssociateModel (optional) * @return ApiResponse<AlipayMarketingActivityOrdervoucherAssociateResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public ApiResponse associateWithHttpInfo(AlipayMarketingActivityOrdervoucherAssociateModel alipayMarketingActivityOrdervoucherAssociateModel, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = associateValidateBeforeCall(alipayMarketingActivityOrdervoucherAssociateModel, null, customizedParams); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { try { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); } catch (Exception ex) { AlipayLogger.logBizWarn(ex); } throw e; } } /** * 关联订单信息 (asynchronously) * 将已发放的商家券券码与订单信息关联,用于后续参与返佣激励等操作的统计。 * @param alipayMarketingActivityOrdervoucherAssociateModel (optional) * @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 * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call associateAsync(AlipayMarketingActivityOrdervoucherAssociateModel alipayMarketingActivityOrdervoucherAssociateModel, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = associateValidateBeforeCall(alipayMarketingActivityOrdervoucherAssociateModel, _callback, null); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public okhttp3.Call associateAsync(AlipayMarketingActivityOrdervoucherAssociateModel alipayMarketingActivityOrdervoucherAssociateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = associateValidateBeforeCall(alipayMarketingActivityOrdervoucherAssociateModel, _callback, customizedParams); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for codecount * @param activityId 活动id (required) * @param merchantAccessMode 商户接入模式 (optional) * @param _callback Callback for upload/download progress * @param customizedParams * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call codecountCall(String activityId, String merchantAccessMode, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/v3/alipay/marketing/ordervoucher/activity/{activity_id}/voucher/codecount" .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (merchantAccessMode != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("merchant_access_mode", merchantAccessMode)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } if (customizedParams != null) { //额外query参数 if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) { for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue())); } } if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) { localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken()); } //额外非全局header参数 if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) { localVarHeaderParams.putAll(customizedParams.getHeaderParams()); } } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call codecountValidateBeforeCall(String activityId, String merchantAccessMode, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { // verify the required parameter 'activityId' is set if (activityId == null) { throw new ApiException("Missing the required parameter 'activityId' when calling codecount(Async)"); } okhttp3.Call localVarCall = codecountCall(activityId, merchantAccessMode, _callback, customizedParams); return localVarCall; } /** * 统计商家券券码数量 * 商家调用该接口查询活动中的有效券码个数。接口同步返回查询结果。 * @param activityId 活动id (required) * @param merchantAccessMode 商户接入模式 (optional) * @return AlipayMarketingActivityOrdervoucherCodecountResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public AlipayMarketingActivityOrdervoucherCodecountResponseModel codecount(String activityId, String merchantAccessMode) throws ApiException { ApiResponse localVarResp = codecountWithHttpInfo(activityId, merchantAccessMode, null); return localVarResp.getData(); } public AlipayMarketingActivityOrdervoucherCodecountResponseModel codecount(String activityId, String merchantAccessMode, CustomizedParams customizedParams) throws ApiException { ApiResponse localVarResp = codecountWithHttpInfo(activityId, merchantAccessMode, customizedParams); return localVarResp.getData(); } /** * 统计商家券券码数量 * 商家调用该接口查询活动中的有效券码个数。接口同步返回查询结果。 * @param activityId 活动id (required) * @param merchantAccessMode 商户接入模式 (optional) * @return ApiResponse<AlipayMarketingActivityOrdervoucherCodecountResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public ApiResponse codecountWithHttpInfo(String activityId, String merchantAccessMode, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = codecountValidateBeforeCall(activityId, merchantAccessMode, null, customizedParams); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { try { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); } catch (Exception ex) { AlipayLogger.logBizWarn(ex); } throw e; } } /** * 统计商家券券码数量 (asynchronously) * 商家调用该接口查询活动中的有效券码个数。接口同步返回查询结果。 * @param activityId 活动id (required) * @param merchantAccessMode 商户接入模式 (optional) * @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 * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call codecountAsync(String activityId, String merchantAccessMode, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = codecountValidateBeforeCall(activityId, merchantAccessMode, _callback, null); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public okhttp3.Call codecountAsync(String activityId, String merchantAccessMode, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = codecountValidateBeforeCall(activityId, merchantAccessMode, _callback, customizedParams); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for codedeposit * @param activityId 活动id (required) * @param alipayMarketingActivityOrdervoucherCodedepositModel (optional) * @param _callback Callback for upload/download progress * @param customizedParams * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call codedepositCall(String activityId, AlipayMarketingActivityOrdervoucherCodedepositModel alipayMarketingActivityOrdervoucherCodedepositModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent())) ? customizedParams.getBodyContent() : alipayMarketingActivityOrdervoucherCodedepositModel; // create path and map variables String localVarPath = "/v3/alipay/marketing/ordervoucher/activity/{activity_id}/voucher/codedeposit" .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } if (customizedParams != null) { //额外query参数 if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) { for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue())); } } if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) { localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken()); } //额外非全局header参数 if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) { localVarHeaderParams.putAll(customizedParams.getHeaderParams()); } } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call codedepositValidateBeforeCall(String activityId, AlipayMarketingActivityOrdervoucherCodedepositModel alipayMarketingActivityOrdervoucherCodedepositModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { // verify the required parameter 'activityId' is set if (activityId == null) { throw new ApiException("Missing the required parameter 'activityId' when calling codedeposit(Async)"); } okhttp3.Call localVarCall = codedepositCall(activityId, alipayMarketingActivityOrdervoucherCodedepositModel, _callback, customizedParams); return localVarCall; } /** * 同步商家券券码 * 商家调用该接口同步导入商家券券码,接口同步返回导入结果。请在接收alipay.marketing.activity.message.created消息后,再进行调用。 * @param activityId 活动id (required) * @param alipayMarketingActivityOrdervoucherCodedepositModel (optional) * @return AlipayMarketingActivityOrdervoucherCodedepositResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public AlipayMarketingActivityOrdervoucherCodedepositResponseModel codedeposit(String activityId, AlipayMarketingActivityOrdervoucherCodedepositModel alipayMarketingActivityOrdervoucherCodedepositModel) throws ApiException { ApiResponse localVarResp = codedepositWithHttpInfo(activityId, alipayMarketingActivityOrdervoucherCodedepositModel, null); return localVarResp.getData(); } public AlipayMarketingActivityOrdervoucherCodedepositResponseModel codedeposit(String activityId, AlipayMarketingActivityOrdervoucherCodedepositModel alipayMarketingActivityOrdervoucherCodedepositModel, CustomizedParams customizedParams) throws ApiException { ApiResponse localVarResp = codedepositWithHttpInfo(activityId, alipayMarketingActivityOrdervoucherCodedepositModel, customizedParams); return localVarResp.getData(); } /** * 同步商家券券码 * 商家调用该接口同步导入商家券券码,接口同步返回导入结果。请在接收alipay.marketing.activity.message.created消息后,再进行调用。 * @param activityId 活动id (required) * @param alipayMarketingActivityOrdervoucherCodedepositModel (optional) * @return ApiResponse<AlipayMarketingActivityOrdervoucherCodedepositResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public ApiResponse codedepositWithHttpInfo(String activityId, AlipayMarketingActivityOrdervoucherCodedepositModel alipayMarketingActivityOrdervoucherCodedepositModel, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = codedepositValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherCodedepositModel, null, customizedParams); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { try { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); } catch (Exception ex) { AlipayLogger.logBizWarn(ex); } throw e; } } /** * 同步商家券券码 (asynchronously) * 商家调用该接口同步导入商家券券码,接口同步返回导入结果。请在接收alipay.marketing.activity.message.created消息后,再进行调用。 * @param activityId 活动id (required) * @param alipayMarketingActivityOrdervoucherCodedepositModel (optional) * @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 * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call codedepositAsync(String activityId, AlipayMarketingActivityOrdervoucherCodedepositModel alipayMarketingActivityOrdervoucherCodedepositModel, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = codedepositValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherCodedepositModel, _callback, null); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public okhttp3.Call codedepositAsync(String activityId, AlipayMarketingActivityOrdervoucherCodedepositModel alipayMarketingActivityOrdervoucherCodedepositModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = codedepositValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherCodedepositModel, _callback, customizedParams); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for create * @param alipayMarketingActivityOrdervoucherCreateModel (optional) * @param _callback Callback for upload/download progress * @param customizedParams * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call createCall(AlipayMarketingActivityOrdervoucherCreateModel alipayMarketingActivityOrdervoucherCreateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent())) ? customizedParams.getBodyContent() : alipayMarketingActivityOrdervoucherCreateModel; // create path and map variables String localVarPath = "/v3/alipay/marketing/ordervoucher/activity"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } if (customizedParams != null) { //额外query参数 if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) { for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue())); } } if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) { localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken()); } //额外非全局header参数 if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) { localVarHeaderParams.putAll(customizedParams.getHeaderParams()); } } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createValidateBeforeCall(AlipayMarketingActivityOrdervoucherCreateModel alipayMarketingActivityOrdervoucherCreateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = createCall(alipayMarketingActivityOrdervoucherCreateModel, _callback, customizedParams); return localVarCall; } /** * 创建商家券活动 * 商家调用该接口创建商家券活动。 创建商家券活动接口同步返回创建请求受理结果,后续通过alipay.marketing.activity.message.created消息接口异步发送活动创建成功事件消息。 如果在code_mode=MERCHANT_UPLOAD的模式下,创建商家券活动后,还需要进行券码导入操作,以及预算追加操作,然后商家券才能进行发放。 * @param alipayMarketingActivityOrdervoucherCreateModel (optional) * @return AlipayMarketingActivityOrdervoucherCreateResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public AlipayMarketingActivityOrdervoucherCreateResponseModel create(AlipayMarketingActivityOrdervoucherCreateModel alipayMarketingActivityOrdervoucherCreateModel) throws ApiException { ApiResponse localVarResp = createWithHttpInfo(alipayMarketingActivityOrdervoucherCreateModel, null); return localVarResp.getData(); } public AlipayMarketingActivityOrdervoucherCreateResponseModel create(AlipayMarketingActivityOrdervoucherCreateModel alipayMarketingActivityOrdervoucherCreateModel, CustomizedParams customizedParams) throws ApiException { ApiResponse localVarResp = createWithHttpInfo(alipayMarketingActivityOrdervoucherCreateModel, customizedParams); return localVarResp.getData(); } /** * 创建商家券活动 * 商家调用该接口创建商家券活动。 创建商家券活动接口同步返回创建请求受理结果,后续通过alipay.marketing.activity.message.created消息接口异步发送活动创建成功事件消息。 如果在code_mode=MERCHANT_UPLOAD的模式下,创建商家券活动后,还需要进行券码导入操作,以及预算追加操作,然后商家券才能进行发放。 * @param alipayMarketingActivityOrdervoucherCreateModel (optional) * @return ApiResponse<AlipayMarketingActivityOrdervoucherCreateResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public ApiResponse createWithHttpInfo(AlipayMarketingActivityOrdervoucherCreateModel alipayMarketingActivityOrdervoucherCreateModel, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = createValidateBeforeCall(alipayMarketingActivityOrdervoucherCreateModel, null, customizedParams); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { try { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); } catch (Exception ex) { AlipayLogger.logBizWarn(ex); } throw e; } } /** * 创建商家券活动 (asynchronously) * 商家调用该接口创建商家券活动。 创建商家券活动接口同步返回创建请求受理结果,后续通过alipay.marketing.activity.message.created消息接口异步发送活动创建成功事件消息。 如果在code_mode=MERCHANT_UPLOAD的模式下,创建商家券活动后,还需要进行券码导入操作,以及预算追加操作,然后商家券才能进行发放。 * @param alipayMarketingActivityOrdervoucherCreateModel (optional) * @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 * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call createAsync(AlipayMarketingActivityOrdervoucherCreateModel alipayMarketingActivityOrdervoucherCreateModel, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createValidateBeforeCall(alipayMarketingActivityOrdervoucherCreateModel, _callback, null); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public okhttp3.Call createAsync(AlipayMarketingActivityOrdervoucherCreateModel alipayMarketingActivityOrdervoucherCreateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = createValidateBeforeCall(alipayMarketingActivityOrdervoucherCreateModel, _callback, customizedParams); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for disassociate * @param alipayMarketingActivityOrdervoucherDisassociateModel (optional) * @param _callback Callback for upload/download progress * @param customizedParams * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call disassociateCall(AlipayMarketingActivityOrdervoucherDisassociateModel alipayMarketingActivityOrdervoucherDisassociateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent())) ? customizedParams.getBodyContent() : alipayMarketingActivityOrdervoucherDisassociateModel; // create path and map variables String localVarPath = "/v3/alipay/marketing/activity/ordervoucher/disassociate"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } if (customizedParams != null) { //额外query参数 if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) { for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue())); } } if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) { localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken()); } //额外非全局header参数 if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) { localVarHeaderParams.putAll(customizedParams.getHeaderParams()); } } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call disassociateValidateBeforeCall(AlipayMarketingActivityOrdervoucherDisassociateModel alipayMarketingActivityOrdervoucherDisassociateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = disassociateCall(alipayMarketingActivityOrdervoucherDisassociateModel, _callback, customizedParams); return localVarCall; } /** * 取消关联订单信息 * 取消商家券与订单信息的关联关系. * @param alipayMarketingActivityOrdervoucherDisassociateModel (optional) * @return AlipayMarketingActivityOrdervoucherDisassociateResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public AlipayMarketingActivityOrdervoucherDisassociateResponseModel disassociate(AlipayMarketingActivityOrdervoucherDisassociateModel alipayMarketingActivityOrdervoucherDisassociateModel) throws ApiException { ApiResponse localVarResp = disassociateWithHttpInfo(alipayMarketingActivityOrdervoucherDisassociateModel, null); return localVarResp.getData(); } public AlipayMarketingActivityOrdervoucherDisassociateResponseModel disassociate(AlipayMarketingActivityOrdervoucherDisassociateModel alipayMarketingActivityOrdervoucherDisassociateModel, CustomizedParams customizedParams) throws ApiException { ApiResponse localVarResp = disassociateWithHttpInfo(alipayMarketingActivityOrdervoucherDisassociateModel, customizedParams); return localVarResp.getData(); } /** * 取消关联订单信息 * 取消商家券与订单信息的关联关系. * @param alipayMarketingActivityOrdervoucherDisassociateModel (optional) * @return ApiResponse<AlipayMarketingActivityOrdervoucherDisassociateResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public ApiResponse disassociateWithHttpInfo(AlipayMarketingActivityOrdervoucherDisassociateModel alipayMarketingActivityOrdervoucherDisassociateModel, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = disassociateValidateBeforeCall(alipayMarketingActivityOrdervoucherDisassociateModel, null, customizedParams); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { try { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); } catch (Exception ex) { AlipayLogger.logBizWarn(ex); } throw e; } } /** * 取消关联订单信息 (asynchronously) * 取消商家券与订单信息的关联关系. * @param alipayMarketingActivityOrdervoucherDisassociateModel (optional) * @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 * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call disassociateAsync(AlipayMarketingActivityOrdervoucherDisassociateModel alipayMarketingActivityOrdervoucherDisassociateModel, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = disassociateValidateBeforeCall(alipayMarketingActivityOrdervoucherDisassociateModel, _callback, null); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public okhttp3.Call disassociateAsync(AlipayMarketingActivityOrdervoucherDisassociateModel alipayMarketingActivityOrdervoucherDisassociateModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = disassociateValidateBeforeCall(alipayMarketingActivityOrdervoucherDisassociateModel, _callback, customizedParams); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for modify * @param activityId 活动id1 (required) * @param alipayMarketingActivityOrdervoucherModifyModel (optional) * @param _callback Callback for upload/download progress * @param customizedParams * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call modifyCall(String activityId, AlipayMarketingActivityOrdervoucherModifyModel alipayMarketingActivityOrdervoucherModifyModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent())) ? customizedParams.getBodyContent() : alipayMarketingActivityOrdervoucherModifyModel; // create path and map variables String localVarPath = "/v3/alipay/marketing/ordervoucher/activity/{activity_id}" .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } if (customizedParams != null) { //额外query参数 if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) { for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue())); } } if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) { localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken()); } //额外非全局header参数 if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) { localVarHeaderParams.putAll(customizedParams.getHeaderParams()); } } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call modifyValidateBeforeCall(String activityId, AlipayMarketingActivityOrdervoucherModifyModel alipayMarketingActivityOrdervoucherModifyModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { // verify the required parameter 'activityId' is set if (activityId == null) { throw new ApiException("Missing the required parameter 'activityId' when calling modify(Async)"); } okhttp3.Call localVarCall = modifyCall(activityId, alipayMarketingActivityOrdervoucherModifyModel, _callback, customizedParams); return localVarCall; } /** * 修改商家券活动基本信息 * 商家调用该接口修改商家券活动基本信息。 修改商家券活动基本信息接口同步返回修改请求受理结果,后续通过alipay.marketing.activity.message.modified消息接口异步发送修改活动成功事件消息。 * @param activityId 活动id1 (required) * @param alipayMarketingActivityOrdervoucherModifyModel (optional) * @return AlipayMarketingActivityOrdervoucherModifyResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public AlipayMarketingActivityOrdervoucherModifyResponseModel modify(String activityId, AlipayMarketingActivityOrdervoucherModifyModel alipayMarketingActivityOrdervoucherModifyModel) throws ApiException { ApiResponse localVarResp = modifyWithHttpInfo(activityId, alipayMarketingActivityOrdervoucherModifyModel, null); return localVarResp.getData(); } public AlipayMarketingActivityOrdervoucherModifyResponseModel modify(String activityId, AlipayMarketingActivityOrdervoucherModifyModel alipayMarketingActivityOrdervoucherModifyModel, CustomizedParams customizedParams) throws ApiException { ApiResponse localVarResp = modifyWithHttpInfo(activityId, alipayMarketingActivityOrdervoucherModifyModel, customizedParams); return localVarResp.getData(); } /** * 修改商家券活动基本信息 * 商家调用该接口修改商家券活动基本信息。 修改商家券活动基本信息接口同步返回修改请求受理结果,后续通过alipay.marketing.activity.message.modified消息接口异步发送修改活动成功事件消息。 * @param activityId 活动id1 (required) * @param alipayMarketingActivityOrdervoucherModifyModel (optional) * @return ApiResponse<AlipayMarketingActivityOrdervoucherModifyResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public ApiResponse modifyWithHttpInfo(String activityId, AlipayMarketingActivityOrdervoucherModifyModel alipayMarketingActivityOrdervoucherModifyModel, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = modifyValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherModifyModel, null, customizedParams); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { try { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); } catch (Exception ex) { AlipayLogger.logBizWarn(ex); } throw e; } } /** * 修改商家券活动基本信息 (asynchronously) * 商家调用该接口修改商家券活动基本信息。 修改商家券活动基本信息接口同步返回修改请求受理结果,后续通过alipay.marketing.activity.message.modified消息接口异步发送修改活动成功事件消息。 * @param activityId 活动id1 (required) * @param alipayMarketingActivityOrdervoucherModifyModel (optional) * @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 * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call modifyAsync(String activityId, AlipayMarketingActivityOrdervoucherModifyModel alipayMarketingActivityOrdervoucherModifyModel, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = modifyValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherModifyModel, _callback, null); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public okhttp3.Call modifyAsync(String activityId, AlipayMarketingActivityOrdervoucherModifyModel alipayMarketingActivityOrdervoucherModifyModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = modifyValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherModifyModel, _callback, customizedParams); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for query * @param activityId 活动id (optional) * @param merchantAccessMode 商户接入模式 (optional) * @param _callback Callback for upload/download progress * @param customizedParams * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call queryCall(String activityId, String merchantAccessMode, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/v3/alipay/marketing/activity/ordervoucher/query"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (activityId != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("activity_id", activityId)); } if (merchantAccessMode != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("merchant_access_mode", merchantAccessMode)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } if (customizedParams != null) { //额外query参数 if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) { for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue())); } } if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) { localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken()); } //额外非全局header参数 if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) { localVarHeaderParams.putAll(customizedParams.getHeaderParams()); } } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call queryValidateBeforeCall(String activityId, String merchantAccessMode, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = queryCall(activityId, merchantAccessMode, _callback, customizedParams); return localVarCall; } /** * 查询商家券活动 * 商户通过该接口查询商家券活动详情。 * @param activityId 活动id (optional) * @param merchantAccessMode 商户接入模式 (optional) * @return AlipayMarketingActivityOrdervoucherQueryResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public AlipayMarketingActivityOrdervoucherQueryResponseModel query(String activityId, String merchantAccessMode) throws ApiException { ApiResponse localVarResp = queryWithHttpInfo(activityId, merchantAccessMode, null); return localVarResp.getData(); } public AlipayMarketingActivityOrdervoucherQueryResponseModel query(String activityId, String merchantAccessMode, CustomizedParams customizedParams) throws ApiException { ApiResponse localVarResp = queryWithHttpInfo(activityId, merchantAccessMode, customizedParams); return localVarResp.getData(); } /** * 查询商家券活动 * 商户通过该接口查询商家券活动详情。 * @param activityId 活动id (optional) * @param merchantAccessMode 商户接入模式 (optional) * @return ApiResponse<AlipayMarketingActivityOrdervoucherQueryResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public ApiResponse queryWithHttpInfo(String activityId, String merchantAccessMode, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = queryValidateBeforeCall(activityId, merchantAccessMode, null, customizedParams); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { try { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); } catch (Exception ex) { AlipayLogger.logBizWarn(ex); } throw e; } } /** * 查询商家券活动 (asynchronously) * 商户通过该接口查询商家券活动详情。 * @param activityId 活动id (optional) * @param merchantAccessMode 商户接入模式 (optional) * @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 * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call queryAsync(String activityId, String merchantAccessMode, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = queryValidateBeforeCall(activityId, merchantAccessMode, _callback, null); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public okhttp3.Call queryAsync(String activityId, String merchantAccessMode, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = queryValidateBeforeCall(activityId, merchantAccessMode, _callback, customizedParams); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for refund * @param activityId 活动id (required) * @param voucherCode 已核销待退券的券码 (required) * @param alipayMarketingActivityOrdervoucherRefundModel (optional) * @param _callback Callback for upload/download progress * @param customizedParams * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call refundCall(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherRefundModel alipayMarketingActivityOrdervoucherRefundModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent())) ? customizedParams.getBodyContent() : alipayMarketingActivityOrdervoucherRefundModel; // create path and map variables String localVarPath = "/v3/alipay/marketing/ordervoucher/activity/{activity_id}/voucher/{voucher_code}/refund" .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())) .replaceAll("\\{" + "voucher_code" + "\\}", localVarApiClient.escapeString(voucherCode.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } if (customizedParams != null) { //额外query参数 if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) { for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue())); } } if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) { localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken()); } //额外非全局header参数 if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) { localVarHeaderParams.putAll(customizedParams.getHeaderParams()); } } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call refundValidateBeforeCall(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherRefundModel alipayMarketingActivityOrdervoucherRefundModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { // verify the required parameter 'activityId' is set if (activityId == null) { throw new ApiException("Missing the required parameter 'activityId' when calling refund(Async)"); } // verify the required parameter 'voucherCode' is set if (voucherCode == null) { throw new ApiException("Missing the required parameter 'voucherCode' when calling refund(Async)"); } okhttp3.Call localVarCall = refundCall(activityId, voucherCode, alipayMarketingActivityOrdervoucherRefundModel, _callback, customizedParams); return localVarCall; } /** * 取消券核销状态 * 商户调用该接口进行优惠券退券处理。接口同步返回结果。 如果优惠券过期后,发起退券操作,该接口返回成功,优惠券退回后仍不可用。 如果优惠券在支付宝卡包已删除,发起退券操作,该接口返回成功,优惠券在支付宝卡包仍然是删除状态。 * @param activityId 活动id (required) * @param voucherCode 已核销待退券的券码 (required) * @param alipayMarketingActivityOrdervoucherRefundModel (optional) * @return AlipayMarketingActivityOrdervoucherRefundResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public AlipayMarketingActivityOrdervoucherRefundResponseModel refund(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherRefundModel alipayMarketingActivityOrdervoucherRefundModel) throws ApiException { ApiResponse localVarResp = refundWithHttpInfo(activityId, voucherCode, alipayMarketingActivityOrdervoucherRefundModel, null); return localVarResp.getData(); } public AlipayMarketingActivityOrdervoucherRefundResponseModel refund(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherRefundModel alipayMarketingActivityOrdervoucherRefundModel, CustomizedParams customizedParams) throws ApiException { ApiResponse localVarResp = refundWithHttpInfo(activityId, voucherCode, alipayMarketingActivityOrdervoucherRefundModel, customizedParams); return localVarResp.getData(); } /** * 取消券核销状态 * 商户调用该接口进行优惠券退券处理。接口同步返回结果。 如果优惠券过期后,发起退券操作,该接口返回成功,优惠券退回后仍不可用。 如果优惠券在支付宝卡包已删除,发起退券操作,该接口返回成功,优惠券在支付宝卡包仍然是删除状态。 * @param activityId 活动id (required) * @param voucherCode 已核销待退券的券码 (required) * @param alipayMarketingActivityOrdervoucherRefundModel (optional) * @return ApiResponse<AlipayMarketingActivityOrdervoucherRefundResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public ApiResponse refundWithHttpInfo(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherRefundModel alipayMarketingActivityOrdervoucherRefundModel, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = refundValidateBeforeCall(activityId, voucherCode, alipayMarketingActivityOrdervoucherRefundModel, null, customizedParams); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { try { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); } catch (Exception ex) { AlipayLogger.logBizWarn(ex); } throw e; } } /** * 取消券核销状态 (asynchronously) * 商户调用该接口进行优惠券退券处理。接口同步返回结果。 如果优惠券过期后,发起退券操作,该接口返回成功,优惠券退回后仍不可用。 如果优惠券在支付宝卡包已删除,发起退券操作,该接口返回成功,优惠券在支付宝卡包仍然是删除状态。 * @param activityId 活动id (required) * @param voucherCode 已核销待退券的券码 (required) * @param alipayMarketingActivityOrdervoucherRefundModel (optional) * @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 * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call refundAsync(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherRefundModel alipayMarketingActivityOrdervoucherRefundModel, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = refundValidateBeforeCall(activityId, voucherCode, alipayMarketingActivityOrdervoucherRefundModel, _callback, null); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public okhttp3.Call refundAsync(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherRefundModel alipayMarketingActivityOrdervoucherRefundModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = refundValidateBeforeCall(activityId, voucherCode, alipayMarketingActivityOrdervoucherRefundModel, _callback, customizedParams); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for stop * @param activityId 活动id (required) * @param alipayMarketingActivityOrdervoucherStopModel (optional) * @param _callback Callback for upload/download progress * @param customizedParams * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call stopCall(String activityId, AlipayMarketingActivityOrdervoucherStopModel alipayMarketingActivityOrdervoucherStopModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent())) ? customizedParams.getBodyContent() : alipayMarketingActivityOrdervoucherStopModel; // create path and map variables String localVarPath = "/v3/alipay/marketing/ordervoucher/activity/{activity_id}/stop" .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } if (customizedParams != null) { //额外query参数 if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) { for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue())); } } if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) { localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken()); } //额外非全局header参数 if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) { localVarHeaderParams.putAll(customizedParams.getHeaderParams()); } } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call stopValidateBeforeCall(String activityId, AlipayMarketingActivityOrdervoucherStopModel alipayMarketingActivityOrdervoucherStopModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { // verify the required parameter 'activityId' is set if (activityId == null) { throw new ApiException("Missing the required parameter 'activityId' when calling stop(Async)"); } okhttp3.Call localVarCall = stopCall(activityId, alipayMarketingActivityOrdervoucherStopModel, _callback, customizedParams); return localVarCall; } /** * 停止商家券活动 * 商家调用该接口停止优惠券。 停止优惠券接口同步返回停止请求受理结果,后续通过alipay.marketing.activity.message.stopped消息接口异步发送停止活动成功事件。 如果成功消息长时间未送达,请联系相关技术人员。 * @param activityId 活动id (required) * @param alipayMarketingActivityOrdervoucherStopModel (optional) * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public Object stop(String activityId, AlipayMarketingActivityOrdervoucherStopModel alipayMarketingActivityOrdervoucherStopModel) throws ApiException { ApiResponse localVarResp = stopWithHttpInfo(activityId, alipayMarketingActivityOrdervoucherStopModel, null); return localVarResp.getData(); } public Object stop(String activityId, AlipayMarketingActivityOrdervoucherStopModel alipayMarketingActivityOrdervoucherStopModel, CustomizedParams customizedParams) throws ApiException { ApiResponse localVarResp = stopWithHttpInfo(activityId, alipayMarketingActivityOrdervoucherStopModel, customizedParams); return localVarResp.getData(); } /** * 停止商家券活动 * 商家调用该接口停止优惠券。 停止优惠券接口同步返回停止请求受理结果,后续通过alipay.marketing.activity.message.stopped消息接口异步发送停止活动成功事件。 如果成功消息长时间未送达,请联系相关技术人员。 * @param activityId 活动id (required) * @param alipayMarketingActivityOrdervoucherStopModel (optional) * @return ApiResponse<Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public ApiResponse stopWithHttpInfo(String activityId, AlipayMarketingActivityOrdervoucherStopModel alipayMarketingActivityOrdervoucherStopModel, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = stopValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherStopModel, null, customizedParams); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { try { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); } catch (Exception ex) { AlipayLogger.logBizWarn(ex); } throw e; } } /** * 停止商家券活动 (asynchronously) * 商家调用该接口停止优惠券。 停止优惠券接口同步返回停止请求受理结果,后续通过alipay.marketing.activity.message.stopped消息接口异步发送停止活动成功事件。 如果成功消息长时间未送达,请联系相关技术人员。 * @param activityId 活动id (required) * @param alipayMarketingActivityOrdervoucherStopModel (optional) * @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 * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call stopAsync(String activityId, AlipayMarketingActivityOrdervoucherStopModel alipayMarketingActivityOrdervoucherStopModel, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = stopValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherStopModel, _callback, null); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public okhttp3.Call stopAsync(String activityId, AlipayMarketingActivityOrdervoucherStopModel alipayMarketingActivityOrdervoucherStopModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = stopValidateBeforeCall(activityId, alipayMarketingActivityOrdervoucherStopModel, _callback, customizedParams); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for use * @param activityId 活动id (required) * @param voucherCode 待核销的券码。 (required) * @param alipayMarketingActivityOrdervoucherUseModel (optional) * @param _callback Callback for upload/download progress * @param customizedParams * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call useCall(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherUseModel alipayMarketingActivityOrdervoucherUseModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = (customizedParams != null && !Strings.isNullOrEmpty(customizedParams.getBodyContent())) ? customizedParams.getBodyContent() : alipayMarketingActivityOrdervoucherUseModel; // create path and map variables String localVarPath = "/v3/alipay/marketing/ordervoucher/activity/{activity_id}/voucher/{voucher_code}/use" .replaceAll("\\{" + "activity_id" + "\\}", localVarApiClient.escapeString(activityId.toString())) .replaceAll("\\{" + "voucher_code" + "\\}", localVarApiClient.escapeString(voucherCode.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } if (customizedParams != null) { //额外query参数 if (customizedParams.getQueryParams() != null && customizedParams.getQueryParams().size() > 0) { for (Map.Entry entry : customizedParams.getQueryParams().entrySet()) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(entry.getKey(), entry.getValue())); } } if (!Strings.isNullOrEmpty(customizedParams.getAppAuthToken())) { localVarHeaderParams.put("alipay-app-auth-token", customizedParams.getAppAuthToken()); } //额外非全局header参数 if (customizedParams.getHeaderParams() != null && customizedParams.getHeaderParams().size() > 0) { localVarHeaderParams.putAll(customizedParams.getHeaderParams()); } } String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call useValidateBeforeCall(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherUseModel alipayMarketingActivityOrdervoucherUseModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { // verify the required parameter 'activityId' is set if (activityId == null) { throw new ApiException("Missing the required parameter 'activityId' when calling use(Async)"); } // verify the required parameter 'voucherCode' is set if (voucherCode == null) { throw new ApiException("Missing the required parameter 'voucherCode' when calling use(Async)"); } okhttp3.Call localVarCall = useCall(activityId, voucherCode, alipayMarketingActivityOrdervoucherUseModel, _callback, customizedParams); return localVarCall; } /** * 同步券核销状态 * 商户调用该接口,通过券码进行优惠券核销,接口同步返回核销结果。 * @param activityId 活动id (required) * @param voucherCode 待核销的券码。 (required) * @param alipayMarketingActivityOrdervoucherUseModel (optional) * @return AlipayMarketingActivityOrdervoucherUseResponseModel * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public AlipayMarketingActivityOrdervoucherUseResponseModel use(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherUseModel alipayMarketingActivityOrdervoucherUseModel) throws ApiException { ApiResponse localVarResp = useWithHttpInfo(activityId, voucherCode, alipayMarketingActivityOrdervoucherUseModel, null); return localVarResp.getData(); } public AlipayMarketingActivityOrdervoucherUseResponseModel use(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherUseModel alipayMarketingActivityOrdervoucherUseModel, CustomizedParams customizedParams) throws ApiException { ApiResponse localVarResp = useWithHttpInfo(activityId, voucherCode, alipayMarketingActivityOrdervoucherUseModel, customizedParams); return localVarResp.getData(); } /** * 同步券核销状态 * 商户调用该接口,通过券码进行优惠券核销,接口同步返回核销结果。 * @param activityId 活动id (required) * @param voucherCode 待核销的券码。 (required) * @param alipayMarketingActivityOrdervoucherUseModel (optional) * @return ApiResponse<AlipayMarketingActivityOrdervoucherUseResponseModel> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public ApiResponse useWithHttpInfo(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherUseModel alipayMarketingActivityOrdervoucherUseModel, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = useValidateBeforeCall(activityId, voucherCode, alipayMarketingActivityOrdervoucherUseModel, null, customizedParams); try { Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } catch (ApiException e) { try { e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); } catch (Exception ex) { AlipayLogger.logBizWarn(ex); } throw e; } } /** * 同步券核销状态 (asynchronously) * 商户调用该接口,通过券码进行优惠券核销,接口同步返回核销结果。 * @param activityId 活动id (required) * @param voucherCode 待核销的券码。 (required) * @param alipayMarketingActivityOrdervoucherUseModel (optional) * @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 * @http.response.details
Status Code Description Response Headers
200 common response -
0 请求失败 -
*/ public okhttp3.Call useAsync(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherUseModel alipayMarketingActivityOrdervoucherUseModel, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = useValidateBeforeCall(activityId, voucherCode, alipayMarketingActivityOrdervoucherUseModel, _callback, null); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public okhttp3.Call useAsync(String activityId, String voucherCode, AlipayMarketingActivityOrdervoucherUseModel alipayMarketingActivityOrdervoucherUseModel, final ApiCallback _callback, CustomizedParams customizedParams) throws ApiException { okhttp3.Call localVarCall = useValidateBeforeCall(activityId, voucherCode, alipayMarketingActivityOrdervoucherUseModel, _callback, customizedParams); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }