com.jelastic.api.management.Account Maven / Gradle / Ivy
The newest version!
package com.jelastic.api.management;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import com.jelastic.api.AbstractService;
import com.jelastic.api.Callback;
import com.jelastic.api.client.annotation.JelasticModuleName;
import com.jelastic.api.core.utils.Transport;
import com.jelastic.api.users.response.SSHKeyResponse;
/**
* @name Jelastic API Client
* @version 8.11.2
* @copyright Jelastic, Inc.
**/
@JelasticModuleName(name="jelastic")
public class Account extends AbstractService {
public static String SERVICE_PATH = "management/account/";
private String serviceUrl = SERVER_URL + SERVICE_PATH;
private String appid = null;
private String session = null;
private String client_source = null;
public Account(){}
public Account(Map _params){
this((String)_params.get("appid"), (String)_params.get("session"), (String)_params.get("serviceUrl"));
String serverUrl = (String) _params.get("serverUrl");
if (serverUrl != null) setServerUrl(serverUrl);
}
public Account(String appid, String session, String serviceUrl){
if (appid != null) this.appid = appid;
if (session != null) this.session = session;
if (serviceUrl != null) this.serviceUrl = serviceUrl;
}
public Account(String appid, String session){
this(appid, session, null);
}
public Account(String appid){
this(appid, null, null);
}
public String getAppid(){
return appid;
}
public Account setAppid(String appid){
this.appid = appid;
return this;
}
public String getSession(){
return session;
}
public Account setSession(String session){
this.session = session;
return this;
}
public String getServiceUrl(){
return serviceUrl;
}
public Account setServiceUrl(String serviceUrl){
this.serviceUrl = serviceUrl;
return this;
}
public String getServerUrl(){
return serviceUrl;
}
public Account setServerUrl(String serverUrl){
this.serviceUrl = serverUrl + SERVICE_PATH;
return this;
}
public Account setClientSource(String client_source){
this.client_source = client_source;
return this;
}
public String getClientSource(){
return client_source ;
}
public SSHKeyResponse getSSHKeys(String appid, String session, boolean isPrivate){
Map _params = new HashMap();
_params.put("appid", appid);
_params.put("session", session);
_params.put("isPrivate", isPrivate + "");
_params.put("client_source", client_source);
return (SSHKeyResponse) _call(appid, serviceUrl + "rest/getsshkeys", _params, SSHKeyResponse.class);
}
public SSHKeyResponse getSSHKeys(String appid, String session, boolean isPrivate, Map headers){
Map _params = new HashMap();
_params.put("appid", appid);
_params.put("session", session);
_params.put("isPrivate", isPrivate + "");
_params.put("client_source", client_source);
return (SSHKeyResponse) _call(appid, serviceUrl + "rest/getsshkeys", _params, headers, SSHKeyResponse.class);
}
public Account getSSHKeys(final String appid, final String session, final boolean isPrivate, final Callback callback){
new Thread(() -> {
SSHKeyResponse response = getSSHKeys(appid, session, isPrivate);
callback.fire(response);
}, "callback").start();
return this;
}
public Account getSSHKeys(final String appid, final String session, final boolean isPrivate, final Map headers, final Callback callback){
new Thread(() -> {
SSHKeyResponse response = getSSHKeys(appid, session, isPrivate);
callback.fire(response);
}, "callback").start();
return this;
}
public SSHKeyResponse getSSHKeys(String session, boolean isPrivate){
Map _params = new HashMap();
_params.put("appid", appid);
_params.put("session", session);
_params.put("isPrivate", isPrivate + "");
_params.put("client_source", client_source);
return (SSHKeyResponse) _call(appid, serviceUrl + "rest/getsshkeys", _params, SSHKeyResponse.class);
}
public SSHKeyResponse getSSHKeys(String session, boolean isPrivate, Map headers){
Map _params = new HashMap();
_params.put("appid", appid);
_params.put("session", session);
_params.put("isPrivate", isPrivate + "");
_params.put("client_source", client_source);
return (SSHKeyResponse) _call(appid, serviceUrl + "rest/getsshkeys", _params, headers, SSHKeyResponse.class);
}
public Account getSSHKeys(final String session, final boolean isPrivate, final Callback callback){
new Thread(() -> {
SSHKeyResponse response = getSSHKeys(session, isPrivate);
callback.fire(response);
}, "callback").start();
return this;
}
public Account getSSHKeys(final String session, final boolean isPrivate, final Map headers, final Callback callback){
new Thread(() -> {
SSHKeyResponse response = getSSHKeys(session, isPrivate);
callback.fire(response);
}, "callback").start();
return this;
}
public SSHKeyResponse getSSHKeys(boolean isPrivate){
Map _params = new HashMap();
_params.put("appid", appid);
_params.put("session", session);
_params.put("isPrivate", isPrivate + "");
_params.put("client_source", client_source);
return (SSHKeyResponse) _call(appid, serviceUrl + "rest/getsshkeys", _params, SSHKeyResponse.class);
}
public SSHKeyResponse getSSHKeys(boolean isPrivate, Map headers){
Map _params = new HashMap();
_params.put("appid", appid);
_params.put("session", session);
_params.put("isPrivate", isPrivate + "");
_params.put("client_source", client_source);
return (SSHKeyResponse) _call(appid, serviceUrl + "rest/getsshkeys", _params, headers, SSHKeyResponse.class);
}
public Account getSSHKeys(final boolean isPrivate, final Callback callback){
new Thread(() -> {
SSHKeyResponse response = getSSHKeys(isPrivate);
callback.fire(response);
}, "callback").start();
return this;
}
public Account getSSHKeys(final boolean isPrivate, final Map headers, final Callback callback){
new Thread(() -> {
SSHKeyResponse response = getSSHKeys(isPrivate);
callback.fire(response);
}, "callback").start();
return this;
}
public SSHKeyResponse getSSHKeys(Map _params){
if (!_params.containsKey("appid")) _params.put("appid", appid);
if (!_params.containsKey("session")) _params.put("session", session);
if (!_params.containsKey("client_source")) _params.put("client_source", client_source);
return (SSHKeyResponse) _call(appid, serviceUrl + "rest/getsshkeys", _params, SSHKeyResponse.class);
}
public SSHKeyResponse getSSHKeys(Map _params, Map headers){
if (!_params.containsKey("appid")) _params.put("appid", appid);
if (!_params.containsKey("session")) _params.put("session", session);
if (!_params.containsKey("client_source")) _params.put("client_source", client_source);
return (SSHKeyResponse) _call(appid, serviceUrl + "rest/getsshkeys", _params, headers, SSHKeyResponse.class);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy