All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jelastic.api.environment.response.VcsUpdateResponse Maven / Gradle / Ivy

The newest version!
/*Server class MD5: 160f23ac41cfb013a291c61fb7cc57ed*/
package com.jelastic.api.environment.response;

import com.jelastic.api.Response;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * @name Jelastic API Client
 * @version 8.11.2
 * @copyright Jelastic, Inc.
 */
public class VcsUpdateResponse extends Response {

    public static final String LOG = "log";

    public static final String MESSAGE = "message";

    private String log;

    private String message;

    public VcsUpdateResponse() {
        super(Response.OK);
    }

    public VcsUpdateResponse(int result, String error) {
        super(result, error);
    }

    public VcsUpdateResponse(int result) {
        super(result);
    }

    public String getLog() {
        return log;
    }

    public void setLog(String log) {
        this.log = log;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public JSONObject _toJSON() throws JSONException {
        JSONObject response = super._toJSON();
        if (log != null) {
            response.put(LOG, log);
        }
        if (message != null) {
            response.put(MESSAGE, message);
        }
        return response;
    }

    @Override
    public VcsUpdateResponse _fromJSON(JSONObject json) throws JSONException {
        super._fromJSON(json);
        if (json.has(LOG)) {
            this.setLog(json.getString(LOG));
        }
        if (json.has(MESSAGE)) {
            this.setMessage(json.getString(MESSAGE));
        }
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy