(** Attachments for JSON Feed items. An attachment represents an external resource related to a feed item, such as audio files for podcasts, video files, or other downloadable content. Attachments with identical titles indicate alternate formats of the same resource. @see JSON Feed Specification *) (** The type representing an attachment. *) type t (** {1 Construction} *) (** [create ~url ~mime_type ?title ?size_in_bytes ?duration_in_seconds ()] creates an attachment object. @param url The location of the attachment (required) @param mime_type The MIME type of the attachment, e.g. ["audio/mpeg"] (required) @param title The name of the attachment; identical titles indicate alternate formats of the same resource @param size_in_bytes The size of the attachment file in bytes @param duration_in_seconds The duration of the attachment in seconds (for audio/video) {b Examples:} {[ (* Simple attachment *) let att = Attachment.create ~url:"https://example.com/episode.mp3" ~mime_type:"audio/mpeg" () (* Podcast episode with metadata *) let att = Attachment.create ~url:"https://example.com/episode.mp3" ~mime_type:"audio/mpeg" ~title:"Episode 42" ~size_in_bytes:15_728_640L ~duration_in_seconds:1800 () (* Alternate format (same title indicates same content) *) let att2 = Attachment.create ~url:"https://example.com/episode.aac" ~mime_type:"audio/aac" ~title:"Episode 42" ~size_in_bytes:12_582_912L ~duration_in_seconds:1800 () ]} *) val create : url:string -> mime_type:string -> ?title:string -> ?size_in_bytes:int64 -> ?duration_in_seconds:int -> unit -> t (** {1 Accessors} *) (** [url t] returns the attachment's URL. *) val url : t -> string (** [mime_type t] returns the attachment's MIME type. *) val mime_type : t -> string (** [title t] returns the attachment's title, if set. *) val title : t -> string option (** [size_in_bytes t] returns the attachment's size in bytes, if set. *) val size_in_bytes : t -> int64 option (** [duration_in_seconds t] returns the attachment's duration, if set. *) val duration_in_seconds : t -> int option (** {1 Comparison} *) (** [equal a b] tests equality between two attachments. *) val equal : t -> t -> bool (** {1 Pretty Printing} *) (** [pp ppf t] pretty prints an attachment to the formatter. The output is human-readable and suitable for debugging. {b Example output:} {v episode.mp3 (audio/mpeg, 15.0 MB, 30m0s) v} *) val pp : Format.formatter -> t -> unit