package reddit_api_kernel
Source file thing_intf.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145open! Core_kernel module type S = sig type t [@@deriving sexp, bin_io] module Id : Id36.S include Json_object.S_with_fields with type t := t include Json_object.S_with_kind with type t := t val id : t -> Id.t end module type Thing = sig module type S = S module rec Comment : sig include S module Score : sig type t = | Score of int | Hidden [@@deriving sexp] end val body : t -> string val creation_time : t -> Time_ns.t val link : t -> Link.Id.t val permalink : t -> Uri.t val subreddit : t -> Subreddit_name.t val depth : t -> int option val score : t -> Score.t val replies : t -> [ `Comment of t | `More_comments of More_comments.t ] list val moderator_reports : t -> Moderator_report.t list end and User : sig include S val name : t -> Username.t val creation_time : t -> Time_ns.t val link_karma : t -> int val comment_karma : t -> int val awarder_karma : t -> int val awardee_karma : t -> int val total_karma : t -> int val subreddit : t -> Subreddit.t end and Link : sig include S val title : t -> string val url : t -> Uri.t option val permalink : t -> Uri.t val domain : t -> string val subreddit : t -> Subreddit_name.t val is_stickied : t -> bool val creation_time : t -> Time_ns.t val score : t -> int val moderator_reports : t -> Moderator_report.t list end and Message : sig include S end and Subreddit : sig include S val name : t -> Subreddit_name.t val title : t -> string val description : t -> string val subscribers : t -> int val active_users : t -> int val creation_time : t -> Time_ns.t end and Award : sig include S end and More_comments : sig include S module Details : sig module By_children : sig type t val children : t -> Comment.Id.t list end type t = | By_children of By_children.t | By_parent of Comment.Id.t end val count : t -> int val details : t -> Details.t end and Modmail_conversation : sig include S end module Fullname : sig type t = [ `Comment of Comment.Id.t | `User of User.Id.t | `Link of Link.Id.t | `Message of Message.Id.t | `Subreddit of Subreddit.Id.t | `Award of Award.Id.t | `More_comments of More_comments.Id.t | `Modmail_conversation of Modmail_conversation.Id.t ] [@@deriving sexp] include Identifiable.S with type t := t val to_string : [< t ] -> string val of_string : string -> [> t ] end module Poly : sig type t = [ `Comment of Comment.t | `User of User.t | `Link of Link.t | `Message of Message.t | `Subreddit of Subreddit.t | `Award of Award.t | `More_comments of More_comments.t | `Modmail_conversation of Modmail_conversation.t ] [@@deriving sexp] val of_json : Json.t -> [> t ] val fullname : [< t ] -> [> Fullname.t ] end end