com.jelastic.api.environment.response.BuildProjectResponse Maven / Gradle / Ivy
The newest version!
/*Server class MD5: b72ff94691b880816de86645317157ec*/
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 BuildProjectResponse extends Response {
public static final String ID = "id";
public static final String NAME = "name";
public static final String PATH = "path";
public static final String LOGIN = "login";
public static final String PASSWORD = "password";
public static final String DOMAIN = "domain";
public static final String HOOKS = "hooks";
public static final String WORK_DIR = "workDir";
public static final String TYPE = "type";
public static final String BRANCH = "branch";
public static final String ENV = "env";
public static final String CONTEXT = "context";
public static final String AUTOUPDATE = "autoupdate";
public static final String INTERVAL = "interval";
public static final String HASH = "hash";
public static final String AUTORESOLVECONFLICT = "autoResolveConflict";
public static final String TARGET_NODE_GROUP = "targetNodeGroup";
public static final String REPO_HASH = "repoHash";
private int id;
private String name;
private String type;
private String path;
private String login;
private String env;
private String context;
private String branch;
private boolean autoupdate;
private String workDir;
private String interval;
private String hash;
private boolean autoResolveConflict;
private String hooks;
private String targetNodeGroup;
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 getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
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 getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context;
}
public String getBranch() {
return branch;
}
public void setBranch(String branch) {
this.branch = branch;
}
public String getEnv() {
return env;
}
public void setEnv(String env) {
this.env = env;
}
public boolean isAutoupdate() {
return autoupdate;
}
public void setAutoupdate(boolean autoupdate) {
this.autoupdate = autoupdate;
}
public String getWorkDir() {
return workDir;
}
public void setWorkDir(String workDir) {
this.workDir = workDir;
}
public String getInterval() {
return interval;
}
public void setInterval(String interval) {
this.interval = interval;
}
public String getHash() {
return hash;
}
public void setHash(String hash) {
this.hash = hash;
}
public void setAutoResolveConflict(boolean autoResolveConflict) {
this.autoResolveConflict = autoResolveConflict;
}
public boolean getAutoResolveConflict() {
return autoResolveConflict;
}
public String getHooks() {
return hooks;
}
public void setHooks(String hooks) {
this.hooks = hooks;
}
public String getTargetNodeGroup() {
return targetNodeGroup;
}
public void setTargetNodeGroup(String targetNodeGroup) {
this.targetNodeGroup = targetNodeGroup;
}
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(PATH)) {
this.path = json.getString(PATH);
}
if (json.has(LOGIN)) {
this.login = json.getString(LOGIN);
}
if (json.has(ENV)) {
this.env = json.getString(ENV);
}
if (json.has(CONTEXT)) {
this.context = json.getString(CONTEXT);
}
if (json.has(BRANCH)) {
this.branch = json.getString(BRANCH);
}
if (json.has(AUTOUPDATE)) {
this.autoupdate = json.getBoolean(AUTOUPDATE);
}
if (json.has(WORK_DIR)) {
this.workDir = json.getString(WORK_DIR);
}
if (json.has(INTERVAL)) {
this.interval = json.getString(INTERVAL);
}
if (json.has(HASH)) {
this.hash = json.getString(HASH);
}
if (json.has(AUTORESOLVECONFLICT)) {
this.autoResolveConflict = json.getBoolean(AUTORESOLVECONFLICT);
}
if (json.has(HOOKS)) {
this.hooks = json.getString(HOOKS);
}
if (json.has(TARGET_NODE_GROUP)) {
this.targetNodeGroup = json.getString(TARGET_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(PATH, path);
json.put(LOGIN, login);
json.put(ENV, env);
json.put(CONTEXT, context);
json.put(BRANCH, branch);
json.put(AUTOUPDATE, autoupdate);
json.put(INTERVAL, interval);
json.put(HASH, hash);
json.put(AUTORESOLVECONFLICT, autoResolveConflict);
json.put(WORK_DIR, workDir);
json.put(HOOKS, hooks);
json.put(TARGET_NODE_GROUP, targetNodeGroup);
json.put(REPO_HASH, repoHash);
return json;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy