public async Task<BoxCollectionMarkerBased<BoxLegalHoldPolicyAssignment>> GetAssignmentsAsync(string legalHoldPolicyId, string fields = null, string assignToType = null, string assignToId = null, int limit = 100, string marker = null, bool autoPaginate = false)
{
legalHoldPolicyId.ThrowIfNullOrWhiteSpace("legalHoldPolicyId");
BoxRequest request = new BoxRequest(_config.LegalHoldPoliciesEndpointUri, string.Format(Constants.LegalHoldPolicyAssignmentsPathString, legalHoldPolicyId))
.Method(RequestMethod.Get)
.Param(ParamFields, fields)
.Param("assign_to_type", assignToType)
.Param("assign_to_id", assignToId)
.Param("limit", limit.ToString())
.Param("marker", marker);
if (autoPaginate)
{
return await AutoPaginateMarker<BoxLegalHoldPolicyAssignment>(request, limit);
}
else
{
IBoxResponse<BoxCollectionMarkerBased<BoxLegalHoldPolicyAssignment>> response = await ToResponseAsync<BoxCollectionMarkerBased<BoxLegalHoldPolicyAssignment>>(request).ConfigureAwait(false);
return response.ResponseObject;
}
}