当前位置: 首页>>代码示例>>Java>>正文


Java ApiException类代码示例

本文整理汇总了Java中io.swagger.client.ApiException的典型用法代码示例。如果您正苦于以下问题:Java ApiException类的具体用法?Java ApiException怎么用?Java ApiException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ApiException类属于io.swagger.client包,在下文中一共展示了ApiException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doInBackground

import io.swagger.client.ApiException; //导入依赖的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

示例2: getUserAsync

import io.swagger.client.ApiException; //导入依赖的package包/类
@Override
public void getUserAsync(String uid, @Nullable OnAsyncCallListener<User> listener) {
    if(listener != null) {
        switch (testCase) {
            case SUCCESS: {
                User result = new User();
                result.setUid(uid);
                result.setDisplayName(DEFAULT_DISPLAY_NAME);
                result.setEmail(DEFAULT_EMAIL);
                listener.onSuccess(result);
            }
            break;
            case FAILURE: {
                listener.onFailure(new ApiException(0, "Failure"));
            }
            break;
        }
    }
}
 
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:20,代码来源:TestServerCalls.java

示例3: getUserImageAsync

import io.swagger.client.ApiException; //导入依赖的package包/类
@Override
public void getUserImageAsync(String uid, @Nullable OnAsyncCallListener<byte[]> listener) {
    if(listener != null) {
        switch (testCase) {
            case SUCCESS: {
                byte[] bytes = new byte[5000];
                new Random().nextBytes(bytes);

                listener.onSuccess(bytes);
            }
            break;
            case FAILURE: {
                listener.onFailure(new ApiException(0, "Failure"));
            }
            break;
        }
    }
}
 
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:19,代码来源:TestServerCalls.java

示例4: getGroupAsync

import io.swagger.client.ApiException; //导入依赖的package包/类
@Override
public void getGroupAsync(UUID groupUid, @Nullable OnAsyncCallListener<Group> listener) {
    if(listener != null) {
        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);


                listener.onSuccess(group);
            }
            break;
            case FAILURE: {
                listener.onFailure(new ApiException(0, "Failure"));
            }
            break;
        }
    }
}
 
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:23,代码来源:TestServerCalls.java

示例5: joinGroupAsync

import io.swagger.client.ApiException; //导入依赖的package包/类
@Override
public void joinGroupAsync(String accessKey, @Nullable OnAsyncCallListener<Group> listener) {
    if(listener != null) {
        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);


                listener.onSuccess(group);
            }
            break;
            case FAILURE: {
                listener.onFailure(new ApiException(0, "Failure"));
            }
            break;
        }
    }
}
 
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:23,代码来源:TestServerCalls.java

示例6: createGroupKeyAsync

import io.swagger.client.ApiException; //导入依赖的package包/类
@Override
public void createGroupKeyAsync(@Nullable OnAsyncCallListener<GroupCode> listener) {
    if(listener != null) {
        switch (testCase) {
            case SUCCESS: {
                GroupCode code = new GroupCode();
                code.setCode("MYSUPERDUPER");
                listener.onSuccess(code);
            }
            break;
            case FAILURE: {
                listener.onFailure(new ApiException(0, "Failure"));
            }
            break;
        }
    }
}
 
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:18,代码来源:TestServerCalls.java

示例7: getGroupImageAsync

import io.swagger.client.ApiException; //导入依赖的package包/类
@Override
public void getGroupImageAsync(@Nullable OnAsyncCallListener<byte[]> listener) {
    if(listener != null) {
        switch (testCase) {
            case SUCCESS: {
                byte[] bytes = new byte[5000];
                new Random().nextBytes(bytes);

                listener.onSuccess(bytes);
            }
            break;
            case FAILURE: {
                listener.onFailure(new ApiException(0, "Failure"));
            }
            break;
        }
    }
}
 
开发者ID:WGPlaner,项目名称:wg_planer,代码行数:19,代码来源:TestServerCalls.java

示例8: updateDocument

import io.swagger.client.ApiException; //导入依赖的package包/类
/**
 * Updates a document.
 * 
 * @param folder
 * @param database
 * @param unid
 */
public Document updateDocument(String folder, String database, String unid, Document document, String form) {
    
    try {
        System.out.println("Updating document " + unid + "...");
        _api.folderDatabaseApiDataDocumentsUnidDocUnidPut(folder, database, unid,
                            document, form, false, null);
        
        System.out.println("Update document request succeeded\n");
    }
    catch (ApiException e) {
        System.err.println("Exception when calling DocumentApi#folderDatabaseApiDataDocumentsUnidDocUnidPut");
        String body = e.getResponseBody();
        if (body != null) {
            System.err.println("Response from server ...");
            System.err.println(body);
        }
        else {
            e.printStackTrace();
        }
    }
    
    return document;
}
 
开发者ID:OpenNTF,项目名称:das-api-specs,代码行数:31,代码来源:DocumentTest.java

示例9: deleteDocument

