会社またはユーザーのすべてのストレージポリシー割り当てを取得します。
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii
結果が返される開始位置のマーカー。マーカーベースのページ割りを使用している場合に使用されます。
これを使用するには、usemarker
をtrue
に設定する必要があります。
984322
割り当てを返すユーザーまたは会社のID
user
割り当てを返すターゲットのタイプ
次の値のいずれか1つ: user
,enterprise
会社またはユーザーのストレージポリシーのコレクションを返します。
予期しないクライアントエラー。
curl -i -X GET "https://api.box.com/2.0/storage_policy_assignments?resolved_for_type=userresolved_for_id=984322" \
-H "authorization: Bearer <ACCESS_TOKEN>"
await client.storagePolicyAssignments.getStoragePolicyAssignments({
resolvedForType:
'user' as GetStoragePolicyAssignmentsQueryParamsResolvedForTypeField,
resolvedForId: userId,
} satisfies GetStoragePolicyAssignmentsQueryParams);
client.storage_policy_assignments.get_storage_policy_assignments(
GetStoragePolicyAssignmentsResolvedForType.USER, user_id
)
await client.StoragePolicyAssignments.GetStoragePolicyAssignmentsAsync(queryParams: new GetStoragePolicyAssignmentsQueryParams(resolvedForType: GetStoragePolicyAssignmentsQueryParamsResolvedForTypeField.User, resolvedForId: userId));
BoxStoragePolicyAssignment.Info assignmentInfo = BoxStoragePolicyAssignment.getAssignmentForTarget(api, "user", "1234")
assignment = client.user(user_id='12345').get_storage_policy_assignment()
print(f'Assignment ID is {assignment.id} and the storage policy ID is {assignment.storage_policy.id}')
BoxStoragePolicyAssignment assignment = client.StoragePoliciesManager
.GetAssignmentForTargetAsync("22222");
client.storagePolicies.getAssignmentForTarget('22222')
.then(assignment => {
/* assignment -> {
type: 'storage_policy_assignment',
id: 'dXNlcl8yMjIyMg==',
storage_policy: 'storage_policy', id: '7' },
assigned_to: { type: 'user', id: '22222' } }
*/
});
client.storagePolicy.listAssignments(resolvedForType: "user", resolvedForId: "1234") { (result: Result<StoragePolicyAssignment, BoxSDKError>) in
guard case let .success(assignment) = result else {
print("Error getting storage policy assignment")
return
}
print("Storage policy assignment for user \(assignment.assignedTo?.id) is \(assignment.id)")
}
{
"entries": [
{
"assigned_to": {
"id": "11446498",
"type": "file"
},
"id": "ZW50ZXJwcmlzZV8xMjM0NTY3ODkw",
"storage_policy": {
"id": "11446498",
"type": "storage_policy"
},
"type": "storage_policy_assignment"
}
],
"limit": 1000,
"next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii",
"prev_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih"
}