Fetches a specific storage policy assignment.
932483
The ID of the storage policy assignment.
Returns a storage policy assignment object.
An unexpected client error.
curl -X GET https://api.box.com/2.0/storage_policy_assignments/932483 \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
BoxStoragePolicyAssignment assignment = await client.StoragePoliciesManager
.GetAssignmentAsync(assignmentId: "dXNlcl8yMjIyMg==");
BoxStoragePolicyAssignment storagePolicyAssignment = new BoxStoragePolicyAssignment(api, id);
BoxStoragePolicyAssignment.Info assignmentInfo = storagePolicyAssignment.getInfo();
assignment = client.storage_policy_assignment(assignment_id='12345').get()
print('Assignment ID is {0} and the storage policy ID is {1}'.format(assignment.id, assignment.storage_policy.id))
client.storagePolicies.getAssignment('dXNlcl8yMjIyMg==')
.then(assignment => {
/* assignment -> {
type: 'storage_policy_assignment',
id: 'dXNlcl8yMjIyMg==',
storage_policy: 'storage_policy', id: '7' },
assigned_to: { type: 'user', id: '22222' } }
*/
});
client.storagePolicy.getAssignment(storagePolicyAssignmentId: "1234") { (result: Result<StoragePolicyAssignment, BoxSDKError>) in
guard case let .success(assignment) = result else {
print("Error getting storage policy assignment")
return
}
print("Storage policy assignment ID \(assignment.id)")
}