114 lines
2.4 KiB
PHP
114 lines
2.4 KiB
PHP
<?php
|
||
/**
|
||
* TOP API: taobao.item.quantity.update request
|
||
*
|
||
* @author auto create
|
||
* @since 1.0, 2024.03.14
|
||
*/
|
||
class ItemQuantityUpdateRequest
|
||
{
|
||
/**
|
||
* 商品数字ID,必填参数
|
||
**/
|
||
private $numIid;
|
||
|
||
/**
|
||
* SKU的商家编码,可选参数。如果不填则默认修改宝贝的库存,如果填了则按照商家编码搜索出对应的SKU并修改库存。当sku_id和本字段都填写时以sku_id为准搜索对应SKU
|
||
**/
|
||
private $outerId;
|
||
|
||
/**
|
||
* 库存修改值,必选。当全量更新库存时,quantity必须为大于等于0的正整数;当增量更新库存时,quantity为整数,可小于等于0。若增量更新时传入的库存为负数,则负数与实际库存之和不能小于0。比如当前实际库存为1,传入增量更新quantity=-1,库存改为0
|
||
**/
|
||
private $quantity;
|
||
|
||
/**
|
||
* 要操作的SKU的数字ID,可选。如果不填默认修改宝贝的库存,如果填上则修改该SKU的库存
|
||
**/
|
||
private $skuId;
|
||
|
||
/**
|
||
* 库存更新方式,可选。1为全量更新,2为增量更新。如果不填,默认为全量更新
|
||
**/
|
||
private $type;
|
||
|
||
private $apiParas = array();
|
||
|
||
public function setNumIid($numIid)
|
||
{
|
||
$this->numIid = $numIid;
|
||
$this->apiParas["num_iid"] = $numIid;
|
||
}
|
||
|
||
public function getNumIid()
|
||
{
|
||
return $this->numIid;
|
||
}
|
||
|
||
public function setOuterId($outerId)
|
||
{
|
||
$this->outerId = $outerId;
|
||
$this->apiParas["outer_id"] = $outerId;
|
||
}
|
||
|
||
public function getOuterId()
|
||
{
|
||
return $this->outerId;
|
||
}
|
||
|
||
public function setQuantity($quantity)
|
||
{
|
||
$this->quantity = $quantity;
|
||
$this->apiParas["quantity"] = $quantity;
|
||
}
|
||
|
||
public function getQuantity()
|
||
{
|
||
return $this->quantity;
|
||
}
|
||
|
||
public function setSkuId($skuId)
|
||
{
|
||
$this->skuId = $skuId;
|
||
$this->apiParas["sku_id"] = $skuId;
|
||
}
|
||
|
||
public function getSkuId()
|
||
{
|
||
return $this->skuId;
|
||
}
|
||
|
||
public function setType($type)
|
||
{
|
||
$this->type = $type;
|
||
$this->apiParas["type"] = $type;
|
||
}
|
||
|
||
public function getType()
|
||
{
|
||
return $this->type;
|
||
}
|
||
|
||
public function getApiMethodName()
|
||
{
|
||
return "taobao.item.quantity.update";
|
||
}
|
||
|
||
public function getApiParas()
|
||
{
|
||
return $this->apiParas;
|
||
}
|
||
|
||
public function check()
|
||
{
|
||
|
||
RequestCheckUtil::checkNotNull($this->numIid,"numIid");
|
||
RequestCheckUtil::checkNotNull($this->quantity,"quantity");
|
||
}
|
||
|
||
public function putOtherTextParam($key, $value) {
|
||
$this->apiParas[$key] = $value;
|
||
$this->$key = $value;
|
||
}
|
||
}
|