REAPI/extend/sdk/taobao/top/request/ItemQuantityUpdateRequest.php
2024-09-29 15:43:18 +08:00

114 lines
2.4 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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;
}
}