Package com.box.boxjavalibv2.requests.requestobjects

Examples of com.box.boxjavalibv2.requests.requestobjects.BoxCommentRequestObject


    }

    @Override
    public BoxComment addComment(String commentedItemId, IBoxType commentedItemType, String message) throws BoxRestException, BoxServerException,
        AuthFatalFailureException {
        BoxCommentRequestObject obj = BoxCommentRequestObject.addCommentRequestObject(commentedItemType, commentedItemId, message);
        return addComment(obj);
    }
View Full Code Here


    public void testRequestIsWellFormed() throws BoxRestException, IllegalStateException, IOException, AuthFatalFailureException, BoxJSONException,
        NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        String id = "testid123";
        String message = "testmessage456";

        BoxCommentRequestObject obj = BoxCommentRequestObject.updateCommentRequestObject(message);

        UpdateCommentRequest request = new UpdateCommentRequest(CONFIG, JSON_PARSER, id, obj);
        testRequestIsWellFormed(request, TestUtils.getConfig().getApiUrlAuthority(),
            TestUtils.getConfig().getApiUrlPath().concat(UpdateCommentRequest.getUri(id)), HttpStatus.SC_OK, RestMethod.PUT);
View Full Code Here

    public void testAddEmailAlias() throws Exception {
        final Map<String, Object> headers = new HashMap<String, Object>();
        // parameter type is String
        headers.put("CamelBox.userId", testUserId);
        // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxEmailAliasRequestObject
        final BoxEmailAliasRequestObject requestObject =
                BoxEmailAliasRequestObject.addEmailAliasRequestObject(CAMEL_EMAIL_ALIAS);
        headers.put("CamelBox.emailAliasRequest", requestObject);

        BoxEmailAlias result = requestBodyAndHeaders("direct://ADDEMAILALIAS", null, headers);
View Full Code Here

    }

    @Test
    public void testGetEvents() throws Exception {
        // using com.box.boxjavalibv2.requests.requestobjects.BoxEventRequestObject message body for single parameter "eventRequest"
        final BoxEventRequestObject requestObject =
                BoxEventRequestObject.getEventsRequestObject(BoxEventRequestObject.STREAM_POSITION_NOW);
        BoxEventCollection result = requestBody("direct://GETEVENTS", requestObject);

        assertNotNull("getEvents result", result);
        LOG.debug("getEvents: " + result);
View Full Code Here

                                final String message = rtsResponse.get(MESSAGE);
                                if (NEW_CHANGE.equals(message)) {

                                    // get events
                                    final BoxEventRequestObject requestObject =
                                        BoxEventRequestObject.getEventsRequestObject(currentStreamPosition);
                                    requestObject.setStreamType(streamType);
                                    requestObject.setLimit(limit);
                                    final BoxEventCollection events = eventsManager.getEvents(requestObject);

                                    // notify callback
                                    callback.onEvent(events);
View Full Code Here

    }

    private long getCurrentStreamPosition(IBoxEventsManager eventsManager, long streamPosition)
        throws BoxRestException, BoxServerException, AuthFatalFailureException {

        final BoxEventRequestObject requestObject =
            BoxEventRequestObject.getEventsRequestObject(streamPosition);
        final BoxEventCollection events = eventsManager.getEvents(requestObject);
        streamPosition = events.getNextStreamPosition();
        return streamPosition;
    }
View Full Code Here

    }

    private BoxRealTimeServer getBoxRealTimeServer(long currentStreamPosition, IBoxEventsManager eventsManager)
        throws BoxRestException, BoxServerException, AuthFatalFailureException {

        final BoxEventRequestObject optionsRequest =
            BoxEventRequestObject.getEventsRequestObject(currentStreamPosition);

        final BoxCollection eventOptions = eventsManager.getEventOptions(optionsRequest);
        final ArrayList<BoxTypedObject> entries = eventOptions.getEntries();
View Full Code Here

        }
    }

    private BoxFolder createFolder() {
        // using com.box.boxjavalibv2.requests.requestobjects.BoxFolderRequestObject message body for single parameter "folderRequest"
        final BoxFolderRequestObject camelTestFolder = BoxFolderRequestObject.createFolderRequestObject(CAMEL_TEST_FOLDER, "0");

        BoxFolder result = requestBody("direct://CREATEFOLDER", camelTestFolder);
        assertNotNull("createFolder result", result);
        assertNotNull("createFolder folder id", result.getId());
        return result;
View Full Code Here

            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.folderId", testFolder.getId());
            // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxFolderRequestObject
            final BoxFolderRequestObject folderRequestObject = BoxFolderRequestObject.getRequestObject();
            folderRequestObject.setTags(new String[]{CAMEL_TEST_TAG});
            folderRequestObject.setName(CAMEL_TEST_COPY_FOLDER);
            headers.put("CamelBox.folderRequest", folderRequestObject);

            BoxFolder result = requestBodyAndHeaders("direct://UPDATEFOLDERINFO", null, headers);
            assertNotNull("updateFolderInfo result", result);
            assertEquals("updateFolderInfo folder name", CAMEL_TEST_COPY_FOLDER, result.getName());
View Full Code Here

    }

    @Test
    public void testGetAllCollaborations() throws Exception {
        // using com.box.boxjavalibv2.requests.requestobjects.BoxGetAllCollabsRequestObject message body for single parameter "getAllCollabsRequest"
        final BoxGetAllCollabsRequestObject collabRequest =
                BoxGetAllCollabsRequestObject.getAllCollaborationsRequestObject(BoxCollaboration.STATUS_PENDING);

        List result = requestBody("direct://GETALLCOLLABORATIONS", collabRequest);
        assertNotNull("getAllCollaborations: " + result);
        LOG.debug("getAllCollaborations: " + result);
View Full Code Here

TOP

Related Classes of com.box.boxjavalibv2.requests.requestobjects.BoxCommentRequestObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.