mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
Turn on file scoped namespaces (#2225)
This commit is contained in:
@ -1,25 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Api
|
||||
{
|
||||
public class PushSendRequestModel : IValidatableObject
|
||||
{
|
||||
public string UserId { get; set; }
|
||||
public string OrganizationId { get; set; }
|
||||
public string DeviceId { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
[Required]
|
||||
public PushType? Type { get; set; }
|
||||
[Required]
|
||||
public object Payload { get; set; }
|
||||
namespace Bit.Core.Models.Api;
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
public class PushSendRequestModel : IValidatableObject
|
||||
{
|
||||
public string UserId { get; set; }
|
||||
public string OrganizationId { get; set; }
|
||||
public string DeviceId { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
[Required]
|
||||
public PushType? Type { get; set; }
|
||||
[Required]
|
||||
public object Payload { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(UserId) && string.IsNullOrWhiteSpace(OrganizationId))
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(UserId) && string.IsNullOrWhiteSpace(OrganizationId))
|
||||
{
|
||||
yield return new ValidationResult($"{nameof(UserId)} or {nameof(OrganizationId)} is required.");
|
||||
}
|
||||
yield return new ValidationResult($"{nameof(UserId)} or {nameof(OrganizationId)} is required.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user