mirror of
https://github.com/bitwarden/server.git
synced 2024-11-25 12:45:18 +01:00
Explore making responses required and nullable
This commit is contained in:
parent
0766806279
commit
dfd1c22bae
@ -1,4 +1,7 @@
|
||||
using Bit.Core.Models.Api;
|
||||
#nullable enable
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Bit.Core.Models.Api;
|
||||
using Bit.Core.SecretsManager.Entities;
|
||||
|
||||
namespace Bit.Api.SecretsManager.Models.Response;
|
||||
@ -24,29 +27,25 @@ public class BaseSecretResponseModel : ResponseModel
|
||||
Projects = secret.Projects?.Select(p => new SecretResponseInnerProject(p));
|
||||
}
|
||||
|
||||
public BaseSecretResponseModel(string objectName = _objectName) : base(objectName)
|
||||
{
|
||||
}
|
||||
[Required]
|
||||
public Guid Id { get; }
|
||||
|
||||
public BaseSecretResponseModel() : base(_objectName)
|
||||
{
|
||||
}
|
||||
[Required]
|
||||
public Guid OrganizationId { get; }
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public string? Key { get; }
|
||||
|
||||
public Guid OrganizationId { get; set; }
|
||||
public string? Value { get; }
|
||||
|
||||
public string Key { get; set; }
|
||||
public string? Note { get; }
|
||||
|
||||
public string Value { get; set; }
|
||||
[Required]
|
||||
public DateTime CreationDate { get; }
|
||||
|
||||
public string Note { get; set; }
|
||||
[Required]
|
||||
public DateTime RevisionDate { get; }
|
||||
|
||||
public DateTime CreationDate { get; set; }
|
||||
|
||||
public DateTime RevisionDate { get; set; }
|
||||
|
||||
public IEnumerable<SecretResponseInnerProject> Projects { get; set; }
|
||||
public IEnumerable<SecretResponseInnerProject>? Projects { get; init; }
|
||||
|
||||
public class SecretResponseInnerProject
|
||||
{
|
||||
|
@ -12,10 +12,6 @@ public class SecretResponseModel : BaseSecretResponseModel
|
||||
Write = write;
|
||||
}
|
||||
|
||||
public SecretResponseModel() : base(_objectName)
|
||||
{
|
||||
}
|
||||
|
||||
public bool Read { get; set; }
|
||||
|
||||
public bool Write { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user