rapture.common.client.HttpUserApi Maven / Gradle / Ivy
/**
* The MIT License (MIT)
*
* Copyright (C) 2011-2016 Incapture Technologies LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**
* This file is autogenerated and any changes will be overwritten.
*/
package rapture.common.client;
import java.util.List;
import java.util.Map;
import rapture.common.api.UserApi;
import rapture.common.api.ScriptUserApi;
import rapture.common.CallingContext;
import rapture.common.model.GeneralResponse;
import rapture.common.model.BasePayload;
import rapture.common.exception.RaptureException;
import rapture.common.impl.jackson.JacksonUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import org.apache.log4j.Logger;
import rapture.common.version.ApiVersion;
import rapture.common.model.RaptureUser;
import rapture.common.shared.user.GetWhoAmIPayload;
import rapture.common.shared.user.LogoutUserPayload;
import rapture.common.shared.user.StorePreferencePayload;
import rapture.common.shared.user.GetPreferencePayload;
import rapture.common.shared.user.RemovePreferencePayload;
import rapture.common.shared.user.GetPreferenceCategoriesPayload;
import rapture.common.shared.user.GetPreferencesInCategoryPayload;
import rapture.common.shared.user.UpdateMyDescriptionPayload;
import rapture.common.shared.user.ChangeMyPasswordPayload;
import rapture.common.shared.user.ChangeMyEmailPayload;
import rapture.common.shared.user.GetServerApiVersionPayload;
import rapture.common.shared.user.IsPermittedPayload;
@SuppressWarnings("all")
public class HttpUserApi extends BaseHttpApi implements UserApi, ScriptUserApi {
private static final Logger log = Logger.getLogger(HttpUserApi.class);
public HttpUserApi(HttpLoginApi login) {
super(login, "user");
}
private static final class GetWhoAmITypeReference extends TypeReference {
}
@Override
public RaptureUser getWhoAmI(CallingContext context) {
GetWhoAmIPayload requestObj = new GetWhoAmIPayload();
requestObj.setContext(context == null ? this.getContext() : context);
return doRequest(requestObj, "GETWHOAMI", new GetWhoAmITypeReference()); }
@Override
public void logoutUser(CallingContext context) {
LogoutUserPayload requestObj = new LogoutUserPayload();
requestObj.setContext(context == null ? this.getContext() : context);
doRequest(requestObj, "LOGOUTUSER", null); }
@Override
public void storePreference(CallingContext context, String category, String name, String content) {
StorePreferencePayload requestObj = new StorePreferencePayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setCategory(category);
requestObj.setName(name);
requestObj.setContent(content);
doRequest(requestObj, "STOREPREFERENCE", null); }
private static final class GetPreferenceTypeReference extends TypeReference {
}
@Override
public String getPreference(CallingContext context, String category, String name) {
GetPreferencePayload requestObj = new GetPreferencePayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setCategory(category);
requestObj.setName(name);
return doRequest(requestObj, "GETPREFERENCE", new GetPreferenceTypeReference()); }
@Override
public void removePreference(CallingContext context, String category, String name) {
RemovePreferencePayload requestObj = new RemovePreferencePayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setCategory(category);
requestObj.setName(name);
doRequest(requestObj, "REMOVEPREFERENCE", null); }
private static final class GetPreferenceCategoriesTypeReference extends TypeReference> {
}
@Override
public List getPreferenceCategories(CallingContext context) {
GetPreferenceCategoriesPayload requestObj = new GetPreferenceCategoriesPayload();
requestObj.setContext(context == null ? this.getContext() : context);
return doRequest(requestObj, "GETPREFERENCECATEGORIES", new GetPreferenceCategoriesTypeReference()); }
private static final class GetPreferencesInCategoryTypeReference extends TypeReference> {
}
@Override
public List getPreferencesInCategory(CallingContext context, String category) {
GetPreferencesInCategoryPayload requestObj = new GetPreferencesInCategoryPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setCategory(category);
return doRequest(requestObj, "GETPREFERENCESINCATEGORY", new GetPreferencesInCategoryTypeReference()); }
private static final class UpdateMyDescriptionTypeReference extends TypeReference {
}
@Override
public RaptureUser updateMyDescription(CallingContext context, String description) {
UpdateMyDescriptionPayload requestObj = new UpdateMyDescriptionPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setDescription(description);
return doRequest(requestObj, "UPDATEMYDESCRIPTION", new UpdateMyDescriptionTypeReference()); }
private static final class ChangeMyPasswordTypeReference extends TypeReference {
}
@Override
public RaptureUser changeMyPassword(CallingContext context, String oldHashPassword, String newHashPassword) {
ChangeMyPasswordPayload requestObj = new ChangeMyPasswordPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setOldHashPassword(oldHashPassword);
requestObj.setNewHashPassword(newHashPassword);
return doRequest(requestObj, "CHANGEMYPASSWORD", new ChangeMyPasswordTypeReference()); }
private static final class ChangeMyEmailTypeReference extends TypeReference {
}
@Override
public RaptureUser changeMyEmail(CallingContext context, String newAddress) {
ChangeMyEmailPayload requestObj = new ChangeMyEmailPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setNewAddress(newAddress);
return doRequest(requestObj, "CHANGEMYEMAIL", new ChangeMyEmailTypeReference()); }
private static final class GetServerApiVersionTypeReference extends TypeReference {
}
@Override
public ApiVersion getServerApiVersion(CallingContext context) {
GetServerApiVersionPayload requestObj = new GetServerApiVersionPayload();
requestObj.setContext(context == null ? this.getContext() : context);
return doRequest(requestObj, "GETSERVERAPIVERSION", new GetServerApiVersionTypeReference()); }
private static final class IsPermittedTypeReference extends TypeReference {
}
@Override
public Boolean isPermitted(CallingContext context, String apiCall, String callParam) {
IsPermittedPayload requestObj = new IsPermittedPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setApiCall(apiCall);
requestObj.setCallParam(callParam);
return doRequest(requestObj, "ISPERMITTED", new IsPermittedTypeReference()); }
@Override
public RaptureUser getWhoAmI() {
return getWhoAmI(null); }
@Override
public void logoutUser() {
logoutUser(null); }
@Override
public void storePreference(String category, String name, String content) {
storePreference(null,category,name,content); }
@Override
public String getPreference(String category, String name) {
return getPreference(null,category,name); }
@Override
public void removePreference(String category, String name) {
removePreference(null,category,name); }
@Override
public List getPreferenceCategories() {
return getPreferenceCategories(null); }
@Override
public List getPreferencesInCategory(String category) {
return getPreferencesInCategory(null,category); }
@Override
public RaptureUser updateMyDescription(String description) {
return updateMyDescription(null,description); }
@Override
public RaptureUser changeMyPassword(String oldHashPassword, String newHashPassword) {
return changeMyPassword(null,oldHashPassword,newHashPassword); }
@Override
public RaptureUser changeMyEmail(String newAddress) {
return changeMyEmail(null,newAddress); }
@Override
public ApiVersion getServerApiVersion() {
return getServerApiVersion(null); }
@Override
public Boolean isPermitted(String apiCall, String callParam) {
return isPermitted(null,apiCall,callParam); }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy