mirror of
https://github.com/bitwarden/server.git
synced 2026-02-05 00:23:24 +08:00
36 lines
939 B
C#
36 lines
939 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using Bit.Core.Models.Table;
|
|
|
|
namespace Bit.Api.Models.Request
|
|
{
|
|
public class GroupRequestModel
|
|
{
|
|
[Required]
|
|
[StringLength(100)]
|
|
public string Name { get; set; }
|
|
[Required]
|
|
public bool? AccessAll { get; set; }
|
|
[StringLength(300)]
|
|
public string ExternalId { get; set; }
|
|
public IEnumerable<SelectionReadOnlyRequestModel> Collections { get; set; }
|
|
|
|
public Group ToGroup(Guid orgId)
|
|
{
|
|
return ToGroup(new Group
|
|
{
|
|
OrganizationId = orgId
|
|
});
|
|
}
|
|
|
|
public Group ToGroup(Group existingGroup)
|
|
{
|
|
existingGroup.Name = Name;
|
|
existingGroup.AccessAll = AccessAll.Value;
|
|
existingGroup.ExternalId = ExternalId;
|
|
return existingGroup;
|
|
}
|
|
}
|
|
}
|