mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
import groups and users for org via api
This commit is contained in:
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Bit.Core.Models.Api
|
||||
{
|
||||
public class ImportRequestModel
|
||||
public class ImportPasswordsRequestModel
|
||||
{
|
||||
private LoginRequestModel[] _logins;
|
||||
|
@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Core.Models.Api
|
||||
{
|
||||
public class ImportOrganizationUsersRequestModel
|
||||
{
|
||||
public Group[] Groups { get; set; }
|
||||
public User[] Users { get; set; }
|
||||
|
||||
public class Group
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
[Required]
|
||||
public string ExternalId { get; set; }
|
||||
|
||||
public Table.Group ToGroup(Guid organizationId)
|
||||
{
|
||||
return new Table.Group
|
||||
{
|
||||
OrganizationId = organizationId,
|
||||
Name = Name,
|
||||
ExternalId = ExternalId
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class User
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
public string Email { get; set; }
|
||||
public IEnumerable<string> ExternalGroupIds { get; set; }
|
||||
|
||||
public KeyValuePair<string, IEnumerable<string>> ToKvp()
|
||||
{
|
||||
return new KeyValuePair<string, IEnumerable<string>>(Email, ExternalGroupIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user