package com.vimeo.networking.model;

import com.vimeo.stag.GsonAdapterKey;

import org.jetbrains.annotations.NotNull;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * A model that holds the type of push subscriptions a user has. This class
 * has both getters and setters since a user can update their subscriptions
 * using a Patch.
 * <p>
 * Created by zetterstromk on 12/15/16.
 */
public class Subscriptions implements Serializable {

    private static final long serialVersionUID = 3088065484753327987L;

    public static final String KEY_COMMENT = "comment";
    public static final String KEY_CREDIT = "credit";
    public static final String KEY_LIKE = "like";
    public static final String KEY_REPLY = "reply";
    public static final String KEY_FOLLOW = "follow";
    public static final String KEY_VIDEO_AVAILABLE = "video_available";

    @GsonAdapterKey(KEY_COMMENT)
    boolean mComment;

    @GsonAdapterKey(KEY_CREDIT)
    boolean mCredit;

    @GsonAdapterKey(KEY_LIKE)
    boolean mLike;

    @GsonAdapterKey(KEY_REPLY)
    boolean mReply;

    @GsonAdapterKey(KEY_FOLLOW)
    boolean mFollow;

    @GsonAdapterKey(KEY_VIDEO_AVAILABLE)
    boolean mVideoAvailable;

    public boolean isComment() {
        return mComment;
    }

    public void setComment(boolean comment) {
        mComment = comment;
    }

    public boolean isCredit() {
        return mCredit;
    }

    public void setCredit(boolean credit) {
        mCredit = credit;
    }

    public boolean isLike() {
        return mLike;
    }

    public void setLike(boolean like) {
        mLike = like;
    }

    public boolean isReply() {
        return mReply;
    }

    public void setReply(boolean reply) {
        mReply = reply;
    }

    public boolean isFollow() {
        return mFollow;
    }

    public void setFollow(boolean follow) {
        mFollow = follow;
    }

    public boolean isVideoAvailable() {
        return mVideoAvailable;
    }

    public void setVideoAvailable(boolean videoAvailable) {
        mVideoAvailable = videoAvailable;
    }

    @NotNull
    public Map<String, Boolean> getMapFromSubscriptions() {
        Map<String, Boolean> map = new HashMap<>();

        map.put(KEY_COMMENT, mComment);
        map.put(KEY_CREDIT, mCredit);
        map.put(KEY_LIKE, mLike);
        map.put(KEY_REPLY, mReply);
        map.put(KEY_FOLLOW, mFollow);
        map.put(KEY_VIDEO_AVAILABLE, mVideoAvailable);

        return map;
    }
}

@@ -1238,16 +1238,25 @@
 olean is
+Receiving
 Comment(
@@ -1307,19 +1307,23 @@
 ic void 
-set
+receive
 Comment(
@@ -1330,23 +1330,23 @@
 boolean 
-comment
+receive
 ) %7B%0A    
@@ -1360,23 +1360,23 @@
 mment = 
-comment
+receive
 ;%0A    %7D%0A
@@ -1397,16 +1397,25 @@
 olean is
+Receiving
 Credit()
@@ -1464,19 +1464,23 @@
 ic void 
-set
+receive
 Credit(b
@@ -1486,22 +1486,23 @@
 boolean 
-credit
+receive
 ) %7B%0A    
@@ -1515,22 +1515,23 @@
 redit = 
-credit
+receive
 ;%0A    %7D%0A
@@ -1552,16 +1552,25 @@
 olean is
+Receiving
 Like() %7B
@@ -1615,19 +1615,23 @@
 ic void 
-set
+receive
 Like(boo
@@ -1635,19 +1635,22 @@
 boolean 
-lik
+receiv
 e) %7B%0A   
@@ -1662,19 +1662,22 @@
 mLike = 
-lik
+receiv
 e;%0A    %7D
@@ -1701,16 +1701,25 @@
 ean isRe
+ceivingRe
 ply() %7B%0A
@@ -1764,19 +1764,23 @@
 ic void 
-set
+receive
 Reply(bo
@@ -1787,19 +1787,21 @@
 olean re
-ply
+ceive
 ) %7B%0A    
@@ -1815,19 +1815,21 @@
 ply = re
-ply
+ceive
 ;%0A    %7D%0A
@@ -1850,16 +1850,25 @@
 olean is
+Receiving
 Follow()
@@ -1917,19 +1917,23 @@
 ic void 
-set
+receive
 Follow(b
@@ -1939,22 +1939,23 @@
 boolean 
-follow
+receive
 ) %7B%0A    
@@ -1968,22 +1968,23 @@
 ollow = 
-follow
+receive
 ;%0A    %7D%0A
@@ -2005,16 +2005,25 @@
 olean is
+Receiving
 VideoAva
@@ -2088,19 +2088,23 @@
 ic void 
-set
+receive
 VideoAva
@@ -2118,29 +2118,22 @@
 boolean 
-videoAvailabl
+receiv
 e) %7B%0A   
@@ -2159,21 +2159,14 @@
 e = 
-videoAvailabl
+receiv
 e;%0A 

change method names