// Path: src/main/java/com/gengo/client/enums/Tier.java
// public enum Tier
// {
// 	MACHINE,
// 	STANDARD,
// 	PRO,
// 	ULTRA;
// 	
// 	public String toRequestString()
// 	{
// 	    return super.toString().toLowerCase();
// 	}
// 	
// 	public String toString()
// 	{
// 	    return toRequestString();
// 	}
// 	
// };
// 
// Path: src/main/java/com/gengo/client/exceptions/GengoException.java
// @SuppressWarnings("serial")
// /**
//  * Encapsulates all exceptions thrown by the API 
//  */
// public class GengoException extends Exception
// {
// 	public GengoException(String e)
// 	{
// 		super(e);
// 	}
// 	
// 	public GengoException(String msg, Throwable cause)
// 	{
// 		super(msg, cause);
// 	}
// 	
// }


import org.json.JSONException;
import org.json.JSONObject;
import com.gengo.client.enums.Tier;
import com.gengo.client.exceptions.GengoException;
package com.gengo.client.payloads;



/**
 * Abstract base class for update payloads
 */
public abstract class JobUpdate extends Payload
{
    private int jobId = 0;
    
    private String lcSrc;
    private String lcTgt;
    private String bodySrc;
    private Tier tier;

    /**
     * Create a job update payload identified by job ID
     * @param jobId
     */
    public JobUpdate(int jobId)
    {
        this.jobId = jobId;
    }
    
    /**
     * Create a job update payload identified by source and target languages, text body and tier
     * @param lcSrc
     * @param lcTgt
     * @param bodySrc
     * @param tier
     */
    public JobUpdate(String lcSrc, String lcTgt, String bodySrc, Tier tier)
    {
        this.jobId = 0;
        this.lcSrc = lcSrc;
        this.lcTgt = lcTgt;
        this.bodySrc = bodySrc;
        this.tier = tier;
    }
    
    /**
     * Determine whether this update identifies job by job ID or not
     * @return true if the job is identified by job ID, false if indentified by (lcSrc, lcTgt, bodySrc, tier)
     */
    public boolean isIdentifiedByJobId()
    {
        return 0 != jobId;
    }
    
    /**
     * Create a JSONObject representing this update
     * @return the JSONObject created
     * @throws GengoException
     */
// Path: src/main/java/com/gengo/client/enums/Tier.java
// public enum Tier
// {
// 	MACHINE,
// 	STANDARD,
// 	PRO,
// 	ULTRA;
// 	
// 	public String toRequestString()
// 	{
// 	    return super.toString().toLowerCase();
// 	}
// 	
// 	public String toString()
// 	{
// 	    return toRequestString();
// 	}
// 	
// };
// 
// Path: src/main/java/com/gengo/client/exceptions/GengoException.java
// @SuppressWarnings("serial")
// /**
//  * Encapsulates all exceptions thrown by the API 
//  */
// public class GengoException extends Exception
// {
// 	public GengoException(String e)
// 	{
// 		super(e);
// 	}
// 	
// 	public GengoException(String msg, Throwable cause)
// 	{
// 		super(msg, cause);
// 	}
// 	
// }


// Path: src/main/java/com/gengo/client/payloads/JobUpdate.java
import org.json.JSONException;
import org.json.JSONObject;
import com.gengo.client.enums.Tier;
import com.gengo.client.exceptions.GengoException;

package com.gengo.client.payloads;



/**
 * Abstract base class for update payloads
 */
public abstract class JobUpdate extends Payload
{
    private int jobId = 0;
    
    private String lcSrc;
    private String lcTgt;
    private String bodySrc;
    private Tier tier;

    /**
     * Create a job update payload identified by job ID
     * @param jobId
     */
    public JobUpdate(int jobId)
    {
        this.jobId = jobId;
    }
    
    /**
     * Create a job update payload identified by source and target languages, text body and tier
     * @param lcSrc
     * @param lcTgt
     * @param bodySrc
     * @param tier
     */
    public JobUpdate(String lcSrc, String lcTgt, String bodySrc, Tier tier)
    {
        this.jobId = 0;
        this.lcSrc = lcSrc;
        this.lcTgt = lcTgt;
        this.bodySrc = bodySrc;
        this.tier = tier;
    }
    
    /**
     * Determine whether this update identifies job by job ID or not
     * @return true if the job is identified by job ID, false if indentified by (lcSrc, lcTgt, bodySrc, tier)
     */
    public boolean isIdentifiedByJobId()
    {
        return 0 != jobId;
    }
    
    /**
     * Create a JSONObject representing this update
     * @return the JSONObject created
     * @throws GengoException
     */
    public JSONObject toJSONObject() throws GengoException