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

com.jelastic.api.marketplace.response.AppInfoResponse Maven / Gradle / Ivy

The newest version!
/*Server class MD5: f05f8b2f25015ba884589253896d9a5e*/
package com.jelastic.api.marketplace.response;

import com.jelastic.api.response.ScriptEvalProxyResponse;
import org.json.JSONException;
import org.json.JSONObject;

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

    private JSONObject app = null;

    private JSONObject settings = null;

    public AppInfoResponse() {
        super();
    }

    public AppInfoResponse(JSONObject app) {
        super();
        this.app = app;
    }

    public AppInfoResponse(JSONObject app, JSONObject settings) {
        super();
        this.app = app;
        this.settings = settings;
    }

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

    public JSONObject getApp() {
        return this.app;
    }

    public void setApp(JSONObject app) {
        this.app = app;
    }

    public JSONObject getSettings() {
        return this.settings;
    }

    public void setSettings(JSONObject settings) {
        this.settings = settings;
    }

    @Override
    public JSONObject _toJSON(JSONObject json) throws JSONException {
        if (app != null) {
            json.put("app", app);
        }
        if (settings != null) {
            json.put("settings", settings);
        }
        return json;
    }

    @Override
    public AppInfoResponse _fromJSON(JSONObject json) throws JSONException {
        super._fromJSON(json);
        if (!(getResponse() instanceof JSONObject)) {
            return this;
        }
        JSONObject responseJson = (JSONObject) getResponse();
        if (responseJson.has("app")) {
            this.app = responseJson.getJSONObject("app");
        }
        if (responseJson.has("settings")) {
            this.settings = responseJson.getJSONObject("settings");
        }
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy