v3/src/Model/CustomsDeclareRecordInfo.php
<?php
/**
 * CustomsDeclareRecordInfo
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  Alipay\OpenAPISDK
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * 支付宝开放平台API
 *
 * 支付宝开放平台v3协议文档
 *
 * The version of the OpenAPI document: 2025-08-26
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.2.1
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace Alipay\OpenAPISDK\Model;

use \ArrayAccess;
use \Alipay\OpenAPISDK\ObjectSerializer;

/**
 * CustomsDeclareRecordInfo Class Doc Comment
 *
 * @category Class
 * @package  Alipay\OpenAPISDK
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<TKey, TValue>
 * @template TKey int|null
 * @template TValue mixed|null
 */
class CustomsDeclareRecordInfo implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $openAPIModelName = 'CustomsDeclareRecordInfo';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'alipayDeclareNo' => 'string',
        'amount' => 'string',
        'customsPlace' => 'string',
        'customsResultCode' => 'string',
        'customsResultInfo' => 'string',
        'customsResultReturnTime' => 'string',
        'isSplit' => 'string',
        'lastModifiedTime' => 'string',
        'memo' => 'string',
        'merchantCustomsCode' => 'string',
        'merchantCustomsName' => 'string',
        'outRequestNo' => 'string',
        'status' => 'string',
        'subOutBizNo' => 'string',
        'tradeNo' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'alipayDeclareNo' => null,
        'amount' => null,
        'customsPlace' => null,
        'customsResultCode' => null,
        'customsResultInfo' => null,
        'customsResultReturnTime' => null,
        'isSplit' => null,
        'lastModifiedTime' => null,
        'memo' => null,
        'merchantCustomsCode' => null,
        'merchantCustomsName' => null,
        'outRequestNo' => null,
        'status' => null,
        'subOutBizNo' => null,
        'tradeNo' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPITypes()
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPIFormats()
    {
        return self::$openAPIFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'alipayDeclareNo' => 'alipay_declare_no',
        'amount' => 'amount',
        'customsPlace' => 'customs_place',
        'customsResultCode' => 'customs_result_code',
        'customsResultInfo' => 'customs_result_info',
        'customsResultReturnTime' => 'customs_result_return_time',
        'isSplit' => 'is_split',
        'lastModifiedTime' => 'last_modified_time',
        'memo' => 'memo',
        'merchantCustomsCode' => 'merchant_customs_code',
        'merchantCustomsName' => 'merchant_customs_name',
        'outRequestNo' => 'out_request_no',
        'status' => 'status',
        'subOutBizNo' => 'sub_out_biz_no',
        'tradeNo' => 'trade_no'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'alipayDeclareNo' => 'setAlipayDeclareNo',
        'amount' => 'setAmount',
        'customsPlace' => 'setCustomsPlace',
        'customsResultCode' => 'setCustomsResultCode',
        'customsResultInfo' => 'setCustomsResultInfo',
        'customsResultReturnTime' => 'setCustomsResultReturnTime',
        'isSplit' => 'setIsSplit',
        'lastModifiedTime' => 'setLastModifiedTime',
        'memo' => 'setMemo',
        'merchantCustomsCode' => 'setMerchantCustomsCode',
        'merchantCustomsName' => 'setMerchantCustomsName',
        'outRequestNo' => 'setOutRequestNo',
        'status' => 'setStatus',
        'subOutBizNo' => 'setSubOutBizNo',
        'tradeNo' => 'setTradeNo'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'alipayDeclareNo' => 'getAlipayDeclareNo',
        'amount' => 'getAmount',
        'customsPlace' => 'getCustomsPlace',
        'customsResultCode' => 'getCustomsResultCode',
        'customsResultInfo' => 'getCustomsResultInfo',
        'customsResultReturnTime' => 'getCustomsResultReturnTime',
        'isSplit' => 'getIsSplit',
        'lastModifiedTime' => 'getLastModifiedTime',
        'memo' => 'getMemo',
        'merchantCustomsCode' => 'getMerchantCustomsCode',
        'merchantCustomsName' => 'getMerchantCustomsName',
        'outRequestNo' => 'getOutRequestNo',
        'status' => 'getStatus',
        'subOutBizNo' => 'getSubOutBizNo',
        'tradeNo' => 'getTradeNo'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$openAPIModelName;
    }


    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['alipayDeclareNo'] = $data['alipayDeclareNo'] ?? null;
        $this->container['amount'] = $data['amount'] ?? null;
        $this->container['customsPlace'] = $data['customsPlace'] ?? null;
        $this->container['customsResultCode'] = $data['customsResultCode'] ?? null;
        $this->container['customsResultInfo'] = $data['customsResultInfo'] ?? null;
        $this->container['customsResultReturnTime'] = $data['customsResultReturnTime'] ?? null;
        $this->container['isSplit'] = $data['isSplit'] ?? null;
        $this->container['lastModifiedTime'] = $data['lastModifiedTime'] ?? null;
        $this->container['memo'] = $data['memo'] ?? null;
        $this->container['merchantCustomsCode'] = $data['merchantCustomsCode'] ?? null;
        $this->container['merchantCustomsName'] = $data['merchantCustomsName'] ?? null;
        $this->container['outRequestNo'] = $data['outRequestNo'] ?? null;
        $this->container['status'] = $data['status'] ?? null;
        $this->container['subOutBizNo'] = $data['subOutBizNo'] ?? null;
        $this->container['tradeNo'] = $data['tradeNo'] ?? null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets alipayDeclareNo
     *
     * @return string|null
     */
    public function getAlipayDeclareNo()
    {
        return $this->container['alipayDeclareNo'];
    }

    /**
     * Sets alipayDeclareNo
     *
     * @param string|null $alipayDeclareNo 支付宝报关流水号。
     *
     * @return self
     */
    public function setAlipayDeclareNo($alipayDeclareNo)
    {
        $this->container['alipayDeclareNo'] = $alipayDeclareNo;

        return $this;
    }

    /**
     * Gets amount
     *
     * @return string|null
     */
    public function getAmount()
    {
        return $this->container['amount'];
    }

    /**
     * Sets amount
     *
     * @param string|null $amount 报关金额，单位为人民币“元”，精确到小数点后2位。
     *
     * @return self
     */
    public function setAmount($amount)
    {
        $this->container['amount'] = $amount;

        return $this;
    }

    /**
     * Gets customsPlace
     *
     * @return string|null
     */
    public function getCustomsPlace()
    {
        return $this->container['customsPlace'];
    }

    /**
     * Sets customsPlace
     *
     * @param string|null $customsPlace 此记录所报关的海关编号，参见“ <a href=\"https://opendocs.alipay.com/pre-open/01x3kh#%E6%B5%B7%E5%85%B3%E7%BC%96%E5%8F%B7\">海关编号</a>”。
     *
     * @return self
     */
    public function setCustomsPlace($customsPlace)
    {
        $this->container['customsPlace'] = $customsPlace;

        return $this;
    }

    /**
     * Gets customsResultCode
     *
     * @return string|null
     */
    public function getCustomsResultCode()
    {
        return $this->container['customsResultCode'];
    }

    /**
     * Sets customsResultCode
     *
     * @param string|null $customsResultCode 发起报关后，海关返回回执中的结果码。总署回执接收成功的请求透传总署参数，其它海关成功时返回 succ，异常时返回 fail 支付宝原样返回总署返回的数据，参数值以海关的定义为准，总署回执参数参考如下：  2：电子口岸申报中  3：发送海关成功  4：发送海关失败  100：海关退单  399：海关审结  小于0的数字：表示处理异常回执
     *
     * @return self
     */
    public function setCustomsResultCode($customsResultCode)
    {
        $this->container['customsResultCode'] = $customsResultCode;

        return $this;
    }

    /**
     * Gets customsResultInfo
     *
     * @return string|null
     */
    public function getCustomsResultInfo()
    {
        return $this->container['customsResultInfo'];
    }

    /**
     * Sets customsResultInfo
     *
     * @param string|null $customsResultInfo 发起报关后，海关返回回执中的结果描述信息。
     *
     * @return self
     */
    public function setCustomsResultInfo($customsResultInfo)
    {
        $this->container['customsResultInfo'] = $customsResultInfo;

        return $this;
    }

    /**
     * Gets customsResultReturnTime
     *
     * @return string|null
     */
    public function getCustomsResultReturnTime()
    {
        return $this->container['customsResultReturnTime'];
    }

    /**
     * Sets customsResultReturnTime
     *
     * @param string|null $customsResultReturnTime 发起报关后，海关返回回执的时间，格式为：yyyyMMddHHmmss。目前只有总署报关，并且总署成功返回回执的时候才会有此参数。
     *
     * @return self
     */
    public function setCustomsResultReturnTime($customsResultReturnTime)
    {
        $this->container['customsResultReturnTime'] = $customsResultReturnTime;

        return $this;
    }

    /**
     * Gets isSplit
     *
     * @return string|null
     */
    public function getIsSplit()
    {
        return $this->container['isSplit'];
    }

    /**
     * Sets isSplit
     *
     * @param string|null $isSplit T: 拆单；F：非拆单。当请求没有拆单或者请求传入的is_split=F时，不会返回此参数。
     *
     * @return self
     */
    public function setIsSplit($isSplit)
    {
        $this->container['isSplit'] = $isSplit;

        return $this;
    }

    /**
     * Gets lastModifiedTime
     *
     * @return string|null
     */
    public function getLastModifiedTime()
    {
        return $this->container['lastModifiedTime'];
    }

    /**
     * Sets lastModifiedTime
     *
     * @param string|null $lastModifiedTime 报关记录状态最后更新时间
     *
     * @return self
     */
    public function setLastModifiedTime($lastModifiedTime)
    {
        $this->container['lastModifiedTime'] = $lastModifiedTime;

        return $this;
    }

    /**
     * Gets memo
     *
     * @return string|null
     */
    public function getMemo()
    {
        return $this->container['memo'];
    }

    /**
     * Sets memo
     *
     * @param string|null $memo 备注说明
     *
     * @return self
     */
    public function setMemo($memo)
    {
        $this->container['memo'] = $memo;

        return $this;
    }

    /**
     * Gets merchantCustomsCode
     *
     * @return string|null
     */
    public function getMerchantCustomsCode()
    {
        return $this->container['merchantCustomsCode'];
    }

    /**
     * Sets merchantCustomsCode
     *
     * @param string|null $merchantCustomsCode 商户在海关备案的编号。
     *
     * @return self
     */
    public function setMerchantCustomsCode($merchantCustomsCode)
    {
        $this->container['merchantCustomsCode'] = $merchantCustomsCode;

        return $this;
    }

    /**
     * Gets merchantCustomsName
     *
     * @return string|null
     */
    public function getMerchantCustomsName()
    {
        return $this->container['merchantCustomsName'];
    }

    /**
     * Sets merchantCustomsName
     *
     * @param string|null $merchantCustomsName 商户海关备案名称
     *
     * @return self
     */
    public function setMerchantCustomsName($merchantCustomsName)
    {
        $this->container['merchantCustomsName'] = $merchantCustomsName;

        return $this;
    }

    /**
     * Gets outRequestNo
     *
     * @return string|null
     */
    public function getOutRequestNo()
    {
        return $this->container['outRequestNo'];
    }

    /**
     * Sets outRequestNo
     *
     * @param string|null $outRequestNo 报关请求号。商户端报关请求号，对应入参中的某条报关请求号。
     *
     * @return self
     */
    public function setOutRequestNo($outRequestNo)
    {
        $this->container['outRequestNo'] = $outRequestNo;

        return $this;
    }

    /**
     * Gets status
     *
     * @return string|null
     */
    public function getStatus()
    {
        return $this->container['status'];
    }

    /**
     * Sets status
     *
     * @param string|null $status 该报关单当前的状态：  - ws等待发送海关  - sending已提交发送海关  - succ 海关返回受理成功
     *
     * @return self
     */
    public function setStatus($status)
    {
        $this->container['status'] = $status;

        return $this;
    }

    /**
     * Gets subOutBizNo
     *
     * @return string|null
     */
    public function getSubOutBizNo()
    {
        return $this->container['subOutBizNo'];
    }

    /**
     * Sets subOutBizNo
     *
     * @param string|null $subOutBizNo 拆单子订单号。如果报关请求没有请求拆单则不会返回此参数。
     *
     * @return self
     */
    public function setSubOutBizNo($subOutBizNo)
    {
        $this->container['subOutBizNo'] = $subOutBizNo;

        return $this;
    }

    /**
     * Gets tradeNo
     *
     * @return string|null
     */
    public function getTradeNo()
    {
        return $this->container['tradeNo'];
    }

    /**
     * Sets tradeNo
     *
     * @param string|null $tradeNo 支付宝推送到海关的支付单据号。针对拆单的报关，这个单据号不等于支付宝原始交易号。
     *
     * @return self
     */
    public function setTradeNo($tradeNo)
    {
        $this->container['tradeNo'] = $tradeNo;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    public function offsetExists($offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param int|null $offset Offset
     * @param mixed    $value  Value to be set
     *
     * @return void
     */
    public function offsetSet($offset, $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed Returns data which can be serialized by json_encode(), which is a value
     * of any type other than a resource.
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
       return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Gets a header-safe presentation of the object
     *
     * @return string
     */
    public function toHeaderValue()
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}


