AP.NET/Models/Object.cs
Gordon Pedersen 7c84fbc4c5 Initial commit way too late
There's a lot of rubbish in here, but I don't want to lose anything, so I'm going to commit it all before getting rid of some of the trash.
2024-04-05 15:26:57 +11:00

181 lines
No EOL
4.7 KiB
C#

namespace ActivityPub;
/// <summary>
/// https://www.w3.org/ns/activitystreams#Object
/// </summary>
public class Object {
/// <summary>
/// Default contructor
/// </summary>
public Object() => this.Type = "Object";
/// <summary>
/// https://www.w3.org/TR/activitypub/#obj-id
/// </summary>
public Uri? Id { get; set; }
/// <summary>
/// https://www.w3.org/TR/activitystreams-vocabulary/#dfn-type
/// </summary>
public string Type { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#attachment
/// </summary>
public ObjectOrLink? Attachment { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#attributedTo
/// </summary>
public ObjectOrLink? AttributedTo { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#audience
/// </summary>
public ObjectOrLink? Audience { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#content
/// </summary>
public string? Content { get; set; }
/// <summary>
/// https://www.w3.org/TR/activitypub/#source-property
/// </summary>
public ObjectOrLink? Source { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#context
/// </summary>
public ObjectOrLink? Context { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#name
/// </summary>
public string? Name { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#endTime
/// </summary>
public DateTimeOffset? EndTime { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#generator
/// </summary>
public ObjectOrLink? Generator { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#icon
/// </summary>
public GenericObjectOrLink<Image>? Icon { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#Image
/// </summary>
public Image? Image { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#inReplyTo
/// </summary>
public ObjectOrLink? InReplyTo { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#location
/// </summary>
public ObjectOrLink? Location { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#preview
/// </summary>
public ObjectOrLink? Preview { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#published
/// </summary>
public DateTimeOffset? Published { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#replies
/// </summary>
public Collection? Replies { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#startTime
/// </summary>
public DateTimeOffset? StartTime { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#summary
/// </summary>
public string? Summary { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#tag
/// </summary>
public ObjectOrLink? Tag { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#updated
/// </summary>
public DateTimeOffset? Updated { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#url
/// </summary>
public LinkOrUri? Url { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#to
/// </summary>
public ListOrLink<Object>? To { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#bto
/// </summary>
public ListOrLink<Object>? Bto { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#cc
/// </summary>
public ListOrLink<Object>? Cc { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#bcc
/// </summary>
public ListOrLink<Object>? Bcc { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#mediaType
/// </summary>
public string? MediaType { get; set; }
/// <summary>
/// https://www.w3.org/ns/activitystreams#duration
/// </summary>
public string? Duration { get; set; }
/// <summary>
/// https://www.w3.org/TR/activitypub/#likes
/// </summary>
public ListOrLink<Object>? Likes { get; set; }
/// <summary>
/// https://www.w3.org/TR/activitypub/#shares
/// </summary>
public ListOrLink<Object>? Shares { get; set; }
//public Object(dynamic that) {
// if(that.Id is Uri) this.Id = that.Id;
// if(that.Id is string) this.Id = new Uri(that.Id);
// this.Type = that.Type;
//}
//public static ObjectOrLink? FromDynamic(dynamic that) {
// if (that is null) return null;
// if (that is Uri) return (ObjectOrLink?)(Uri)that;
// if (that is string) return (ObjectOrLink?)new Uri((string)that);
// if (that is Object) return (ObjectOrLink?)(Object)that;
// return (ObjectOrLink?)new Object(that);
//}
}