Package com.box.boxjavalibv2.requests.requestobjects

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


    }

    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

    private static final String CAMEL_TEST_GROUP = "CamelTestGroup";

    public BoxGroup createGroup() throws Exception {
        // using com.box.boxjavalibv2.requests.requestobjects.BoxGroupRequestObject message body for single parameter "groupRequest"
        final BoxGroupRequestObject requestObject = BoxGroupRequestObject.createGroupRequestObject(CAMEL_TEST_GROUP);
        BoxGroup result = requestBody("direct://CREATEGROUP", requestObject);

        assertNotNull("createGroup result", result);
        return result;
    }
View Full Code Here

        try {
            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.groupId", group.getId());
            // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxGroupRequestObject
            final BoxGroupRequestObject requestObject =
                    BoxGroupRequestObject.updateGroupRequestObject(CAMEL_TEST_GROUP + "_Updated");
            headers.put("CamelBox.groupRequest", requestObject);

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

public class BoxGroupsRequestObjectTest {

    @Test
    public void testCreateGroupRequestObject() {
        String name = "testname";
        BoxGroupRequestObject obj = BoxGroupRequestObject.createGroupRequestObject(name);
        Assert.assertEquals(name, obj.getFromEntity(BoxGroup.FIELD_NAME));
    }
View Full Code Here

    }

    @Test
    public void testUpdateGroupRequestObject() {
        String name = "testname";
        BoxGroupRequestObject obj = BoxGroupRequestObject.updateGroupRequestObject(name);
        Assert.assertEquals(name, obj.getFromEntity(BoxGroup.FIELD_NAME));
    }
View Full Code Here

        return (BoxGroup) getResponseAndParseAndTryCast(request, BoxResourceType.GROUP, getJSONParser());
    }

    @Override
    public BoxGroup createGroup(String name) throws BoxRestException, AuthFatalFailureException, BoxServerException {
        BoxGroupRequestObject requestObj = BoxGroupRequestObject.createGroupRequestObject(name);
        return createGroup(requestObj);
    }
View Full Code Here

TOP

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

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.