package com.ecwid.consul.v1.session.model;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * @author Vasily Vasilkov (vgv@ecwid.com)
 */
public class Session {

	public static enum Behavior {
		@SerializedName("release")
		RELEASE,

		@SerializedName("delete")
		DELETE
	}

	@SerializedName("LockDelay")
	private long lockDelay;

	@SerializedName("Checks")
	private List<String> checks;

	@SerializedName("Node")
	private String node;

	@SerializedName("ID")
	private String id;

	@SerializedName("CreateIndex")
	private long createIndex;

	@SerializedName("TTL")
	private String ttl;

	@SerializedName("Behavior")
	private Behavior behavior;

	public long getLockDelay() {
		return lockDelay;
	}

	public void setLockDelay(long lockDelay) {
		this.lockDelay = lockDelay;
	}

	public List<String> getChecks() {
		return checks;
	}

	public void setChecks(List<String> checks) {
		this.checks = checks;
	}

	public String getNode() {
		return node;
	}

	public void setNode(String node) {
		this.node = node;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public long getCreateIndex() {
		return createIndex;
	}

	public void setCreateIndex(long createIndex) {
		this.createIndex = createIndex;
	}

	public String getTtl() {
		return ttl;
	}

	public void setTtl(String ttl) {
		this.ttl = ttl;
	}

	public Behavior getBehavior() {
		return behavior;
	}

	public void setBehavior(Behavior behavior) {
		this.behavior = behavior;
	}

	@Override
	public String toString() {
		return "Session{" +
				"lockDelay=" + lockDelay +
				", checks=" + checks +
				", node='" + node + '\'' +
				", id='" + id + '\'' +
				", createIndex=" + createIndex +
				", ttl='" + ttl + '\'' +
				", behavior=" + behavior +
				'}';
	}
}

@@ -529,42 +529,150 @@
 me(%22
-CreateIndex%22)%0A%09private long create
+Name%22)%0A%09private String name;%0A%0A%09@SerializedName(%22CreateIndex%22)%0A%09private long createIndex;%0A%0A%09@SerializedName(%22ModifyIndex%22)%0A%09private long modify
 Inde
@@ -1233,32 +1233,138 @@
 is.id = id;%0A%09%7D%0A%0A
+%09public String getName() %7B%0A%09%09return name;%0A%09%7D%0A%0A%09public void setName(String name) %7B%0A%09%09this.name = name;%0A%09%7D%0A%0A
 %09public long get
@@ -1483,32 +1483,176 @@
 reateIndex;%0A%09%7D%0A%0A
+%09public long getModifyIndex() %7B%0A%09%09return modifyIndex;%0A%09%7D%0A%0A%09public void setModifyIndex(long modifyIndex) %7B%0A%09%09this.modifyIndex = modifyIndex;%0A%09%7D%0A%0A
 %09public String g
@@ -2057,30 +2057,98 @@
 %09%22, 
-createIndex=%22 + create
+name='%22 + name + '%5C'' +%0A%09%09%09%09%22, createIndex=%22 + createIndex +%0A%09%09%09%09%22, modifyIndex=%22 + modify
 Inde

Fix #43 Added 'Name' and 'ModifyIndex' to session model