All files / src/model ForumResponse.ts

30% Statements 3/10
100% Branches 0/0
0% Functions 0/3
33.33% Lines 3/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301x   1x   1x                                                  
import { ForumThread } from './ForumThread';
 
import { Util } from '../internal/Util';
 
export class ForumResponse {
  public static fromRest(data: any) {
    Util.assertHasProperties(data, 'status', 'forum_threads');
 
    const ret = new ForumResponse();
    Util.setProperties(ret, data, 'next_page', 'prev_page', 'thread_count', 'page_count');
    ret.threads = data.forum_threads.map(thread => ForumThread.fromRest(thread));
    return ret;
  }
 
  /** The collection of threads returned. */
  public threads: ForumThread[] = [];
 
  /** The next page to request */
  public next_page: number;
 
  /** The previous page to request */
  public prev_page: number;
 
  /** The number of threads */
  public thread_count: number;
 
  /** The number of pages */
  public page_count: number;
}