package com.rdiot.yx485.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;
import com.rdiot.yx485.http.entity.BaseReplyBean;

import java.util.List;

public class DeviceTreeBean extends BaseReplyBean {

    public List<DataBean> data;

    public static class DataBean {
        /**
         * record_id : 10w4umsiig2cts62vlix9pe79go05s6w
         * code : YX-F
         * name : 氟系统
         * parent_id :
         * is_master : false
         * icon :
         * children : [{"record_id":"2pw4umsiig2cts5zphbiqwv568pya11","code":"YXK-Z/86-FG-A","name":"主控制器","parent_id":"10w4umsiig2cts62vlix9pe79go05s6w","is_master":true,"icon":"/s/yongxu/1pw4ums98q0d7ym7ra0y7i7kh0jeqx6m/1.png","children":null,"control_url":"","steps":[{"record_id":"1pw4ums1e4rd3gf2pekhflx3g0abj83x","device_type_id":"2pw4umsiig2cts5zphbiqwv568pya11","device_type_name":"","sequence":1,"desc":"1、主控开机状态下，长按『菜单键』3s进入设置界面","photo":"/s/yongxu/1pw4ums98q0d7yljtpve7b4k70s7m6o1/img_reset_1.png"},{"record_id":"1pw4ums1e4rd3gf2per42ia3j041b5e1","device_type_id":"2pw4umsiig2cts5zphbiqwv568pya11","device_type_name":"","sequence":2,"desc":"2、再次长按『菜单键』，直到显示配网二维码","photo":"/s/yongxu/1pw4ums98q0d7ylk958bws1k90iyzmci/img_reset_2.png"}]},{"record_id":"3pw4umsiig2cts62vlix9pe79go05s63","code":"YXK-F/86-FG-A","name":"分控制器","parent_id":"10w4umsiig2cts62vlix9pe79go05s6w","is_master":false,"icon":"/s/yongxu/1pw4ums98q0d7ym81r99lt3kj0sep3ra/2.png","children":null,"control_url":"","steps":[{"record_id":"1pw4ums1fm6d3hez3w0n62pq002w3zz6","device_type_id":"3pw4umsiig2cts62vlix9pe79go05s63","device_type_name":"","sequence":1,"desc":"1、分控开机状态下，长按『菜单键』3s直到界面出现配网二维码","photo":"/s/yongxu/1pw4ums98q0d7ylkhbkfpy7kb04ckcgw/img_sub_reset_1.png"},{"record_id":"1pw4ums1h4jd3ko0i58kj3fr002rtcmy","device_type_id":"3pw4umsiig2cts62vlix9pe79go05s63","device_type_name":"","sequence":2,"desc":"2、使用APP扫码绑定","photo":"/s/yongxu/1pw4ums98q0d7ylkoypnupfkd0p4egmj/img_reset_2.png"}]}]
         * control_url :
         * steps : null
         */

        public String record_id;
        public String name;
        public String parent_id;
        public boolean is_master;
        public String icon;
        public boolean need_device_code;
        public boolean bluetooth;
        public String control_url;
        public Object steps;
        public Boolean isselect;
        public List<ChildrenBean> children;

        public static class ChildrenBean implements Parcelable {
            public static final Creator<ChildrenBean> CREATOR = new Creator<ChildrenBean>() {
                @Override
                public ChildrenBean createFromParcel(Parcel in) {
                    return new ChildrenBean(in);
                }

                @Override
                public ChildrenBean[] newArray(int size) {
                    return new ChildrenBean[size];
                }
            };
            /**
             * record_id : 2pw4umsiig2cts5zphbiqwv568pya11
             * code : YXK-Z/86-FG-A
             * name : 主控制器
             * parent_id : 10w4umsiig2cts62vlix9pe79go05s6w
             * is_master : true
             * icon : /s/yongxu/1pw4ums98q0d7ym7ra0y7i7kh0jeqx6m/1.png
             * children : null
             * control_url :
             * steps : [{"record_id":"1pw4ums1e4rd3gf2pekhflx3g0abj83x","device_type_id":"2pw4umsiig2cts5zphbiqwv568pya11","device_type_name":"","sequence":1,"desc":"1、主控开机状态下，长按『菜单键』3s进入设置界面","photo":"/s/yongxu/1pw4ums98q0d7yljtpve7b4k70s7m6o1/img_reset_1.png"},{"record_id":"1pw4ums1e4rd3gf2per42ia3j041b5e1","device_type_id":"2pw4umsiig2cts5zphbiqwv568pya11","device_type_name":"","sequence":2,"desc":"2、再次长按『菜单键』，直到显示配网二维码","photo":"/s/yongxu/1pw4ums98q0d7ylk958bws1k90iyzmci/img_reset_2.png"}]
             */

            public String record_id;
            @SerializedName("code")
            public String codeX;
            public String name;
            public String parent_id;
            public boolean is_master;
            //是否需要输入设备号
            public boolean need_device_code;
            //是否需要通过蓝牙连接
            public boolean bluetooth;
            public String icon;
            public Object children;
            public String control_url;
            public String blue_code;
            public List<StepsBean> steps;

            protected ChildrenBean(Parcel in) {
                record_id = in.readString();
                codeX = in.readString();
                name = in.readString();
                parent_id = in.readString();
                is_master = in.readByte() != 0;
                need_device_code = in.readByte() != 0;
                bluetooth = in.readByte() != 0;
                icon = in.readString();
                control_url = in.readString();
                blue_code = in.readString();
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(record_id);
                dest.writeString(codeX);
                dest.writeString(name);
                dest.writeString(parent_id);
                dest.writeByte((byte) (is_master ? 1 : 0));
                dest.writeByte((byte) (need_device_code ? 1 : 0));
                dest.writeByte((byte) (bluetooth ? 1 : 0));
                dest.writeString(icon);
                dest.writeString(control_url);
            }

            public static class StepsBean implements Parcelable {
                public static final Creator<StepsBean> CREATOR = new Creator<StepsBean>() {
                    @Override
                    public StepsBean createFromParcel(Parcel in) {
                        return new StepsBean(in);
                    }

                    @Override
                    public StepsBean[] newArray(int size) {
                        return new StepsBean[size];
                    }
                };
                /**
                 * record_id : 1pw4ums1e4rd3gf2pekhflx3g0abj83x
                 * device_type_id : 2pw4umsiig2cts5zphbiqwv568pya11
                 * device_type_name :
                 * sequence : 1
                 * desc : 1、主控开机状态下，长按『菜单键』3s进入设置界面
                 * photo : /s/yongxu/1pw4ums98q0d7yljtpve7b4k70s7m6o1/img_reset_1.png
                 */

                public String record_id;
                public String device_type_id;
                public String device_type_name;
                public int sequence;
                public String desc;
                public String photo;

                protected StepsBean(Parcel in) {
                    record_id = in.readString();
                    device_type_id = in.readString();
                    device_type_name = in.readString();
                    sequence = in.readInt();
                    desc = in.readString();
                    photo = in.readString();
                }

                @Override
                public int describeContents() {
                    return 0;
                }

                @Override
                public void writeToParcel(Parcel dest, int flags) {
                    dest.writeString(record_id);
                    dest.writeString(device_type_id);
                    dest.writeString(device_type_name);
                    dest.writeInt(sequence);
                    dest.writeString(desc);
                    dest.writeString(photo);
                }
            }
        }
    }
}
