<?php
/**
 * ApplyOrderData
 *
 * 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;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'accessType' => 'string',
        'appName' => 'string',
        'appid' => 'string',
        'auditReason' => 'string',
        'brandTemplateId' => 'string',
        'createTime' => 'string',
        'isOldData' => 'bool',
        'latest' => 'bool',
        'majorStatus' => 'string',
        'orderId' => 'string',
        'partAgreeInfo' => '\Alipay\OpenAPISDK\Model\SearchPartAgreeInfo[]',
        'sceneCode' => 'string',
        'sceneName' => 'string',
        'serviceCode' => 'string',
        'status' => 'string',
        'subServiceName' => '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 = [
        'accessType' => null,
        'appName' => null,
        'appid' => null,
        'auditReason' => null,
        'brandTemplateId' => null,
        'createTime' => null,
        'isOldData' => null,
        'latest' => null,
        'majorStatus' => null,
        'orderId' => null,
        'partAgreeInfo' => null,
        'sceneCode' => null,
        'sceneName' => null,
        'serviceCode' => null,
        'status' => null,
        'subServiceName' => 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 = [
        'accessType' => 'access_type',
        'appName' => 'app_name',
        'appid' => 'appid',
        'auditReason' => 'audit_reason',
        'brandTemplateId' => 'brand_template_id',
        'createTime' => 'create_time',
        'isOldData' => 'is_old_data',
        'latest' => 'latest',
        'majorStatus' => 'major_status',
        'orderId' => 'order_id',
        'partAgreeInfo' => 'part_agree_info',
        'sceneCode' => 'scene_code',
        'sceneName' => 'scene_name',
        'serviceCode' => 'service_code',
        'status' => 'status',
        'subServiceName' => 'sub_service_name'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'accessType' => 'setAccessType',
        'appName' => 'setAppName',
        'appid' => 'setAppid',
        'auditReason' => 'setAuditReason',
        'brandTemplateId' => 'setBrandTemplateId',
        'createTime' => 'setCreateTime',
        'isOldData' => 'setIsOldData',
        'latest' => 'setLatest',
        'majorStatus' => 'setMajorStatus',
        'orderId' => 'setOrderId',
        'partAgreeInfo' => 'setPartAgreeInfo',
        'sceneCode' => 'setSceneCode',
        'sceneName' => 'setSceneName',
        'serviceCode' => 'setServiceCode',
        'status' => 'setStatus',
        'subServiceName' => 'setSubServiceName'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'accessType' => 'getAccessType',
        'appName' => 'getAppName',
        'appid' => 'getAppid',
        'auditReason' => 'getAuditReason',
        'brandTemplateId' => 'getBrandTemplateId',
        'createTime' => 'getCreateTime',
        'isOldData' => 'getIsOldData',
        'latest' => 'getLatest',
        'majorStatus' => 'getMajorStatus',
        'orderId' => 'getOrderId',
        'partAgreeInfo' => 'getPartAgreeInfo',
        'sceneCode' => 'getSceneCode',
        'sceneName' => 'getSceneName',
        'serviceCode' => 'getServiceCode',
        'status' => 'getStatus',
        'subServiceName' => 'getSubServiceName'
    ];

    /**
     * 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['accessType'] = $data['accessType'] ?? null;
        $this->container['appName'] = $data['appName'] ?? null;
        $this->container['appid'] = $data['appid'] ?? null;
        $this->container['auditReason'] = $data['auditReason'] ?? null;
        $this->container['brandTemplateId'] = $data['brandTemplateId'] ?? null;
        $this->container['createTime'] = $data['createTime'] ?? null;
        $this->container['isOldData'] = $data['isOldData'] ?? null;
        $this->container['latest'] = $data['latest'] ?? null;
        $this->container['majorStatus'] = $data['majorStatus'] ?? null;
        $this->container['orderId'] = $data['orderId'] ?? null;
        $this->container['partAgreeInfo'] = $data['partAgreeInfo'] ?? null;
        $this->container['sceneCode'] = $data['sceneCode'] ?? null;
        $this->container['sceneName'] = $data['sceneName'] ?? null;
        $this->container['serviceCode'] = $data['serviceCode'] ?? null;
        $this->container['status'] = $data['status'] ?? null;
        $this->container['subServiceName'] = $data['subServiceName'] ?? 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 accessType
     *
     * @return string|null
     */
    public function getAccessType()
    {
        return $this->container['accessType'];
    }

    /**
     * Sets accessType
     *
     * @param string|null $accessType 申请类型 BASE：基础信息， BRAND_BOX：品牌直达，SERVICE_BOX服务直达
     *
     * @return self
     */
    public function setAccessType($accessType)
    {
        $this->container['accessType'] = $accessType;

        return $this;
    }

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

    /**
     * Sets appName
     *
     * @param string|null $appName 小程序名称
     *
     * @return self
     */
    public function setAppName($appName)
    {
        $this->container['appName'] = $appName;

        return $this;
    }

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

    /**
     * Sets appid
     *
     * @param string|null $appid 小程序id
     *
     * @return self
     */
    public function setAppid($appid)
    {
        $this->container['appid'] = $appid;

        return $this;
    }

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

    /**
     * Sets auditReason
     *
     * @param string|null $auditReason 审核原因
     *
     * @return self
     */
    public function setAuditReason($auditReason)
    {
        $this->container['auditReason'] = $auditReason;

        return $this;
    }

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

    /**
     * Sets brandTemplateId
     *
     * @param string|null $brandTemplateId 品牌的模板id ONE_WITH_TWO：一拖二、DEFAULT：一拖四
     *
     * @return self
     */
    public function setBrandTemplateId($brandTemplateId)
    {
        $this->container['brandTemplateId'] = $brandTemplateId;

        return $this;
    }

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

    /**
     * Sets createTime
     *
     * @param string|null $createTime 创建时间
     *
     * @return self
     */
    public function setCreateTime($createTime)
    {
        $this->container['createTime'] = $createTime;

        return $this;
    }

    /**
     * Gets isOldData
     *
     * @return bool|null
     */
    public function getIsOldData()
    {
        return $this->container['isOldData'];
    }

    /**
     * Sets isOldData
     *
     * @param bool|null $isOldData 标识老工单
     *
     * @return self
     */
    public function setIsOldData($isOldData)
    {
        $this->container['isOldData'] = $isOldData;

        return $this;
    }

    /**
     * Gets latest
     *
     * @return bool|null
     */
    public function getLatest()
    {
        return $this->container['latest'];
    }

    /**
     * Sets latest
     *
     * @param bool|null $latest 是不是最新的工单
     *
     * @return self
     */
    public function setLatest($latest)
    {
        $this->container['latest'] = $latest;

        return $this;
    }

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

    /**
     * Sets majorStatus
     *
     * @param string|null $majorStatus 服务主状态,INITIAL:初始化；VALID：已生效；INVALID：已失效
     *
     * @return self
     */
    public function setMajorStatus($majorStatus)
    {
        $this->container['majorStatus'] = $majorStatus;

        return $this;
    }

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

    /**
     * Sets orderId
     *
     * @param string|null $orderId 申请单ID
     *
     * @return self
     */
    public function setOrderId($orderId)
    {
        $this->container['orderId'] = $orderId;

        return $this;
    }

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

    /**
     * Sets partAgreeInfo
     *
     * @param \Alipay\OpenAPISDK\Model\SearchPartAgreeInfo[]|null $partAgreeInfo 审核提效部分剔除数据的信息
     *
     * @return self
     */
    public function setPartAgreeInfo($partAgreeInfo)
    {
        $this->container['partAgreeInfo'] = $partAgreeInfo;

        return $this;
    }

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

    /**
     * Sets sceneCode
     *
     * @param string|null $sceneCode 场景编码
     *
     * @return self
     */
    public function setSceneCode($sceneCode)
    {
        $this->container['sceneCode'] = $sceneCode;

        return $this;
    }

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

    /**
     * Sets sceneName
     *
     * @param string|null $sceneName 场景名称
     *
     * @return self
     */
    public function setSceneName($sceneName)
    {
        $this->container['sceneName'] = $sceneName;

        return $this;
    }

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

    /**
     * Sets serviceCode
     *
     * @param string|null $serviceCode 服务码
     *
     * @return self
     */
    public function setServiceCode($serviceCode)
    {
        $this->container['serviceCode'] = $serviceCode;

        return $this;
    }

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

    /**
     * Sets status
     *
     * @param string|null $status 申请状态 AGREE、REJECT、EDIT、AUDIT
     *
     * @return self
     */
    public function setStatus($status)
    {
        $this->container['status'] = $status;

        return $this;
    }

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

    /**
     * Sets subServiceName
     *
     * @param string|null $subServiceName 子服务名称
     *
     * @return self
     */
    public function setSubServiceName($subServiceName)
    {
        $this->container['subServiceName'] = $subServiceName;

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


