// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using NodaTime; using Squidex.Domain.Apps.Core.Contents; using Squidex.Domain.Apps.Entities.Contents.Commands; using Squidex.Infrastructure; using Squidex.Infrastructure.Reflection; namespace Squidex.Areas.Api.Controllers.Contents.Models { public class BulkUpdateContentsJobDto { /// /// An optional query to identify the content to update. /// public JsonQueryDto? Query { get; set; } /// /// An optional id of the content to update. /// public DomainId? Id { get; set; } /// /// The data of the content when type is set to 'Upsert', 'Create', 'Update' or 'Patch. /// public ContentData? Data { get; set; } /// /// The new status when the type is set to 'ChangeStatus' or 'Upsert'. /// public Status? Status { get; set; } /// /// The due time. /// public Instant? DueTime { get; set; } /// /// The update type. /// public BulkUpdateContentType Type { get; set; } /// /// The optional schema id or name. /// public string? Schema { get; set; } /// /// Makes the update as patch. /// public bool Patch { get; set; } /// /// True to delete the content permanently. /// public bool Permanent { get; set; } /// /// The number of expected items. Set it to a higher number to update multiple items when a query is defined. /// public long ExpectedCount { get; set; } = 1; /// /// The expected version. /// public long ExpectedVersion { get; set; } = EtagVersion.Any; public BulkUpdateJob ToJob() { return SimpleMapper.Map(this, new BulkUpdateJob { Query = Query }); } } }