mirror of
https://github.com/bitwarden/server.git
synced 2025-04-23 22:15:10 -05:00
26 lines
825 B
C#
26 lines
825 B
C#
using Bit.Core.Enums;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Bit.Core.Models.Api
|
|
{
|
|
public class PushSendRequestModel : IValidatableObject
|
|
{
|
|
public string UserId { get; set; }
|
|
public string OrganizationId { 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))
|
|
{
|
|
yield return new ValidationResult($"{nameof(UserId)} or {nameof(OrganizationId)} is required.");
|
|
}
|
|
}
|
|
}
|
|
}
|