Exemple #1
0
        /// <summary>
        /// Returns the news story with its content.
        /// </summary>
        /// <param name="newsId">The unique id of the news.</param>
        public async Task <News> GetStoryContentAsync(int newsId)
        {
            var news = await WAPI.GetAsync <IEnumerable <News> >(_session,
                                                                 _role.Slug + "/news/index_json/" + newsId).ConfigureAwait(false);

            return(news.First());
        }
Exemple #2
0
        /// <summary>
        /// Retrieves the message contents by the unique message identifier.
        /// </summary>
        /// <param name="messageId">The message identifier.</param>
        /// <returns>The message contents.</returns>
        public async Task <Message> GetMessageContentAsync(int messageId)
        {
            var messages = await WAPI.GetAsync <IEnumerable <Message> >(_session,
                                                                        _role.Slug + "/messages/" + messageId).ConfigureAwait(false);

            return(messages.First());
        }
Exemple #3
0
        /// <summary>
        /// Retrieves all the messages from the specified folder.
        /// </summary>
        /// <param name="folder">The folder to retrieve messages from, by default <see cref="MessageFolder.Inbox"/>.</param>
        /// <returns>The message records.</returns>
        public Task <IEnumerable <MessageRecord> > GetMessagesAsync(MessageFolder folder = MessageFolder.Inbox)
        {
            string path = "/messages/index_json";

            if (folder != MessageFolder.Inbox)
            {
                path += $"/{folder}";
            }

            return(WAPI.GetAsync <IEnumerable <MessageRecord> >(_session, _role.Slug + path));
        }
        public Task <IEnumerable <Observation> > GetLessonNotesAsync(DateTime?date = default)
        {
            string path = "/attendance/index_json";

            if (date is not null)
            {
                path += "?date={date:d.M.yyyy}";
            }

            return(WAPI.GetAsync <IEnumerable <Observation> >(_session, _role.Slug + path));
        }
Exemple #5
0
 public Task <RecipientResponse> GetAllRecipientsAsync()
 {
     return(WAPI.GetAsync <RecipientResponse>(_session, _role.Slug + "/messages/recipients"));
 }
Exemple #6
0
 /// <summary>
 /// Lists all the news stories available.
 /// </summary>
 public Task <IEnumerable <NewsRecord> > GetStoriesAsync()
 {
     return(WAPI.GetAsync <IEnumerable <NewsRecord> >(_session, _role.Slug + "/news/index_json"));
 }
        private async Task <string> GetSessionIdAsync()
        {
            var response = await WAPI.GetAsync <IndexResponse>(_context, "/index_json").ConfigureAwait(false);

            return(response.SessionID);
        }
Exemple #8
0
 public Task <IEnumerable <Group> > GetFutureGroupsAsync()
 => WAPI.GetAsync <IEnumerable <Group> >(_session, _role.Slug + "/groups/index_json/future");
Exemple #9
0
 public Task <IEnumerable <Group> > GetPastGroupsAsync()
 => WAPI.GetAsync <IEnumerable <Group> >(_session, _role.Slug + "/groups/index_json/past");
Exemple #10
0
 public Task <IEnumerable <Exam> > GetExamsAsync()
 => WAPI.GetAsync <IEnumerable <Exam> >(_session, _role.Slug + "/exams/index_json");