Package com.box.boxjavalibv2.requests.requestobjects

Source Code of com.box.boxjavalibv2.requests.requestobjects.BoxItemRestoreRequestObject

package com.box.boxjavalibv2.requests.requestobjects;

import com.box.boxjavalibv2.dao.BoxFolder;
import com.box.boxjavalibv2.dao.BoxItem;
import com.box.boxjavalibv2.jsonentities.MapJSONStringEntity;
import com.box.restclientv2.requestsbase.BoxDefaultRequestObject;

public class BoxItemRestoreRequestObject extends BoxDefaultRequestObject {

    private BoxItemRestoreRequestObject() {
    }

    public static BoxItemRestoreRequestObject restoreItemRequestObject() {
        return new BoxItemRestoreRequestObject();
    }

    /**
     * Rename the restored item.
     *
     * @param newName
     * @return
     */
    public BoxItemRestoreRequestObject setNewName(final String newName) {
        put(BoxItem.FIELD_NAME, newName);
        return this;
    }

    /**
     * Set new parent for the restored item.
     *
     * @param parentId
     * @return
     */
    public BoxItemRestoreRequestObject setNewParent(final String parentId) {
        MapJSONStringEntity id = new MapJSONStringEntity();
        id.put(BoxFolder.FIELD_ID, parentId);
        put(BoxItem.FIELD_PARENT, id);
        return this;
    }
}
TOP

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

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.