1
0
mirror of https://github.com/bitwarden/server synced 2025-12-18 01:03:17 +00:00
Files
server/src/Scim/Models/ScimListResponse.cs
2017-12-12 13:22:37 -05:00

25 lines
855 B
C#

using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
namespace Bit.Scim.Models
{
public class ScimListResponse : ScimSchemaBase
{
public ScimListResponse(IEnumerable<ScimResource> resources)
{
Resources = resources;
}
public override string SchemaIdentifier => Constants.Messages.ListResponse;
[JsonProperty("totalResults", Order = 0)]
public int TotalResults => Resources == null ? 0 : Resources.Count();
[JsonProperty("Resources", Order = 1)]
public IEnumerable<ScimResource> Resources { get; private set; }
[JsonProperty("startIndex", Order = 2)]
public int StartIndex { get; set; } = 0;
[JsonProperty("itemsPerPage", Order = 3)]
public int ItemsPerPage => Resources == null ? 0 : Resources.Count();
}
}