package com.rocketchat.core.model;

import com.google.auto.value.AutoValue;
import com.rocketchat.common.data.Timestamp;
import com.rocketchat.common.data.model.BaseRoom;
import com.squareup.moshi.Json;
import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.Moshi;
import javax.annotation.Nullable;

/**
 * Created by sachin on 19/7/17.
 */
@AutoValue
public abstract class Subscription extends BaseRoom {

    @Json(name = "rid")
    @Nullable
    public abstract String roomId();

    @Json(name = "ts")
    @Nullable
    public abstract String timestamp();

    @Json(name = "ls")
    @Nullable
    public abstract String lastSeen();

    @Nullable
    public abstract Boolean open();

    @Nullable
    public abstract Boolean alert();

    @Nullable
    public abstract Integer unread();

    @Json(name = "f")
    @Nullable
    public abstract Boolean favourite();

    @Json(name = "_updatedAt")
    @Nullable
    public abstract String updatedAt();

    @Nullable
    public abstract String desktopNotifications();

    @Nullable
    public abstract String mobilePushNotifications();

    @Nullable
    public abstract String emailNotifications();


    // TODO: 10/10/17 subscriptionId = object.getString("_id");
    // TODO: 10/10/17 favourite = object.getBoolean("f");
    // TODO: 10/10/17  blocked = object.optBoolean("blocked");
    // TODO: 10/10/17 fullname = object.optString("fname");
    // TODO: 10/10/17 lastActivity = new Date(object.getJSONObject("lastActivity").getLong("$date"));

    public static JsonAdapter<Subscription> jsonAdapter(Moshi moshi) {
        return new AutoValue_Subscription.MoshiJsonAdapter(moshi);
    }
}
@@ -414,84 +414,8 @@
  %7B%0A%0A
-    @Json(name = %22rid%22)%0A    @Nullable%0A    public abstract String roomId();%0A%0A
     

Remove roomId()