SchooxSharp.Api.Clients.Dashboard.GetEnrolledUsersInCourse C# (CSharp) Method

GetEnrolledUsersInCourse() public method

Returns a list of enrolled users in a course with a summary of information for every user (e.g. enrollment date, user’s region and location, total time spent on course and total progress).
public GetEnrolledUsersInCourse ( int courseId, string role, int regionId = null, int locationId = null, int jobId = null, string letter = null, int start = null, int limit = 100, string sort = null ) : SchooxResponse>
courseId int Course identifier.
role string User's role
regionId int Region identifier.
locationId int Location identifier.
jobId int Job identifier.
letter string Lastname's starting letter
start int List's starting position
limit int Number of users to return per request, up to maximum of 1,000. Default to 100
sort string Sorting criteria
return SchooxResponse>
        public SchooxResponse<List<User>> GetEnrolledUsersInCourse(int courseId, string role, int? regionId = null, 
            int? locationId = null, int? jobId = null, string letter = null, int? start = null,
            int? limit = 100, string sort = null)
        {
            if(courseId <= 0)
                throw new ArgumentOutOfRangeException("courseId");
            if(string.IsNullOrWhiteSpace("role"))
                throw new ArgumentNullException("role");
            if (limit <= 0 || limit > 1000)
                throw new ArgumentOutOfRangeException("limit", "limit must be greater than 0 and less than or equal to 1000");

            //GET /dashboard/courses/:courseid
            var request = SService.GenerateBaseRequest("/dashboard/courses/{courseId}");
            request.Method = Method.GET;

            request.AddUrlSegment("courseId", courseId.ToString(CultureInfo.InvariantCulture));

            request.AddNonBlankQueryString ("role", role);
            request.AddNonBlankQueryString ("regionId", regionId);
            request.AddNonBlankQueryString ("locationId", locationId);
            request.AddNonBlankQueryString ("jobId", jobId);
            request.AddNonBlankQueryString ("letter", letter);
            request.AddNonBlankQueryString ("start", start);
            request.AddNonBlankQueryString ("limit", limit);
            request.AddNonBlankQueryString ("sort", sort);

            return Execute<List<User>>(request);
        }