フォルダ内のすべての項目に対するメタデータの強制適用
フォルダ内のすべての項目に対するメタデータの強制適用
メタデータカスケードポリシーがすでにフォルダに存在する場合は、メタデータカスケードポリシーのid
を指定してPOST /metadata_cascade_policies/:id/apply
APIエンドポイントを呼び出すことで、フォルダ内のすべての項目にメタデータインスタンスを強制的に適用できます。
cURL
curl -i -X POST "https://api.box.com/2.0/metadata_cascade_policies/21312/apply" \
-H "authorization: Bearer <ACCESS_TOKEN>" \
-H "content-type: application/json" \
-d '{
"conflict_resolution": "overwrite"
}'
TypeScript Gen
await client.metadataCascadePolicies.applyMetadataCascadePolicy(
cascadePolicyId,
{
conflictResolution:
'overwrite' as ApplyMetadataCascadePolicyRequestBodyConflictResolutionField,
} satisfies ApplyMetadataCascadePolicyRequestBody,
);
Python Gen
client.metadata_cascade_policies.apply_metadata_cascade_policy(
cascade_policy_id, ApplyMetadataCascadePolicyConflictResolution.OVERWRITE.value
)
.NET Gen
await client.MetadataCascadePolicies.ApplyMetadataCascadePolicyAsync(metadataCascadePolicyId: cascadePolicyId, requestBody: new ApplyMetadataCascadePolicyRequestBody(conflictResolution: ApplyMetadataCascadePolicyRequestBodyConflictResolutionField.Overwrite));
Java
String cascadePolicyID = "e4392a41-7de5-4232-bdf7-15e0d6bba067";
BoxMetadataCascadePolicy policy = new BoxMetadataCascadePolicy(api, cascadePolicyID);
policy.forceApply("none");
Python
from boxsdk.object.metadata_cascade_policy import CascadePolicyConflictResolution
cascade_policy = client.metadata_cascade_policy(policy_id='84113349-794d-445c-b93c-d8481b223434')
cascade_policy.force_apply(CascadePolicyConflictResolution.PRESERVE_EXISTING)
print('Cascade policy was force applied!')
.NET
string policyId = "11111";
string conflictResolution = Constants.ConflictResolution.Overwrite
BoxMetadataCascadePolicy newCascadePolicy = client.MetadataCascadePolicyManager
.ForceApplyCascadePolicyAsync(policyId, conflictResolution);
Node
var policyID = '84113349-794d-445c-b93c-d8481b223434';
client.metadata.forceApplyCascadePolicy(policyID, client.metadata.cascadeResolution.PRESERVE_EXISTING)
.then(() => {
// application started — no value returned
});