using System.Collections.Generic; namespace Unity.Cloud.UserReporting { /// /// Represents a user report list. /// public class UserReportList { #region Constructors /// /// Creates a new instance of the class. /// public UserReportList() { this.UserReportPreviews = new List(); } #endregion #region Properties /// /// Gets or sets the continuation token. /// public string ContinuationToken { get; set; } /// /// Gets or sets the error. /// public string Error { get; set; } /// /// Gets or sets a value indicating whether the list has more items. /// public bool HasMore { get; set; } /// /// Gets or sets the user report previews. /// public List UserReportPreviews { get; set; } #endregion #region Methods /// /// Completes the list. This only need to be called by the creator of the list. /// /// The original limit. /// The continuation token. public void Complete(int originalLimit, string continuationToken) { if (this.UserReportPreviews.Count > 0) { if (this.UserReportPreviews.Count > originalLimit) { while (this.UserReportPreviews.Count > originalLimit) { this.UserReportPreviews.RemoveAt(this.UserReportPreviews.Count - 1); } this.ContinuationToken = continuationToken; this.HasMore = true; } } } #endregion } }