namespace ActivityPub;
/////
///// A class representing a link (either as a Uri or Link object)
/////
//public class LinkOrUri : OneOfBase {
// protected LinkOrUri(OneOf _) : base(_) { }
// public static implicit operator LinkOrUri(Uri _) => new LinkOrUri(_);
// public static implicit operator LinkOrUri(Link _) => new LinkOrUri(_);
// public static implicit operator LinkOrUri(string _) => new LinkOrUri(new Uri(_));
// public static explicit operator Uri?(LinkOrUri _) => _.Match(uri => uri, link => link.Href);
// public static explicit operator Link(LinkOrUri _) => _.Match(
// uri => new Link { Href = uri },
// link => link
// );
// public static explicit operator string?(LinkOrUri _) => ((Uri?)_)?.ToString();
// public T? FetchObject() where T : Object, new() {
// Uri? uri = (Uri?)this;
// if (uri == null) return default(T);
// // TODO: Fetch the object from the uri instead of the below:
// return this.Match(
// uri => new T { Id = uri }, // TODO: Fetch the object
// link => new T { Id = link.Href, Name = link.Name } // TODO: Fetch the object
// );
// }
//}
/////
///// A class representing either an object or link
/////
//public class GenericObjectOrLink : OneOfBase where T : Object, new() {
// protected GenericObjectOrLink(OneOf _) : base(_) { }
// public static implicit operator GenericObjectOrLink(Uri _) => new GenericObjectOrLink(_);
// public static implicit operator GenericObjectOrLink(Link _) => new GenericObjectOrLink(_);
// public static implicit operator GenericObjectOrLink(T _) => new GenericObjectOrLink(_);
// public static implicit operator GenericObjectOrLink(string _) => new GenericObjectOrLink(new Uri(_));
// public static explicit operator Uri(GenericObjectOrLink _) => _.Match(uri => uri, link => link.Href, obj => obj.Id);
// public static explicit operator Link(GenericObjectOrLink _) => _.Match(
// uri => new Link { Href = uri },
// link => link,
// obj => new Link { Href = obj.Id, Name = obj.Name }
// );
// public static explicit operator T?(GenericObjectOrLink _) => _.FetchObject();
// public static explicit operator string?(GenericObjectOrLink _) => ((Uri?)_)?.ToString();
// public T? FetchObject(bool force = false) {
// if (this.IsT2 && !force) return this.AsT2;
// Uri? uri = (Uri?)this;
// if (uri == null) return null;
// // TODO: Fetch the object from the uri instead of the below:
// return this.Match(
// uri => new T { Id = uri }, // TODO: Fetch the object
// link => new T { Id = link.Href, Name = link.Name }, // TODO: Fetch the object
// obj => obj
// );
// }
//}
//public class ObjectOrLink : GenericObjectOrLink