TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
IndustryApplestoreRestrictionCreateRequest req = new IndustryApplestoreRestrictionCreateRequest();
IndustryApplestoreRestrictionCreateRequest.RestrictionPlanDTO obj1 = new IndustryApplestoreRestrictionCreateRequest.RestrictionPlanDTO();
obj1.setPeriodType("D");
List<IndustryApplestoreRestrictionCreateRequest.RestrictionRuleDTO> list3 = new ArrayList<IndustryApplestoreRestrictionCreateRequest.RestrictionRuleDTO>();
IndustryApplestoreRestrictionCreateRequest.RestrictionRuleDTO obj4 = new IndustryApplestoreRestrictionCreateRequest.RestrictionRuleDTO();
list3.add(obj4);
obj4.setRestrictionIds("656851744680");
obj4.setRestrictionType(2L);
obj4.setRuleType(0L);
obj4.setQuota(1L);
obj4.setChannel("PC");
obj4.setBusinessType("CE_APPLE");
obj1.setRestrictionRuleList(list3);
obj1.setChannel("PC");
obj1.setPeriods(1L);
obj1.setStartTimeDate(StringUtils.parseDateTime("2023-05-11 00:00:00"));
obj1.setBusinessType("CE_APPLE");
obj1.setRestrictionDays(2L);
obj1.setPlanName("创建测试");
req.setRestrictionPlanDto(obj1);
IndustryApplestoreRestrictionCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
IndustryApplestoreRestrictionCreateRequest req = new IndustryApplestoreRestrictionCreateRequest();
IndustryApplestoreRestrictionCreateRequest.RestrictionPlanDTODomain obj1 = new IndustryApplestoreRestrictionCreateRequest.RestrictionPlanDTODomain();
obj1.PeriodType = "D";
List<IndustryApplestoreRestrictionCreateRequest.RestrictionRuleDTODomain> list3 = new List<IndustryApplestoreRestrictionCreateRequest.RestrictionRuleDTODomain>();
IndustryApplestoreRestrictionCreateRequest.RestrictionRuleDTODomain obj4 = new IndustryApplestoreRestrictionCreateRequest.RestrictionRuleDTODomain();
list3.Add(obj4);
obj4.RestrictionIds = "656851744680";
obj4.RestrictionType = 2L;
obj4.RuleType = 0L;
obj4.Quota = 1L;
obj4.Channel = "PC";
obj4.BusinessType = "CE_APPLE";
obj1.RestrictionRuleList= list3;
obj1.Channel = "PC";
obj1.Periods = 1L;
obj1.StartTimeDate = DateTime.Parse(2023-05-11 00:00:00");
obj1.BusinessType = "CE_APPLE";
obj1.RestrictionDays = 2L;
obj1.PlanName = "创建测试";
req.RestrictionPlanDto_ = obj1;
IndustryApplestoreRestrictionCreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new IndustryApplestoreRestrictionCreateRequest;
$restriction_plan_dto = new RestrictionPlanDTO;
$restriction_plan_dto->period_type="D";
$restriction_rule_list = new RestrictionRuleDTO;
$restriction_rule_list->restriction_ids="656851744680";
$restriction_rule_list->restriction_type="2";
$restriction_rule_list->rule_type="0";
$restriction_rule_list->quota="1";
$restriction_rule_list->channel="PC";
$restriction_rule_list->business_type="CE_APPLE";
$restriction_plan_dto->restriction_rule_list = $restriction_rule_list;
$restriction_plan_dto->channel="PC";
$restriction_plan_dto->periods="1";
$restriction_plan_dto->start_time_date="2023-05-11 00:00:00";
$restriction_plan_dto->business_type="CE_APPLE";
$restriction_plan_dto->restriction_days="2";
$restriction_plan_dto->plan_name="创建测试";
$req->setRestrictionPlanDto(json_encode($restriction_plan_dto));
$resp = $c->execute($req, $sessionKey);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=taobao.industry.applestore.restriction.create' \
-d 'partner_id=apidoc' \
-d 'session=1249fef9-d40d-4a31-8419-a8848b692101' \
-d 'sign=979D6D35B57D42EA618FC8F041B21A5D' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-04+16%3A28%3A43' \
-d 'v=2.0' \
-d 'restriction_plan_dto=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.IndustryApplestoreRestrictionCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.restriction_plan_dto="数据结构示例JSON格式"
try:
resp= req.getResponse(sessionkey)
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"taobao.industry.applestore.restriction.create");
add_param(pRequest,"restriction_plan_dto","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,sessionKey);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('taobao.industry.applestore.restriction.create', {
'restriction_plan_dto':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})