1
0
mirror of https://github.com/bitwarden/server synced 2025-12-19 17:53:44 +00:00
Files
server/src/Core/Models/Api/Request/CollectionRequestModel.cs
2018-08-02 08:57:32 -04:00

33 lines
826 B
C#

using System;
using System.ComponentModel.DataAnnotations;
using Bit.Core.Utilities;
using Bit.Core.Models.Table;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace Bit.Core.Models.Api
{
public class CollectionRequestModel
{
[Required]
[EncryptedString]
[EncryptedStringLength(1000)]
public string Name { get; set; }
public IEnumerable<SelectionReadOnlyRequestModel> Groups { get; set; }
public Collection ToCollection(Guid orgId)
{
return ToCollection(new Collection
{
OrganizationId = orgId
});
}
public Collection ToCollection(Collection existingCollection)
{
existingCollection.Name = Name;
return existingCollection;
}
}
}