| | 1 | | namespace Songhay.Models; |
| | 2 | |
|
| | 3 | | /// <summary> |
| | 4 | | /// REST Paging Metadata |
| | 5 | | /// </summary> |
| | 6 | | public class RestPagingMetadata |
| | 7 | | { |
| | 8 | | /// <summary> |
| | 9 | | /// Gets or sets the size of the result set. |
| | 10 | | /// </summary> |
| 0 | 11 | | public int ResultSetSize { get; set; } |
| | 12 | |
|
| | 13 | | /// <summary> |
| | 14 | | /// Gets or sets the total size of the set. |
| | 15 | | /// </summary> |
| 0 | 16 | | public int TotalSetSize { get; set; } |
| | 17 | |
|
| | 18 | | /// <summary> |
| | 19 | | /// Gets or sets the start position. |
| | 20 | | /// </summary> |
| 0 | 21 | | public int StartPosition { get; set; } |
| | 22 | |
|
| | 23 | | /// <summary> |
| | 24 | | /// Gets or sets the end position. |
| | 25 | | /// </summary> |
| 0 | 26 | | public int EndPosition { get; set; } |
| | 27 | |
|
| | 28 | | /// <summary> |
| | 29 | | /// Gets or sets from date. |
| | 30 | | /// </summary> |
| 0 | 31 | | public DateTime? FromDate { get; set; } |
| | 32 | |
|
| | 33 | | /// <summary> |
| | 34 | | /// Gets or sets to date. |
| | 35 | | /// </summary> |
| 0 | 36 | | public DateTime? ToDate { get; set; } |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Gets or sets the next URI. |
| | 40 | | /// </summary> |
| 0 | 41 | | public string? NextUri { get; set; } |
| | 42 | |
|
| | 43 | | /// <summary> |
| | 44 | | /// Gets or sets the previous URI. |
| | 45 | | /// </summary> |
| 0 | 46 | | public string? PreviousUri { get; set; } |
| | 47 | |
|
| | 48 | | /// <summary> |
| | 49 | | /// Returns the shallow copy from <see cref="object.MemberwiseClone"/>. |
| | 50 | | /// </summary> |
| | 51 | | public RestPagingMetadata? ToShallowCopy() |
| 0 | 52 | | { |
| 0 | 53 | | return MemberwiseClone() as RestPagingMetadata; |
| 0 | 54 | | } |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// Returns a <see cref="String" /> that represents this instance. |
| | 58 | | /// </summary> |
| | 59 | | /// <returns> |
| | 60 | | /// A <see cref="String" /> that represents this instance. |
| | 61 | | /// </returns> |
| | 62 | | public override string ToString() |
| 0 | 63 | | { |
| 0 | 64 | | var sb = new StringBuilder(); |
| 0 | 65 | | sb.Append( |
| 0 | 66 | | $"resultSetSize: {ResultSetSize}, totalSetSize: {TotalSetSize}, startPosition: {StartPosition}, endPosition: |
| | 67 | |
|
| 0 | 68 | | if (FromDate != null) sb.Append($", fromDate: {FromDate}"); |
| 0 | 69 | | if (ToDate != null) sb.Append($", toDate: {ToDate}"); |
| 0 | 70 | | if (NextUri != null) sb.Append($", nextUri: {NextUri}"); |
| 0 | 71 | | if (PreviousUri != null) sb.Append($", previousUri: {PreviousUri}"); |
| | 72 | |
|
| 0 | 73 | | return sb.Length > 0 ? sb.ToString() : base.ToString() ?? GetType().Name; |
| 0 | 74 | | } |
| | 75 | | } |