com.jelastic.api.environment.response.RegistryInfoResponse Maven / Gradle / Ivy
The newest version!
/*Server class MD5: fb30c58f8fb42223c45c68ca97e89ea4*/
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 RegistryInfoResponse extends Response {
public static final String REGISTRY_URL = "url";
public static final String REGISTRY_USER = "user";
public static final String REGISTRY_REPO = "repo";
private String url;
private String user;
private String repo;
public RegistryInfoResponse() {
super(OK);
}
public RegistryInfoResponse(String url, String user, String repo) {
super(OK);
this.url = url;
this.user = user;
this.repo = repo;
}
public RegistryInfoResponse(int result, String error) {
super(result, error);
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getRepo() {
return repo;
}
public void setRepo(String repo) {
this.repo = repo;
}
@Override
public RegistryInfoResponse _fromJSON(JSONObject json) throws JSONException {
super._fromJSON(json);
if (json.has(REGISTRY_URL)) {
this.url = json.getString(REGISTRY_URL);
}
if (json.has(REGISTRY_USER)) {
this.user = json.getString(REGISTRY_USER);
}
if (json.has(REGISTRY_REPO)) {
this.repo = json.getString(REGISTRY_REPO);
}
return this;
}
@Override
public JSONObject _toJSON() throws JSONException {
JSONObject json = super._toJSON();
json.put(REGISTRY_USER, user);
json.put(REGISTRY_URL, url);
json.put(REGISTRY_REPO, repo);
return json;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy