using System;
using System.ComponentModel.DataAnnotations;
using Timeline.Models.Validation;
namespace Timeline.Models.Http
{
///
/// Content of post create request.
///
public class TimelinePostCreateRequestContent
{
///
/// Type of post content.
///
[Required]
public string Type { get; set; } = default!;
///
/// If post is of text type, this is the text.
///
public string? Text { get; set; }
///
/// If post is of image type, this is base64 of image data.
///
public string? Data { get; set; }
}
public class TimelinePostCreateRequest
{
///
/// Content of the new post.
///
[Required]
public TimelinePostCreateRequestContent Content { get; set; } = default!;
///
/// Time of the post. If not set, current time will be used.
///
public DateTime? Time { get; set; }
}
///
/// Create timeline request model.
///
public class TimelineCreateRequest
{
///
/// Name of the new timeline. Must be a valid name.
///
[Required]
[TimelineName]
public string Name { get; set; } = default!;
}
///
/// Patch timeline request model.
///
public class TimelinePatchRequest
{
///
/// New description. Null for not change.
///
public string? Description { get; set; }
///
/// New visibility. Null for not change.
///
public TimelineVisibility? Visibility { get; set; }
}
}