import io.swagger.client.ApiException; //导入依赖的package包/类
/**
 * Deletes a document.
 * 
 * @param folder
 * @param database
 * @param unid
 */
public void deleteDocument(String folder, String database, String unid) {
    try {
        System.out.println("Deleting document " + unid + "...");
        _api.folderDatabaseApiDataDocumentsUnidDocUnidDelete(folder, database, unid, null);
        
    }
    catch (ApiException e) {
        System.err.println("Exception when calling DocumentApi#folderDatabaseApiDataDocumentsUnidDocUnidDelete");
        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,代码行数:26,代码来源:DocumentTest.java

示例10: deleteRecurringEvent

import io.swagger.client.ApiException; //导入依赖的package包/类
/**
 * Deletes a recurring event.
 * 
 * @param folder
 * @param database
 * @param uid
 */
private void deleteRecurringEvent(String folder, String database, String uid) {
    try {

        // Delete the event
        System.out.println("Deleting event " + uid + " from " + folder + "/" + database + " ...");
        _eventApi.folderDatabaseApiCalendarEventsUidDelete(folder, database, uid, true);

    }
    catch (ApiException e) {
        System.err.println("Exception when calling EventApi#folderDatabaseApiCalendarEventsUidDelete");
        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,代码来源:RecurringEventTest.java

示例11: deleteEventInstance

import io.swagger.client.ApiException; //导入依赖的package包/类
/**
 * Deletes a single event instance.
 * 
 * @param folder
 * @param database
 * @param uid
 * @param recurrenceId
 */
private void deleteEventInstance(String folder, String database, String uid, String recurrenceId) {
    try {

        // Delete the event
        System.out.println("Deleting instance " + recurrenceId + " from event " + uid + " from " + 
                                folder + "/" + database + " ...");
        _eventInstanceApi.folderDatabaseApiCalendarEventsUidRecurrenceIdDelete(folder, database, uid, 
                                recurrenceId, null, true);
        System.out.println();
    }
    catch (ApiException e) {
        System.err.println("Exception when calling EventInstanceApi#folderDatabaseApiCalendarEventsUidRecurrenceIdDelete");
        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,代码行数:31,代码来源:RecurringEventTest.java

示例12: deleteMeeting

import io.swagger.client.ApiException; //导入依赖的package包/类
/**
 * Deletes a meeting from the user's calendar.
 * 
 * @param folder
 * @param database
 * @param uid
 */
private void deleteMeeting(String folder, String database, String uid) {
    try {

        // Delete the event
        System.out.println("Deleting event " + uid + " from " + folder + "/" + database + " ...");
        _eventApi.folderDatabaseApiCalendarEventsUidDelete(folder, database, uid, true);

    }
    catch (ApiException e) {
        System.err.println("Exception when calling EventApi#folderDatabaseApiCalendarEventsUidDelete");
        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,代码来源:MeetingTest.java

示例13: deleteEvent

import io.swagger.client.ApiException; //导入依赖的package包/类
/**
 * Deletes an event from the user's calendar.
 * 
 * @param folder
 * @param database
 * @param uid
 */
private void deleteEvent(String folder, String database, String uid) {
    try {

        // Delete the event
        System.out.println("Deleting event " + uid + " from " + folder + "/" + database + " ...");
        _eventApi.folderDatabaseApiCalendarEventsUidDelete(folder, database, uid, true);

    }
    catch (ApiException e) {
        System.err.println("Exception when calling EventApi#folderDatabaseApiCalendarEventsUidDelete");
        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,代码来源:EventTest.java

示例14: deleteFolder

import io.swagger.client.ApiException; //导入依赖的package包/类
/**
 * Deletes a mail folder.
 * 
 * @param folder
 * @param database
 * @param unid
 */
private void deleteFolder(String folder, String database, String unid) {
    
    try {

        // Delete the folder
        System.out.println("Deleting folder " + unid + " from " + folder + "/" + database + " ...");
        _folderApi.folderDatabaseApiMailFoldersUnidDelete(folder, database, unid);
        
    }
    catch (ApiException e) {
        System.err.println("Exception when calling FolderApi#folderDatabaseApiMailFoldersUnidDelete");
        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,代码行数:29,代码来源:MailFolderTest.java

示例15: deleteDelegate

import io.swagger.client.ApiException; //导入依赖的package包/类
/**
 * Deletes a delegate.
 * 
 * @param folder
 * @param database
 */
private void deleteDelegate(String folder, String database, String name) {
    
    try {

        // Delete the delegate
        System.out.println("Deleting delegate " + name + " from " + folder + "/" + database + " ...");
        _api.folderDatabaseApiMailDelegatesNameDelete(folder, database, name); 

    }
    catch (ApiException e) {
        System.err.println("Exception when calling DelegateApi#folderDatabaseApiMailDelegatesNameDelete");
        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,代码来源:DelegateTest.java


注:本文中的io.swagger.client.ApiException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。