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

com.jelastic.api.environment.response.deployment.BuildProjectResponse Maven / Gradle / Ivy

The newest version!
/*Server class MD5: 2edd5e5ab9822d48658ec3003288cd64*/
package com.jelastic.api.environment.response.deployment;

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 BuildProjectResponse extends Response {

    private static final String ID = "id";

    private static final String NAME = "name";

    private static final String URL = "url";

    private static final String LOGIN = "login";

    private static final String TYPE = "type";

    private static final String BRANCH = "branch";

    private static final String ENV_NAME = "envName";

    private static final String CONTEXT = "context";

    private static final String NODE_GROUP = "nodeGroup";

    private static final String AUTO_UPDATE = "autoUpdate";

    private static final String AUTO_UPDATE_INTERVAL = "autoUpdateInterval";

    private static final String AUTO_RESOLVE_CONFLICT = "autoResolveConflict";

    private static final String WORK_DIR = "workDir";

    private static final String HOOKS = "hooks";

    private static final String HASH = "hash";

    private static final String REPO_HASH = "repoHash";

    private int id;

    private String name;

    private String type;

    private String url;

    private String branch;

    private String login;

    private String envName;

    private String nodeGroup;

    private String context;

    private Boolean autoUpdate;

    private Integer autoUpdateInterval;

    private Boolean autoResolveConflict;

    private String workDir;

    private String hooks;

    private String hash;

    private String repoHash;

    public BuildProjectResponse() {
        super(OK);
    }

    public BuildProjectResponse(int id) {
        super(OK);
        this.id = id;
    }

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

    public int getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getBranch() {
        return branch;
    }

    public void setBranch(String branch) {
        this.branch = branch;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getEnvName() {
        return envName;
    }

    public void setEnvName(String envName) {
        this.envName = envName;
    }

    public String getNodeGroup() {
        return nodeGroup;
    }

    public void setNodeGroup(String nodeGroup) {
        this.nodeGroup = nodeGroup;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public Boolean getAutoUpdate() {
        return autoUpdate;
    }

    public void setAutoUpdate(Boolean autoUpdate) {
        this.autoUpdate = autoUpdate;
    }

    public Integer getAutoUpdateInterval() {
        return autoUpdateInterval;
    }

    public void setAutoUpdateInterval(Integer autoUpdateInterval) {
        this.autoUpdateInterval = autoUpdateInterval;
    }

    public Boolean getAutoResolveConflict() {
        return autoResolveConflict;
    }

    public void setAutoResolveConflict(Boolean autoResolveConflict) {
        this.autoResolveConflict = autoResolveConflict;
    }

    public String getWorkDir() {
        return workDir;
    }

    public void setWorkDir(String workDir) {
        this.workDir = workDir;
    }

    public String getHooks() {
        return hooks;
    }

    public void setHooks(String hooks) {
        this.hooks = hooks;
    }

    public String getHash() {
        return hash;
    }

    public void setHash(String hash) {
        this.hash = hash;
    }

    public String getRepoHash() {
        return repoHash;
    }

    public void setRepoHash(String repoHash) {
        this.repoHash = repoHash;
    }

    @Override
    public BuildProjectResponse _fromJSON(JSONObject json) throws JSONException {
        super._fromJSON(json);
        if (json.has(ID)) {
            this.id = json.getInt(ID);
        }
        if (json.has(NAME)) {
            this.name = json.getString(NAME);
        }
        if (json.has(TYPE)) {
            this.type = json.getString(TYPE);
        }
        if (json.has(URL)) {
            this.url = json.getString(URL);
        }
        if (json.has(LOGIN)) {
            this.login = json.getString(LOGIN);
        }
        if (json.has(ENV_NAME)) {
            this.envName = json.getString(ENV_NAME);
        }
        if (json.has(CONTEXT)) {
            this.context = json.getString(CONTEXT);
        }
        if (json.has(BRANCH)) {
            this.branch = json.getString(BRANCH);
        }
        if (json.has(AUTO_UPDATE)) {
            this.autoUpdate = json.getBoolean(AUTO_UPDATE);
        }
        if (json.has(WORK_DIR)) {
            this.workDir = json.getString(WORK_DIR);
        }
        if (json.has(AUTO_UPDATE_INTERVAL)) {
            this.autoUpdateInterval = json.getInt(AUTO_UPDATE_INTERVAL);
        }
        if (json.has(HASH)) {
            this.hash = json.getString(HASH);
        }
        if (json.has(AUTO_RESOLVE_CONFLICT)) {
            this.autoResolveConflict = json.getBoolean(AUTO_RESOLVE_CONFLICT);
        }
        if (json.has(HOOKS)) {
            this.hooks = json.getString(HOOKS);
        }
        if (json.has(NODE_GROUP)) {
            this.nodeGroup = json.getString(NODE_GROUP);
        }
        if (json.has(REPO_HASH)) {
            this.repoHash = json.getString(REPO_HASH);
        }
        return this;
    }

    @Override
    public JSONObject _toJSON() throws JSONException {
        JSONObject json = super._toJSON();
        if (super.isNotOK()) {
            return json;
        }
        json.put(ID, id);
        json.put(NAME, name);
        json.put(TYPE, type);
        json.put(URL, url);
        json.put(LOGIN, login);
        json.put(ENV_NAME, envName);
        json.put(CONTEXT, context);
        json.put(BRANCH, branch);
        json.put(AUTO_UPDATE, autoUpdate);
        json.put(AUTO_UPDATE_INTERVAL, autoUpdateInterval);
        json.put(HASH, hash);
        json.put(AUTO_RESOLVE_CONFLICT, autoResolveConflict);
        json.put(WORK_DIR, workDir);
        json.put(HOOKS, hooks);
        json.put(NODE_GROUP, nodeGroup);
        json.put(REPO_HASH, repoHash);
        return json;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy