// ==========================================================================
// AppDto.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group
// All rights reserved.
// ==========================================================================
using System;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using NodaTime;
using Squidex.Domain.Apps.Core.Apps;
namespace Squidex.Areas.Api.Controllers.Apps.Models
{
public sealed class AppDto
{
///
/// The name of the app.
///
[Required]
[RegularExpression("^[a-z0-9]+(\\-[a-z0-9]+)*$")]
public string Name { get; set; }
///
/// The version of the app.
///
public long Version { get; set; }
///
/// The id of the app.
///
public Guid Id { get; set; }
///
/// The timestamp when the app has been created.
///
public Instant Created { get; set; }
///
/// The timestamp when the app has been modified last.
///
public Instant LastModified { get; set; }
///
/// The permission level of the user.
///
[JsonConverter(typeof(StringEnumConverter))]
public AppContributorPermission Permission { get; set; }
///
/// Gets the current plan name.
///
public string PlanName { get; set; }
///
/// Gets the next plan name.
///
public string PlanUpgrade { get; set; }
}
}