@BoxResourceType(value="storage_policy_assignment") public class BoxStoragePolicyAssignment extends BoxResource
Modifier and Type | Class and Description |
---|---|
class |
BoxStoragePolicyAssignment.Info
Contains information about a BoxStoragePolicyAssignment.
|
Modifier and Type | Field and Description |
---|---|
static URLTemplate |
STORAGE_POLICY_ASSIGNMENT_URL_TEMPLATE
Storage Policies Assignment URL Template.
|
static URLTemplate |
STORAGE_POLICY_ASSIGNMENT_WITH_ID_URL_TEMPLATE
Storage Policy Assignment URL Template.
|
Constructor and Description |
---|
BoxStoragePolicyAssignment(BoxAPIConnection api,
String id)
Constructs a BoxStoragePolicyAssignment for a BoxStoragePolicy with a givenID.
|
Modifier and Type | Method and Description |
---|---|
static BoxStoragePolicyAssignment.Info |
assign(BoxAPIConnection api,
String storagePolicyID,
String userID)
Checks if there is already a Storage Policy Assignment and creates one if one does not exist.
|
static BoxStoragePolicyAssignment.Info |
create(BoxAPIConnection api,
String policyID,
String userID)
Create a BoxStoragePolicyAssignment for a BoxStoragePolicy.
|
void |
delete()
Deletes this BoxStoragePolicyAssignment.
|
static BoxStoragePolicyAssignment.Info |
getAssignmentForTarget(BoxAPIConnection api,
String resolvedForType,
String resolvedForID)
Returns a BoxStoragePolicyAssignment information.
|
BoxStoragePolicyAssignment.Info |
getInfo() |
void |
updateInfo(BoxStoragePolicyAssignment.Info info)
Updates the information about the BoxStoragePolicyAssignment with any info fields that have been
modified locally.
|
equals, getAPI, getID, getResourceType, hashCode
public static final URLTemplate STORAGE_POLICY_ASSIGNMENT_URL_TEMPLATE
public static final URLTemplate STORAGE_POLICY_ASSIGNMENT_WITH_ID_URL_TEMPLATE
public BoxStoragePolicyAssignment(BoxAPIConnection api, String id)
api
- the API connection to be used by the file.id
- the ID of the file.public static BoxStoragePolicyAssignment.Info create(BoxAPIConnection api, String policyID, String userID)
api
- the API connection to be used by the resource.policyID
- the policy ID of the BoxStoragePolicy.userID
- the user ID of the to assign the BoxStoragePolicy to.public static BoxStoragePolicyAssignment.Info getAssignmentForTarget(BoxAPIConnection api, String resolvedForType, String resolvedForID)
api
- the API connection to be used by the resource.resolvedForType
- the assigned entity type for the storage policy.resolvedForID
- the assigned entity id for the storage policy.BoxStoragePolicyAssignment
.public static BoxStoragePolicyAssignment.Info assign(BoxAPIConnection api, String storagePolicyID, String userID)
api
- the API connection to be used by the resource.storagePolicyID
- the ID of the Storage Policy you want to assign to user.userID
- the ID of the user you want to assign the Storage Policy to.BoxStoragePolicyAssignment
.public void updateInfo(BoxStoragePolicyAssignment.Info info)
info
- the updated info.public BoxStoragePolicyAssignment.Info getInfo()
BoxStoragePolicyAssignment
.public void delete()