mirror of
https://github.com/bitwarden/server
synced 2026-01-04 01:23:25 +00:00
* Start switch to System.Text.Json * Work on switching to System.Text.Json * Main work on STJ refactor * Fix build errors * Run formatting * Delete unused file * Use legacy for two factor providers * Run formatter * Add TokenProviderTests * Run formatting * Fix merge issues * Switch to use JsonSerializer * Address PR feedback * Fix formatting * Ran formatter * Switch to async * Ensure Enums are serialized as strings * Fix formatting * Enqueue single items as arrays * Remove CreateAsync method on AzureQueueService
25 lines
626 B
C#
25 lines
626 B
C#
using System;
|
|
using System.Text.Json;
|
|
using Bit.Core.Entities;
|
|
|
|
namespace Bit.Api.Models.Public.Request
|
|
{
|
|
public class PolicyUpdateRequestModel : PolicyBaseModel
|
|
{
|
|
public Policy ToPolicy(Guid orgId)
|
|
{
|
|
return ToPolicy(new Policy
|
|
{
|
|
OrganizationId = orgId
|
|
});
|
|
}
|
|
|
|
public virtual Policy ToPolicy(Policy existingPolicy)
|
|
{
|
|
existingPolicy.Enabled = Enabled.GetValueOrDefault();
|
|
existingPolicy.Data = Data != null ? JsonSerializer.Serialize(Data) : null;
|
|
return existingPolicy;
|
|
}
|
|
}
|
|
}
|