v3/src/Model/AlipayMerchantIndirectAuthorderCreateModel.php
<?php
/**
 * AlipayMerchantIndirectAuthorderCreateModel
 *
 * 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;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'authIdentityInfo' => '\Alipay\OpenAPISDK\Model\AuthIdentityInfo',
        'benefitPersonInfo' => '\Alipay\OpenAPISDK\Model\IndirectBenefitPersonInfo',
        'contactPersonInfo' => '\Alipay\OpenAPISDK\Model\IndirectContactPersonInfo',
        'extraCredentials' => '\Alipay\OpenAPISDK\Model\IndirectExtraCredentials',
        'legalPersonInfo' => '\Alipay\OpenAPISDK\Model\IndirectLegalPersonInfo',
        'outBizNo' => 'string',
        'source' => '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 = [
        'authIdentityInfo' => null,
        'benefitPersonInfo' => null,
        'contactPersonInfo' => null,
        'extraCredentials' => null,
        'legalPersonInfo' => null,
        'outBizNo' => null,
        'source' => 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 = [
        'authIdentityInfo' => 'auth_identity_info',
        'benefitPersonInfo' => 'benefit_person_info',
        'contactPersonInfo' => 'contact_person_info',
        'extraCredentials' => 'extra_credentials',
        'legalPersonInfo' => 'legal_person_info',
        'outBizNo' => 'out_biz_no',
        'source' => 'source'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'authIdentityInfo' => 'setAuthIdentityInfo',
        'benefitPersonInfo' => 'setBenefitPersonInfo',
        'contactPersonInfo' => 'setContactPersonInfo',
        'extraCredentials' => 'setExtraCredentials',
        'legalPersonInfo' => 'setLegalPersonInfo',
        'outBizNo' => 'setOutBizNo',
        'source' => 'setSource'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'authIdentityInfo' => 'getAuthIdentityInfo',
        'benefitPersonInfo' => 'getBenefitPersonInfo',
        'contactPersonInfo' => 'getContactPersonInfo',
        'extraCredentials' => 'getExtraCredentials',
        'legalPersonInfo' => 'getLegalPersonInfo',
        'outBizNo' => 'getOutBizNo',
        'source' => 'getSource'
    ];

    /**
     * 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['authIdentityInfo'] = $data['authIdentityInfo'] ?? null;
        $this->container['benefitPersonInfo'] = $data['benefitPersonInfo'] ?? null;
        $this->container['contactPersonInfo'] = $data['contactPersonInfo'] ?? null;
        $this->container['extraCredentials'] = $data['extraCredentials'] ?? null;
        $this->container['legalPersonInfo'] = $data['legalPersonInfo'] ?? null;
        $this->container['outBizNo'] = $data['outBizNo'] ?? null;
        $this->container['source'] = $data['source'] ?? 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 authIdentityInfo
     *
     * @return \Alipay\OpenAPISDK\Model\AuthIdentityInfo|null
     */
    public function getAuthIdentityInfo()
    {
        return $this->container['authIdentityInfo'];
    }

    /**
     * Sets authIdentityInfo
     *
     * @param \Alipay\OpenAPISDK\Model\AuthIdentityInfo|null $authIdentityInfo authIdentityInfo
     *
     * @return self
     */
    public function setAuthIdentityInfo($authIdentityInfo)
    {
        $this->container['authIdentityInfo'] = $authIdentityInfo;

        return $this;
    }

    /**
     * Gets benefitPersonInfo
     *
     * @return \Alipay\OpenAPISDK\Model\IndirectBenefitPersonInfo|null
     */
    public function getBenefitPersonInfo()
    {
        return $this->container['benefitPersonInfo'];
    }

    /**
     * Sets benefitPersonInfo
     *
     * @param \Alipay\OpenAPISDK\Model\IndirectBenefitPersonInfo|null $benefitPersonInfo benefitPersonInfo
     *
     * @return self
     */
    public function setBenefitPersonInfo($benefitPersonInfo)
    {
        $this->container['benefitPersonInfo'] = $benefitPersonInfo;

        return $this;
    }

    /**
     * Gets contactPersonInfo
     *
     * @return \Alipay\OpenAPISDK\Model\IndirectContactPersonInfo|null
     */
    public function getContactPersonInfo()
    {
        return $this->container['contactPersonInfo'];
    }

    /**
     * Sets contactPersonInfo
     *
     * @param \Alipay\OpenAPISDK\Model\IndirectContactPersonInfo|null $contactPersonInfo contactPersonInfo
     *
     * @return self
     */
    public function setContactPersonInfo($contactPersonInfo)
    {
        $this->container['contactPersonInfo'] = $contactPersonInfo;

        return $this;
    }

    /**
     * Gets extraCredentials
     *
     * @return \Alipay\OpenAPISDK\Model\IndirectExtraCredentials|null
     */
    public function getExtraCredentials()
    {
        return $this->container['extraCredentials'];
    }

    /**
     * Sets extraCredentials
     *
     * @param \Alipay\OpenAPISDK\Model\IndirectExtraCredentials|null $extraCredentials extraCredentials
     *
     * @return self
     */
    public function setExtraCredentials($extraCredentials)
    {
        $this->container['extraCredentials'] = $extraCredentials;

        return $this;
    }

    /**
     * Gets legalPersonInfo
     *
     * @return \Alipay\OpenAPISDK\Model\IndirectLegalPersonInfo|null
     */
    public function getLegalPersonInfo()
    {
        return $this->container['legalPersonInfo'];
    }

    /**
     * Sets legalPersonInfo
     *
     * @param \Alipay\OpenAPISDK\Model\IndirectLegalPersonInfo|null $legalPersonInfo legalPersonInfo
     *
     * @return self
     */
    public function setLegalPersonInfo($legalPersonInfo)
    {
        $this->container['legalPersonInfo'] = $legalPersonInfo;

        return $this;
    }

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

    /**
     * Sets outBizNo
     *
     * @param string|null $outBizNo 外部业务号。支持out_biz_no和outBizNo两种格式
     *
     * @return self
     */
    public function setOutBizNo($outBizNo)
    {
        $this->container['outBizNo'] = $outBizNo;

        return $this;
    }

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

    /**
     * Sets source
     *
     * @param string|null $source 1. 收单机构调用API提交申请单时，可选择是否指定单个服务商范围。非收单机构无需填写此字段。 2. 此字段填写单个服务商pid信息：填写（即：单服务商提交认证方式），查询申请单返回的认证二维码qr_code和填写服务商对应，仅能认证填写服务商下的商户；不填写（即：全服务商提交认证方式），查询申请单返回的认证二维码qr_code和收单机构对应，可认证收单机构下全部商户。
     *
     * @return self
     */
    public function setSource($source)
    {
        $this->container['source'] = $source;

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


