mirror of
https://github.com/bitwarden/server.git
synced 2025-05-21 03:24:31 -05:00

* Remove UpdateSecretsManagerSubscriptionCommand.AdjustServiceAccounts interface * Rewrite tests and use autofixture customizations * Reduce method nesting in the command, simplify parameters * Fix capitalization and wording of error messages * Add checks for existing SM beta enrolment etc
26 lines
876 B
C#
26 lines
876 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using Bit.Core.Entities;
|
|
using Bit.Core.Models.Business;
|
|
|
|
namespace Bit.Api.Models.Request.Organizations;
|
|
|
|
public class SecretsManagerSubscriptionUpdateRequestModel
|
|
{
|
|
[Required]
|
|
public int SeatAdjustment { get; set; }
|
|
public int? MaxAutoscaleSeats { get; set; }
|
|
public int ServiceAccountAdjustment { get; set; }
|
|
public int? MaxAutoscaleServiceAccounts { get; set; }
|
|
|
|
public virtual SecretsManagerSubscriptionUpdate ToSecretsManagerSubscriptionUpdate(Organization organization)
|
|
{
|
|
return new SecretsManagerSubscriptionUpdate(organization, false)
|
|
{
|
|
MaxAutoscaleSmSeats = MaxAutoscaleSeats,
|
|
MaxAutoscaleSmServiceAccounts = MaxAutoscaleServiceAccounts
|
|
}
|
|
.AdjustSeats(SeatAdjustment)
|
|
.AdjustServiceAccounts(ServiceAccountAdjustment);
|
|
}
|
|
}
|