<?php
/**
 * AlipayUserAlipaypointSendModel
 *
 * 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: 2023-12-20
 * 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;

/**
 * AlipayUserAlipaypointSendModel 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 AlipayUserAlipaypointSendModel implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'budgetCode' => 'string',
        'memo' => 'string',
        'openId' => 'string',
        'partnerBizNo' => 'string',
        'pointAmount' => 'int',
        'userAccount' => 'string',
        'userId' => '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 = [
        'budgetCode' => null,
        'memo' => null,
        'openId' => null,
        'partnerBizNo' => null,
        'pointAmount' => null,
        'userAccount' => null,
        'userId' => 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 = [
        'budgetCode' => 'budget_code',
        'memo' => 'memo',
        'openId' => 'open_id',
        'partnerBizNo' => 'partner_biz_no',
        'pointAmount' => 'point_amount',
        'userAccount' => 'user_account',
        'userId' => 'user_id'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'budgetCode' => 'setBudgetCode',
        'memo' => 'setMemo',
        'openId' => 'setOpenId',
        'partnerBizNo' => 'setPartnerBizNo',
        'pointAmount' => 'setPointAmount',
        'userAccount' => 'setUserAccount',
        'userId' => 'setUserId'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'budgetCode' => 'getBudgetCode',
        'memo' => 'getMemo',
        'openId' => 'getOpenId',
        'partnerBizNo' => 'getPartnerBizNo',
        'pointAmount' => 'getPointAmount',
        'userAccount' => 'getUserAccount',
        'userId' => 'getUserId'
    ];

    /**
     * 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['budgetCode'] = $data['budgetCode'] ?? null;
        $this->container['memo'] = $data['memo'] ?? null;
        $this->container['openId'] = $data['openId'] ?? null;
        $this->container['partnerBizNo'] = $data['partnerBizNo'] ?? null;
        $this->container['pointAmount'] = $data['pointAmount'] ?? null;
        $this->container['userAccount'] = $data['userAccount'] ?? null;
        $this->container['userId'] = $data['userId'] ?? 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 budgetCode
     *
     * @return string|null
     */
    public function getBudgetCode()
    {
        return $this->container['budgetCode'];
    }

    /**
     * Sets budgetCode
     *
     * @param string|null $budgetCode 签约商户的集分宝的预算库，扣除此预算库的集分宝发放给用户。会校验budgetcode和业务方appId的签约商户pid的关联关系，若无关则发放失败。
     *
     * @return self
     */
    public function setBudgetCode($budgetCode)
    {
        $this->container['budgetCode'] = $budgetCode;

        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 openId
     *
     * @return string|null
     */
    public function getOpenId()
    {
        return $this->container['openId'];
    }

    /**
     * Sets openId
     *
     * @param string|null $openId 被发放集分宝用户ID，商户app_id维度下的用户标识，与user_account字段二选一。 建议优先使该字段指定发放用户，接口性能更佳
     *
     * @return self
     */
    public function setOpenId($openId)
    {
        $this->container['openId'] = $openId;

        return $this;
    }

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

    /**
     * Sets partnerBizNo
     *
     * @param string|null $partnerBizNo 接入方自己交易的唯一流水ID号，不同交易请保证幂等号唯一性，集分宝服务将依据该字段来进行幂等控制，重试请求不要更换幂等号，需要慎重传递，否则可能会造成损失。
     *
     * @return self
     */
    public function setPartnerBizNo($partnerBizNo)
    {
        $this->container['partnerBizNo'] = $partnerBizNo;

        return $this;
    }

    /**
     * Gets pointAmount
     *
     * @return int|null
     */
    public function getPointAmount()
    {
        return $this->container['pointAmount'];
    }

    /**
     * Sets pointAmount
     *
     * @param int|null $pointAmount 发放给用户的集分宝个数。个数区间为 [1,10000000]，需为整数。
     *
     * @return self
     */
    public function setPointAmount($pointAmount)
    {
        $this->container['pointAmount'] = $pointAmount;

        return $this;
    }

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

    /**
     * Sets userAccount
     *
     * @param string|null $userAccount 被发放集分宝用户的支付宝登录号，邮箱地址或者手机号均可，与user_id字段二选一，在有user_id时，优先使用user_id字段。
     *
     * @return self
     */
    public function setUserAccount($userAccount)
    {
        $this->container['userAccount'] = $userAccount;

        return $this;
    }

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

    /**
     * Sets userId
     *
     * @param string|null $userId 被发放集分宝用户的蚂蚁统一会员ID，与user_account字段二选一。 建议优先使用user_id，接口性能更佳，user_id和user_account都传递时，系统优先使用本字段。
     *
     * @return self
     */
    public function setUserId($userId)
    {
        $this->container['userId'] = $userId;

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


