<?php

// This file is auto-generated, don't edit it. Thanks.

namespace AlibabaCloud\SDK\Dingtalk\Vdatacenter_1_0\Models;

use AlibabaCloud\SDK\Dingtalk\Vdatacenter_1_0\Models\QueryGeneralDataServiceBatchRequest\filters;
use AlibabaCloud\Tea\Model;

class QueryGeneralDataServiceBatchRequest extends Model
{
    /**
     * @var string[]
     */
    public $deptIds;

    /**
     * @description This parameter is required.
     *
     * @var string
     */
    public $endDate;

    /**
     * @var filters[]
     */
    public $filters;

    /**
     * @description This parameter is required.
     *
     * @var int
     */
    public $pageNumber;

    /**
     * @description This parameter is required.
     *
     * @var int
     */
    public $pageSize;

    /**
     * @var bool
     */
    public $returnTotal;

    /**
     * @description This parameter is required.
     *
     * @var string
     */
    public $serviceId;

    /**
     * @description This parameter is required.
     *
     * @var string
     */
    public $startDate;

    /**
     * @var string
     */
    public $userId;

    /**
     * @var string[]
     */
    public $userIds;
    protected $_name = [
        'deptIds' => 'deptIds',
        'endDate' => 'endDate',
        'filters' => 'filters',
        'pageNumber' => 'pageNumber',
        'pageSize' => 'pageSize',
        'returnTotal' => 'returnTotal',
        'serviceId' => 'serviceId',
        'startDate' => 'startDate',
        'userId' => 'userId',
        'userIds' => 'userIds',
    ];

    public function validate() {}

    public function toMap()
    {
        $res = [];
        if (null !== $this->deptIds) {
            $res['deptIds'] = $this->deptIds;
        }
        if (null !== $this->endDate) {
            $res['endDate'] = $this->endDate;
        }
        if (null !== $this->filters) {
            $res['filters'] = [];
            if (null !== $this->filters && \is_array($this->filters)) {
                $n = 0;
                foreach ($this->filters as $item) {
                    $res['filters'][$n++] = null !== $item ? $item->toMap() : $item;
                }
            }
        }
        if (null !== $this->pageNumber) {
            $res['pageNumber'] = $this->pageNumber;
        }
        if (null !== $this->pageSize) {
            $res['pageSize'] = $this->pageSize;
        }
        if (null !== $this->returnTotal) {
            $res['returnTotal'] = $this->returnTotal;
        }
        if (null !== $this->serviceId) {
            $res['serviceId'] = $this->serviceId;
        }
        if (null !== $this->startDate) {
            $res['startDate'] = $this->startDate;
        }
        if (null !== $this->userId) {
            $res['userId'] = $this->userId;
        }
        if (null !== $this->userIds) {
            $res['userIds'] = $this->userIds;
        }

        return $res;
    }

    /**
     * @param array $map
     *
     * @return QueryGeneralDataServiceBatchRequest
     */
    public static function fromMap($map = [])
    {
        $model = new self();
        if (isset($map['deptIds'])) {
            if (!empty($map['deptIds'])) {
                $model->deptIds = $map['deptIds'];
            }
        }
        if (isset($map['endDate'])) {
            $model->endDate = $map['endDate'];
        }
        if (isset($map['filters'])) {
            if (!empty($map['filters'])) {
                $model->filters = [];
                $n = 0;
                foreach ($map['filters'] as $item) {
                    $model->filters[$n++] = null !== $item ? filters::fromMap($item) : $item;
                }
            }
        }
        if (isset($map['pageNumber'])) {
            $model->pageNumber = $map['pageNumber'];
        }
        if (isset($map['pageSize'])) {
            $model->pageSize = $map['pageSize'];
        }
        if (isset($map['returnTotal'])) {
            $model->returnTotal = $map['returnTotal'];
        }
        if (isset($map['serviceId'])) {
            $model->serviceId = $map['serviceId'];
        }
        if (isset($map['startDate'])) {
            $model->startDate = $map['startDate'];
        }
        if (isset($map['userId'])) {
            $model->userId = $map['userId'];
        }
        if (isset($map['userIds'])) {
            if (!empty($map['userIds'])) {
                $model->userIds = $map['userIds'];
            }
        }

        return $model;
    }
}
