package com.bytedance.ies.xbridge.model.params;

import X.JA3;
import X.JA7;
import X.K4J;
import X.K4o;
import X.K4r;
import X.LeY;
import X.M12;
import com.bytedance.covode.number.Covode;
import kotlin.h.b.n;

public final class XSetCalendarEventMethodParamModel extends JA7 {
    public static final JA3 Companion = new JA3((byte) 0);
    public final String action;
    public Long alarmOffsets;
    public Boolean allDay;
    public Long endDate = 0L;
    public String eventID;
    public String location;
    public String notes;
    public Long startDate = 0L;
    public String title;
    public String url;

    static {
        Covode.recordClassIndex(31753);
    }

    public final String getAction() {
        return this.action;
    }

    public final Long getAlarmOffsets() {
        return this.alarmOffsets;
    }

    public final Boolean getAllDay() {
        return this.allDay;
    }

    public final Long getEndDate() {
        return this.endDate;
    }

    public final String getEventID() {
        return this.eventID;
    }

    public final String getLocation() {
        return this.location;
    }

    public final String getNotes() {
        return this.notes;
    }

    public final Long getStartDate() {
        return this.startDate;
    }

    public final String getTitle() {
        return this.title;
    }

    public final String getUrl() {
        return this.url;
    }

    public final String toString() {
        String canonicalName = getClass().getCanonicalName();
        if (canonicalName == null) {
            canonicalName = "XCalendarMethodParamModel";
        }
        StringBuilder sb = new StringBuilder();
        sb.append(canonicalName + '(');
        sb.append("action = " + this.action + " ,");
        sb.append("eventID = " + this.eventID + " , ");
        sb.append("startDate = " + this.startDate + " , ");
        sb.append("endDate = " + this.endDate + " , ");
        sb.append("alarmOffsets = [ " + this.alarmOffsets + ' ');
        sb.append("], ");
        sb.append("allDay = " + this.allDay + " , ");
        sb.append("title = " + this.title + " , ");
        sb.append("notes = " + this.notes + " , ");
        sb.append("location = " + this.location + " , ");
        sb.append("url = " + this.url + ')');
        String sb2 = sb.toString();
        n.LIZ(sb2, "");
        return sb2;
    }

    public final void setAlarmOffsets(Long l) {
        this.alarmOffsets = l;
    }

    public final void setAllDay(Boolean bool) {
        this.allDay = bool;
    }

    public final void setEndDate(Long l) {
        this.endDate = l;
    }

    public final void setEventID(String str) {
        this.eventID = str;
    }

    public final void setLocation(String str) {
        this.location = str;
    }

    public final void setNotes(String str) {
        this.notes = str;
    }

    public final void setStartDate(Long l) {
        this.startDate = l;
    }

    public final void setTitle(String str) {
        this.title = str;
    }

    public final void setUrl(String str) {
        this.url = str;
    }

    public XSetCalendarEventMethodParamModel(String str) {
        M12.LIZ(str);
        this.action = str;
    }

    public static final XSetCalendarEventMethodParamModel convert(K4r k4r) {
        String str;
        M12.LIZ(k4r);
        String LIZ = K4o.LIZ(k4r, "eventID");
        if (n.LIZ(LIZ, "")) {
            str = "create";
        } else {
            str = "update";
        }
        Long LIZ2 = K4J.LIZ(k4r, "startDate");
        Long LIZ3 = K4J.LIZ(k4r, "endDate");
        String LIZ4 = K4o.LIZ(k4r, "location");
        String LIZ5 = K4o.LIZ(k4r, "url");
        String LIZ6 = K4o.LIZ(k4r, "title");
        String LIZ7 = K4o.LIZ(k4r, "notes");
        boolean LIZ8 = K4o.LIZ(k4r, "allDay", false);
        Long valueOf = Long.valueOf((long) JA7.Companion.LIZ(k4r, "alarmOffset", 0));
        XSetCalendarEventMethodParamModel xSetCalendarEventMethodParamModel = new XSetCalendarEventMethodParamModel(str);
        xSetCalendarEventMethodParamModel.setStartDate(LIZ2);
        xSetCalendarEventMethodParamModel.setEndDate(LIZ3);
        xSetCalendarEventMethodParamModel.setTitle(LIZ6);
        xSetCalendarEventMethodParamModel.setEventID(LIZ);
        xSetCalendarEventMethodParamModel.setNotes(LIZ7);
        xSetCalendarEventMethodParamModel.setAlarmOffsets(valueOf);
        xSetCalendarEventMethodParamModel.setLocation(LIZ4);
        xSetCalendarEventMethodParamModel.setUrl(LIZ5);
        xSetCalendarEventMethodParamModel.setAllDay(Boolean.valueOf(LIZ8));
        String action2 = xSetCalendarEventMethodParamModel.getAction();
        if (action2 == null || action2.length() == 0 || !LeY.LIZIZ(new String[]{"create", "delete", "update", "read"}, xSetCalendarEventMethodParamModel.getAction())) {
            return null;
        }
        if (n.LIZ(xSetCalendarEventMethodParamModel.getAction(), "create") || n.LIZ(xSetCalendarEventMethodParamModel.getAction(), "update")) {
            if ((n.LIZ(xSetCalendarEventMethodParamModel.getAction(), "update") && xSetCalendarEventMethodParamModel.getEventID() == null) || xSetCalendarEventMethodParamModel.getStartDate() == null || xSetCalendarEventMethodParamModel.getEndDate() == null) {
                return null;
            }
            Long endDate2 = xSetCalendarEventMethodParamModel.getEndDate();
            if (endDate2 == null) {
                n.LIZ();
            }
            long longValue = endDate2.longValue();
            Long startDate2 = xSetCalendarEventMethodParamModel.getStartDate();
            if (startDate2 == null) {
                n.LIZ();
            }
            if (longValue < startDate2.longValue()) {
                return null;
            }
            Long endDate3 = xSetCalendarEventMethodParamModel.getEndDate();
            if (endDate3 == null) {
                n.LIZ();
            }
            if (endDate3.longValue() < 0) {
                return null;
            }
            Long startDate3 = xSetCalendarEventMethodParamModel.getStartDate();
            if (startDate3 == null) {
                n.LIZ();
            }
            if (startDate3.longValue() < 0 || xSetCalendarEventMethodParamModel.getAlarmOffsets() == null) {
                return null;
            }
            Long alarmOffsets2 = xSetCalendarEventMethodParamModel.getAlarmOffsets();
            if (alarmOffsets2 == null) {
                n.LIZ();
            }
            if (alarmOffsets2.longValue() < 0 || xSetCalendarEventMethodParamModel.getAllDay() == null || xSetCalendarEventMethodParamModel.getTitle() == null || xSetCalendarEventMethodParamModel.getNotes() == null || xSetCalendarEventMethodParamModel.getLocation() == null || xSetCalendarEventMethodParamModel.getAllDay() == null || xSetCalendarEventMethodParamModel.getUrl() == null) {
                return null;
            }
            return xSetCalendarEventMethodParamModel;
        } else if ((n.LIZ(xSetCalendarEventMethodParamModel.getAction(), "delete") || n.LIZ(xSetCalendarEventMethodParamModel.getAction(), "read")) && xSetCalendarEventMethodParamModel.getEventID() == null) {
            return null;
        }
        return xSetCalendarEventMethodParamModel;
    }
}
