Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.box.androidsdk.content;
  
Represents the API of the collaboration endpoint on Box. This class can be used to generate request objects for each of the APIs exposed endpoints
 
 public class BoxApiCollaboration extends BoxApi {

    
Gets the URL for collaborations

Returns:
the collaboration URL
 
     protected String getCollaborationsUrl() { return String.format("%s/collaborations"getBaseUri()); }

    
Gets the URL for collaboration information

Parameters:
id id of the collaboration
Returns:
the collaboration information URL
 
     protected String getCollaborationInfoUrl(String id) { return String.format("%s/%s"getCollaborationsUrl(), id); }

    
Constructs a BoxApiCollaboration with the provided BoxSession

Parameters:
session authenticated session to use with the BoxApiCollaboration
 
     public BoxApiCollaboration(BoxSession session) {
         super(session);
     }

    
A request to retrieve a collaboration of a given id.

Parameters:
collaborationId id of the collaboration to retrieve
Returns:
request to retrieve information about a collaboration
 
     public BoxRequestsShare.GetCollaborationInfo getInfoRequest(String collaborationId) {
         BoxRequestsShare.GetCollaborationInfo collab = new BoxRequestsShare.GetCollaborationInfo(collaborationIdgetCollaborationInfoUrl(collaborationId), );
         return collab;
     }

    
A request that adds a user or group as a collaborator to a folder.

Parameters:
folderId id of the folder to be collaborated.
role role of the collaboration
collaborator the user or group to add as a collaborator
Returns:
request to add/create a collaboration
 
     public BoxRequestsShare.AddCollaboration getAddRequest(String folderId, BoxCollaboration.Role roleBoxCollaborator collaborator) {
                 folderIdrolecollaborator);
         return collab;
     }

    
A request that adds a user as a collaborator to a folder by using their login.

Parameters:
folderId id of the folder to be collaborated.
role role of the collaboration
login email address of the user to add
Returns:
request to add/create a collaboration
 
     public BoxRequestsShare.AddCollaboration getAddRequest(String folderId, BoxCollaboration.Role roleString login) {
                 folderIdrolelogin);
         return collab;
     }

    
A request to retrieve a list of pending collaborations for the user.

Returns:
request to retrieve pending collaborations.
 
         return request;
     }

    
A request to delete a collaboration with given collaboration id.

Parameters:
collaborationId id of the collaboration to delete
Returns:
request to delete a collaboration
 
     public BoxRequestsShare.DeleteCollaboration getDeleteRequest(String collaborationId) {
         BoxRequestsShare.DeleteCollaboration collab = new BoxRequestsShare.DeleteCollaboration(collaborationIdgetCollaborationInfoUrl(collaborationId), );
         return collab;
     }

    
A request to update a collaboration given a collaboration id. Note this request itself will not update collaboration. In order to update you will need to call the methods in UpdateCollaboration class. e.g., to update the collaboration role, call setNewRole() method after getting the request; to update the collaboration status, call setNewStatus after getting the request.

Parameters:
collaborationId id of the collaboration to update
Returns:
request to update a collaboration
    public BoxRequestsShare.UpdateCollaboration getUpdateRequest(String collaborationId) {
        BoxRequestsShare.UpdateCollaboration collab = new BoxRequestsShare.UpdateCollaboration(collaborationIdgetCollaborationInfoUrl(collaborationId), );
        return collab;
    }
New to GrepCode? Check out our FAQ X