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

com.jelastic.api.configuration.response.SecretResponse Maven / Gradle / Ivy

The newest version!
/*Server class MD5: 6c14a12602f87bd6ad02b9b7e0c735ae*/
package com.jelastic.api.configuration.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 SecretResponse extends ScriptEvalProxyResponse {

    private JSONObject secret = null;

    public SecretResponse() {
        super();
    }

    public SecretResponse(JSONObject secret) {
        super();
        this.secret = secret;
    }

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

    public JSONObject getSecret() {
        return secret;
    }

    public void setSecret(JSONObject secret) {
        this.secret = secret;
    }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy