- List storage policy assignments
- Assign storage policy
- Get storage policy assignment
- Update storage policy assignment
- Unassign storage policy
Fetches all the storage policy assignment for an enterprise or user.
This operation is performed by calling function getStoragePolicyAssignments
.
See the endpoint docs at API Reference.
await client.storagePolicyAssignments.getStoragePolicyAssignments({
resolvedForType:
'user' as GetStoragePolicyAssignmentsQueryParamsResolvedForTypeField,
resolvedForId: userId,
} satisfies GetStoragePolicyAssignmentsQueryParams);
- queryParams
GetStoragePolicyAssignmentsQueryParams
- Query parameters of getStoragePolicyAssignments method
This function returns a value of type StoragePolicyAssignments
.
Returns a collection of storage policies for the enterprise or user.
Creates a storage policy assignment for an enterprise or user.
This operation is performed by calling function createStoragePolicyAssignment
.
See the endpoint docs at API Reference.
await client.storagePolicyAssignments.createStoragePolicyAssignment({
storagePolicy: new CreateStoragePolicyAssignmentRequestBodyStoragePolicyField(
{ id: policyId },
),
assignedTo: {
id: userId,
type: 'user' as CreateStoragePolicyAssignmentRequestBodyAssignedToTypeField,
} satisfies CreateStoragePolicyAssignmentRequestBodyAssignedToField,
} satisfies CreateStoragePolicyAssignmentRequestBody);
- requestBody
CreateStoragePolicyAssignmentRequestBody
- Request body of createStoragePolicyAssignment method
This function returns a value of type StoragePolicyAssignment
.
Returns the new storage policy assignment created.
Fetches a specific storage policy assignment.
This operation is performed by calling function getStoragePolicyAssignmentById
.
See the endpoint docs at API Reference.
await client.storagePolicyAssignments.getStoragePolicyAssignmentById(
storagePolicyAssignment.id,
);
- storagePolicyAssignmentId
string
- The ID of the storage policy assignment. Example: "932483"
This function returns a value of type StoragePolicyAssignment
.
Returns a storage policy assignment object.
Updates a specific storage policy assignment.
This operation is performed by calling function updateStoragePolicyAssignmentById
.
See the endpoint docs at API Reference.
await client.storagePolicyAssignments.updateStoragePolicyAssignmentById(
storagePolicyAssignment.id,
{
storagePolicy:
new UpdateStoragePolicyAssignmentByIdRequestBodyStoragePolicyField({
id: storagePolicy2.id,
}),
} satisfies UpdateStoragePolicyAssignmentByIdRequestBody,
);
- storagePolicyAssignmentId
string
- The ID of the storage policy assignment. Example: "932483"
- requestBody
UpdateStoragePolicyAssignmentByIdRequestBody
- Request body of updateStoragePolicyAssignmentById method
This function returns a value of type StoragePolicyAssignment
.
Returns an updated storage policy assignment object.
Delete a storage policy assignment.
Deleting a storage policy assignment on a user will have the user inherit the enterprise's default storage policy.
There is a rate limit for calling this endpoint of only twice per user in a 24 hour time frame.
This operation is performed by calling function deleteStoragePolicyAssignmentById
.
See the endpoint docs at API Reference.
await client.storagePolicyAssignments.deleteStoragePolicyAssignmentById(
storagePolicyAssignment.id,
);
- storagePolicyAssignmentId
string
- The ID of the storage policy assignment. Example: "932483"
This function returns a value of type undefined
.
Returns an empty response when the storage policy assignment is successfully deleted.