2017-05-08 14:08:44 -04:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
using Bit.Core.Models.Table;
|
|
|
|
|
|
using Newtonsoft.Json;
|
2017-05-08 22:14:01 -04:00
|
|
|
|
using System.Collections.Generic;
|
2017-05-08 14:08:44 -04:00
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Models.Api
|
|
|
|
|
|
{
|
|
|
|
|
|
public class GroupRequestModel
|
|
|
|
|
|
{
|
|
|
|
|
|
[Required]
|
|
|
|
|
|
[StringLength(300)]
|
|
|
|
|
|
public string Name { get; set; }
|
2017-05-08 22:14:01 -04:00
|
|
|
|
public IEnumerable<string> CollectionIds { get; set; }
|
2017-05-08 14:08:44 -04:00
|
|
|
|
|
|
|
|
|
|
public Group ToGroup(Guid orgId)
|
|
|
|
|
|
{
|
|
|
|
|
|
return ToGroup(new Group
|
|
|
|
|
|
{
|
|
|
|
|
|
OrganizationId = orgId
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Group ToGroup(Group existingGroup)
|
|
|
|
|
|
{
|
|
|
|
|
|
existingGroup.Name = Name;
|
|
|
|
|
|
return existingGroup;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|