Examples of MapJSONStringEntity


Examples of com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

     * @param destinationUserId
     *            the ID of the user who the folder will be transferred to
     * @return
     */
    private BoxSimpleUserRequestObject setDestinationUser(final String destinationUserId) {
        MapJSONStringEntity id = new MapJSONStringEntity();
        id.put(BoxUser.FIELD_ID, destinationUserId);
        put(BoxItem.FIELD_OWNED_BY, id);
        return this;
    }
View Full Code Here

Examples of com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

     * @param parentId
     *            id of parent
     * @return
     */
    public BoxItemRequestObject setParent(String parentId) {
        MapJSONStringEntity entity = new MapJSONStringEntity();
        entity.put(BoxFolder.FIELD_ID, parentId);
        put(BoxItem.FIELD_PARENT, entity);
        return this;
    }
View Full Code Here

Examples of com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

        put(BoxComment.FIELD_ITEM, getItemEntity(type, itemId));
        return this;
    }

    private static MapJSONStringEntity getItemEntity(final IBoxType type, final String itemId) {
        MapJSONStringEntity entity = new MapJSONStringEntity();
        entity.put("type", type.toString());
        entity.put("id", itemId);
        return entity;
    }
View Full Code Here

Examples of com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

     * @param parentId
     *            id of parent
     * @return
     */
    private BoxItemCopyRequestObject setParent(String parentId) {
        MapJSONStringEntity entity = new MapJSONStringEntity();
        entity.put(BoxFolder.FIELD_ID, parentId);
        put(BoxItem.FIELD_PARENT, entity);
        return this;
    }
View Full Code Here

Examples of com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

        testRequestIsWellFormed(request, TestUtils.getConfig().getApiUrlAuthority(),
            TestUtils.getConfig().getApiUrlPath().concat(CreateEmailAliasRequest.getUri(userId)), HttpStatus.SC_CREATED, RestMethod.POST);
        HttpEntity en = request.getRequestEntity();
        Assert.assertTrue(en instanceof StringEntity);
        MapJSONStringEntity mEntity = new MapJSONStringEntity();
        mEntity.put("email", email);
        assertEqualStringEntity(mEntity, en);

    }
View Full Code Here

Examples of com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

     *            role/access level of this collaboration(This is a String defined in {@link com.box.boxjavalibv2.dao.BoxCollaborationRole}
     * @return BoxCollabRequestEntity
     */
    public static BoxCollabRequestObject createCollabObject(final String folderId, final String userId, final String login, final String role) {
        BoxCollabRequestObject entity = new BoxCollabRequestObject();
        MapJSONStringEntity item = getItemEntity(folderId);
        entity.setAccessibleBy(userId, login);
        entity.setItem(item);
        entity.setRole(role);
        return entity;
    }
View Full Code Here

Examples of com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

     *            id of the user to collaborate, this is optional, if you don't want to supply a user id, use null.
     * @param login
     *            login email of the collaborator(Can be non-box email.)
     */
    public BoxCollabRequestObject setAccessibleBy(final String userId, final String login) {
        MapJSONStringEntity accessibleBy = getAccessibilityEntity(userId, login);
        put(BoxCollaboration.FIELD_ACCESSIBLE_BY, accessibleBy);
        return this;
    }
View Full Code Here

Examples of com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

        getRequestExtras().addQueryParam(BoxCollaboration.FIELD_STATUS, status);
        return this;
    }

    private static MapJSONStringEntity getItemEntity(String folderId) {
        MapJSONStringEntity entity = new MapJSONStringEntity();
        entity.put("id", folderId);
        entity.put("type", BoxResourceType.FOLDER.toString());
        return entity;
    }
View Full Code Here

Examples of com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

        entity.put("type", BoxResourceType.FOLDER.toString());
        return entity;
    }

    private static MapJSONStringEntity getAccessibilityEntity(final String userId, final String login) {
        MapJSONStringEntity entity = new MapJSONStringEntity();
        if (StringUtils.isNotEmpty(userId)) {
            entity.put("id", userId);
        }
        entity.put("login", login);
        return entity;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.