本文整理汇总了Java中io.swagger.client.ApiResponse类的典型用法代码示例。如果您正苦于以下问题:Java ApiResponse类的具体用法?Java ApiResponse怎么用?Java ApiResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApiResponse类属于io.swagger.client包,在下文中一共展示了ApiResponse类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: leaveCurrentGroup
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public boolean leaveCurrentGroup() {
ApiResponse<SuccessResponse> groupResponse = leaveGroup();
if (groupResponse != null && groupResponse.getData() != null) {
currentGroupUID = null;
currentGroupName = null;
currentGroupCurrency = null;
currentGroupMembers = null;
currentGroupAdminsUids = null;
currentGroupMembersUids = null;
currentShoppingList = new ArrayList<>();
selectedItems = new ArrayList<>();
callAllListeners(DataType.CURRENT_GROUP);
callAllListeners(DataType.SHOPPING_LIST);
callAllListeners(DataType.SELECTED_ITEMS);
return true;
}
return false;
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:24,代码来源:DataProvider.java
示例2: createGroupAccessKey
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public String createGroupAccessKey() {
if (currentGroupAccessKey == null) {
ApiResponse<GroupCode> codeResponse = serverCallsInstance.createGroupKey();
if (codeResponse != null && codeResponse.getData() != null) {
return codeResponse.getData().getCode();
} else {
return null;
}
} else {
return currentGroupAccessKey;
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:17,代码来源:DataProvider.java
示例3: addShoppingListItem
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public boolean addShoppingListItem(ListItem item) {
if (item != null && currentShoppingList != null) {
for (ListItem currentItem : currentShoppingList) {
if (currentItem.getTitle().equals(item.getTitle()) &&
currentItem.getRequestedFor().equals(item.getRequestedFor())) {
currentItem.setCount(currentItem.getCount() + item.getCount());
ApiResponse<ListItem> itemResponse = updateListItem(currentItem);
return itemResponse != null && itemResponse.getData() != null;
}
}
ApiResponse<ListItem> itemRepsonse = addListItem(item);
if (itemRepsonse != null && itemRepsonse.getData() != null) {
return true;
}
}
return false;
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:24,代码来源:DataProvider.java
示例4: syncGroup
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public void syncGroup() {
ApiResponse<Group> groupResponse = getGroup();
if (groupResponse != null && groupResponse.getData() != null) {
Group group = groupResponse.getData();
currentGroupUID = group.getUid();
currentGroupName = group.getDisplayName();
currentGroupCurrency = Currency.getInstance(group.getCurrency());
currentGroupMembersUids = group.getMembers();
currentGroupAdminsUids = group.getAdmins();
callAllListeners(DataType.CURRENT_GROUP);
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:17,代码来源:DataProvider.java
示例5: syncGroupNewMember
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public void syncGroupNewMember(String uid, Context context) {
if (!currentGroupMembersUids.contains(uid)) {
currentGroupMembersUids.add(uid);
ApiResponse<User> userResponse = serverCallsInstance.getUser(uid);
if (userResponse != null && userResponse.getData() != null) {
currentGroupMembers.add(userResponse.getData());
ApiResponse<byte[]> imageResponse = serverCallsInstance.getUserImage(uid);
if (imageResponse != null && imageResponse.getData() != null) {
imageStoreInstance.writeGroupMemberPicture(uid, imageResponse.getData(), context);
}
callAllListeners(DataType.CURRENT_GROUP_MEMBERS);
syncShoppingList();
} else {
currentGroupMembersUids.remove(uid);
}
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:25,代码来源:DataProvider.java
示例6: doInBackground
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
protected ApiResponse<User> doInBackground(User... users) {
if (users != null && users.length > 0) {
try {
setAuth(USER_ID_AUTH_LABEL);
UserApi api = new UserApi();
return api.createUserWithHttpInfo(users[0]);
} catch (ApiException e) {
logError(CREATE_USER_NAME, WAIT_FOR_RESULT_FLAG);
return new ApiResponse<>(e.getCode(), e.getResponseHeaders(), null);
}
}
return null;
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:18,代码来源:ServerCalls.java
示例7: getUser
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public ApiResponse<User> getUser(String uid) {
switch (testCase) {
case SUCCESS: {
User result = new User();
result.setUid(uid);
result.setDisplayName(DEFAULT_DISPLAY_NAME);
result.setEmail(DEFAULT_EMAIL);
return new ApiResponse<User>(200, null, result);
}
case FAILURE: {
return new ApiResponse<User>(0, null, null);
}
default: {
return null;
}
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:19,代码来源:TestServerCalls.java
示例8: getUserImage
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public ApiResponse<byte[]> getUserImage(String uid) {
switch(testCase) {
case SUCCESS: {
byte[] bytes = new byte[5000];
new Random().nextBytes(bytes);
return new ApiResponse<byte[]>(200, null, bytes);
}
case FAILURE: {
return new ApiResponse<byte[]>(0, null, null);
}
default: {
return null;
}
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:18,代码来源:TestServerCalls.java
示例9: getGroup
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public ApiResponse<Group> getGroup(UUID groupUid) {
switch(testCase) {
case SUCCESS: {
Group group = new Group();
group.setCurrency(DEFAULT_CURRENCY);
group.setDisplayName(DEFAULT_GROUP_NAME);
group.setMembers(DEFAULT_GROUP_MEMBERS);
group.setAdmins(DEFAULT_GROUP_ADMINS);
return new ApiResponse<>(200, null, group);
}
case FAILURE: {
return new ApiResponse<>(0, null, null);
}
default: {
return null;
}
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:21,代码来源:TestServerCalls.java
示例10: joinGroup
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public ApiResponse<Group> joinGroup(String accessKey) {
switch(testCase) {
case SUCCESS: {
Group group = new Group();
group.setUid(new UUID(11111111111111L, 000000000001L));
group.setCurrency(DEFAULT_CURRENCY);
group.setDisplayName(DEFAULT_GROUP_NAME);
group.setMembers(DEFAULT_GROUP_MEMBERS);
group.setAdmins(DEFAULT_GROUP_ADMINS);
return new ApiResponse<>(200, null, group);
}
case FAILURE: {
return new ApiResponse<>(0, null, null);
}
default: {
return null;
}
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:22,代码来源:TestServerCalls.java
示例11: createGroupKey
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public ApiResponse<GroupCode> createGroupKey() {
switch(testCase) {
case SUCCESS: {
GroupCode code = new GroupCode();
code.setCode("MYSUPERDUPER");
return new ApiResponse<>(200, null, (GroupCode) code);
}
case FAILURE: {
return new ApiResponse<>(0, null, null);
}
default: {
return null;
}
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:18,代码来源:TestServerCalls.java
示例12: getGroupImage
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public ApiResponse<byte[]> getGroupImage() {
switch(testCase) {
case SUCCESS: {
byte[] bytes = new byte[5000];
new Random().nextBytes(bytes);
return new ApiResponse<byte[]>(200, null, bytes);
}
case FAILURE: {
return new ApiResponse<byte[]>(0, null, null);
}
default: {
return null;
}
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:18,代码来源:TestServerCalls.java
示例13: getShoppingList
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public ApiResponse<ShoppingList> getShoppingList() {
switch(testCase) {
case SUCCESS: {
ShoppingList shoppingList = new ShoppingList();
shoppingList.setListItems(DEFAULT_LIST_ITEMS);
return new ApiResponse<>(200, null, shoppingList);
}
case FAILURE: {
return new ApiResponse<>(0, null, null);
}
default: {
return null;
}
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:17,代码来源:TestServerCalls.java
示例14: updateDraftMessage
import io.swagger.client.ApiResponse; //导入依赖的package包/类
/**
* Updates a message.
*
* @param folder
* @param database
*/
private void updateDraftMessage(String folder, String database, String unid, Message message) {
try {
// Update the message
System.out.println("Updating draft message " + unid + " ...");
ApiResponse<Void> result = _draftApi.folderDatabaseApiMailMessagesUnidPutWithHttpInfo(folder, database, unid, message, null);
System.out.println("Update request succeeded.\n");
}
catch (ApiException e) {
System.err.println("Exception when calling DraftMessageApi#folderDatabaseApiMailDraftsPostWithHttpInfo");
String body = e.getResponseBody();
if (body != null) {
System.err.println("Response from server ...");
System.err.println(body);
}
else {
e.printStackTrace();
}
}
}
开发者ID:OpenNTF,项目名称:das-api-specs,代码行数:28,代码来源:DraftMessageTest.java
示例15: registerUser
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public boolean registerUser() {
if (currentUserDisplayName != null && !currentUserDisplayName.isEmpty()) {
User user = new User();
user.setUid(currentUserUid);
user.setDisplayName(currentUserDisplayName);
user.setEmail(currentUserEmail);
user.setFirebaseInstanceID(currentUserFirebaseInstanceId);
ApiResponse<User> userResponse = serverCallsInstance.createUser(user);
if (userResponse != null && userResponse.getData() != null) {
user = userResponse.getData();
currentUserUid = user.getUid();
currentUserDisplayName = user.getDisplayName();
currentUserEmail = user.getEmail();
if (currentUserFirebaseInstanceId.isEmpty()) {
currentUserFirebaseInstanceId = getFirebaseInstanceId();
if (!(currentUserFirebaseInstanceId != null && !currentUserFirebaseInstanceId.isEmpty())) {
currentUserFirebaseInstanceId = Configuration.singleton.getConfig(
Configuration.Type.FIREBASE_INSTANCE_ID);
updateUser();
}
}
if (imageStoreInstance.getProfilePictureFile() != null) {
serverCallsInstance.updateUserImage(imageStoreInstance.getProfilePictureFile());
}
return true;
}
}
return false;
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:39,代码来源:DataProvider.java
示例16: updateUserImage
import io.swagger.client.ApiResponse; //导入依赖的package包/类
private void updateUserImage() {
File file = imageStoreInstance.getProfilePictureFile();
if (file != null) {
ApiResponse<SuccessResponse> imageResponse = serverCallsInstance.updateUserImage(file);
if (imageResponse != null && imageResponse.getData() != null) {
callAllListeners(DataType.CURRENT_USER);
}
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:12,代码来源:DataProvider.java
示例17: setCurrentGroupName
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public void setCurrentGroupName(String groupName) {
if (groupName != null && !groupName.isEmpty()) {
this.currentGroupName = groupName;
ApiResponse<Group> groupResponse = updateGroup();
if (groupResponse != null && groupResponse.getData() != null) {
callAllListeners(DataType.CURRENT_GROUP);
}
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:13,代码来源:DataProvider.java
示例18: setCurrentGroupCurrency
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public void setCurrentGroupCurrency(Currency currency) {
if (currency != null) {
this.currentGroupCurrency = currency;
ApiResponse<Group> groupResponse = updateGroup();
if (groupResponse != null && groupResponse.getData() != null) {
callAllListeners(DataType.CURRENT_GROUP);
}
}
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:13,代码来源:DataProvider.java
示例19: createGroup
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public boolean createGroup(String name, Currency currency, Bitmap imagecr, Context context) {
Group group = new Group();
group.setDisplayName(name);
group.setCurrency(currency.getCurrencyCode());
imageStoreInstance.setGroupPicture(imagecr);
ApiResponse<Group> groupResponse = createGroup(group);
if (groupResponse != null && groupResponse.getData() != null) {
group = groupResponse.getData();
currentGroupUID = group.getUid();
currentGroupName = group.getDisplayName();
currentGroupCurrency = Currency.getInstance(group.getCurrency());
currentGroupMembersUids = group.getMembers();
currentGroupAdminsUids = group.getAdmins();
imageStoreInstance.setGroupPicture(imagecr);
serverCallsInstance.updateGroupImageAsync(imageStoreInstance.getGroupPictureFile(), null);
ApiResponse<SuccessResponse> imageResponse = serverCallsInstance.updateGroupImage(imageStoreInstance.getGroupPictureFile());
initializeMembers(context);
callAllListeners(DataType.CURRENT_GROUP);
syncShoppingList();
return true;
}
return false;
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:31,代码来源:DataProvider.java
示例20: joinCurrentGroup
import io.swagger.client.ApiResponse; //导入依赖的package包/类
@Override
public boolean joinCurrentGroup(String accessKey, final Context context) {
ApiResponse<Group> groupResponse = joinGroup(accessKey);
if (groupResponse != null && groupResponse.getData() != null) {
Group group = groupResponse.getData();
currentGroupUID = group.getUid();
currentGroupName = group.getDisplayName();
currentGroupCurrency = Currency.getInstance(group.getCurrency());
currentGroupMembersUids = group.getMembers();
currentGroupAdminsUids = group.getAdmins();
initializeMembers(context);
serverCallsInstance.getGroupImageAsync(new ServerCallsInterface.OnAsyncCallListener<byte[]>() {
@Override
public void onFailure(ApiException e) {
Log.e("GroupImage", ":GetFailure");
}
@Override
public void onSuccess(byte[] result) {
ImageStore.getInstance().setGroupPicture(BitmapFactory.decodeByteArray(result, 0, result.length));
}
});
callAllListeners(DataType.CURRENT_GROUP);
syncShoppingList();
return true;
}
return false;
}
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:33,代码来源:DataProvider.java
注:本文中的io.swagger.client.ApiResponse类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论