/// <summary> /// Retrieves a list of users associated with a role. /// </summary> /// <param name="id">The ID of the role to query.</param> /// <param name="pagination">Specifies <see cref="CheckpointPaginationInfo"/> to use in requesting checkpoint-paginated results.</param> /// <returns>An <see cref="IPagedList{AssignedUser}"/> containing the assigned users.</returns> public Task <ICheckpointPagedList <AssignedUser> > GetUsersAsync(string id, CheckpointPaginationInfo pagination) { return(Connection.GetAsync <ICheckpointPagedList <AssignedUser> >(BuildUri($"roles/{EncodePath(id)}/users", new Dictionary <string, string> { { "from", pagination.From?.ToString() }, { "take", pagination.Take.ToString() }, }), DefaultHeaders, assignedUsersCheckpointConverters)); }
/// <summary> /// Retrieves a list of all organizations using checkpoint <paramref name="pagination"/>. /// </summary> /// <param name="pagination">Specifies <see cref="CheckpointPaginationInfo"/> to use in requesting checkpoint-paginated results.</param> /// <returns>An <see cref="ICheckpointPagedList{Organization}"/> containing the organizations.</returns> public Task <ICheckpointPagedList <Organization> > GetAllAsync(CheckpointPaginationInfo pagination) { if (pagination == null) { throw new ArgumentNullException(nameof(pagination)); } var queryStrings = new Dictionary <string, string> { { "from", pagination.From?.ToString() }, { "take", pagination.Take.ToString() }, }; return(Connection.GetAsync <ICheckpointPagedList <Organization> >(BuildUri("organizations", queryStrings), DefaultHeaders, checkpointConverters)); }