package com.usoftchina.qywx.sdk.dto;

import java.util.HashMap;
import java.util.Map;

/**
 * @author yingp
 */
public class GetScheduleByCalendarReq {
    /**
     * 日历ID
     */
    private String calId;
    /**
     * 分页，偏移量, 默认为0
     */
    private Integer offset;
    /**
     * 分页，预期请求的数据量，默认为500，取值范围 1 ~ 1000
     */
    private Integer limit;

    public GetScheduleByCalendarReq calId(String calId) {
        this.calId = calId;
        return this;
    }

    public GetScheduleByCalendarReq offset(int offset) {
        this.offset = offset;
        return this;
    }

    public GetScheduleByCalendarReq limit(int limit) {
        this.limit = limit;
        return this;
    }

    public Map<String, Object> build() {
        Map<String, Object> data = new HashMap<>(3);
        data.put("cal_id", calId);
        if (null != offset) {
            data.put("offset", offset);
        }
        if (null != limit) {
            data.put("limit", limit);
        }
        return data;
    }
}
