Schema.hs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. {-# LANGUAGE TemplateHaskell #-}
  2. module Codec.ActivityStream.Schema where
  3. import Data.Aeson hiding (Object)
  4. import Data.Aeson.TH
  5. import Data.DateTime
  6. import Data.Text (Text)
  7. import Codec.ActivityStream.Internal
  8. import Codec.ActivityStream.Representation
  9. -- | The ActivityStreams Base Schema specification defines the
  10. -- following core verbs in addition to the default post verb that is
  11. -- defined in Section 6 of activitystreams:
  12. data SchemaVerb
  13. = Accept
  14. -- ^ Indicates that that the actor has accepted the object.
  15. -- For instance, a person accepting an award, or accepting an assignment.
  16. | Access
  17. -- ^ Indicates that the actor has accessed the object. For
  18. -- instance, a person accessing a room, or accessing a file.
  19. | Acknowledge
  20. -- ^ Indicates that the actor has acknowledged the object.
  21. -- This effectively signals that the actor is aware of the
  22. -- object's existence.
  23. | Add
  24. -- ^ Indicates that the actor has added the object to the target.
  25. -- For instance, adding a photo to an album.
  26. | Agree
  27. -- ^ Indicates that the actor agrees with the object. For example,
  28. -- a person agreeing with an argument, or expressing agreement
  29. -- with a particular issue.
  30. | Append
  31. -- ^ Indicates that the actor has appended the object to the
  32. -- target. For instance, a person appending a new record
  33. -- to a database.
  34. | Approve
  35. -- ^ Indicates that the actor has approved the object. For
  36. -- instance, a manager might approve a travel request.
  37. | Archive
  38. -- ^ Indicates that the actor has archived the object.
  39. | Assign
  40. -- ^ Indicates that the actor has assigned the object to the target.
  41. | At
  42. -- ^ Indicates that the actor is currently located at the object.
  43. -- For instance, a person being at a specific physical location.
  44. | Attach
  45. -- ^ Indicates that the actor has attached the object to the
  46. -- target. For instance, a person attaching a file to a wiki
  47. -- page or an email.
  48. | Attend
  49. -- ^ Indicates that the actor has attended the object. For
  50. -- instance, a person attending a meeting.
  51. | Author
  52. -- ^ Indicates that the actor has authored the object. Note that
  53. -- this is a more specific form of the verb \"create\".
  54. | Authorize
  55. -- ^ Indicates that the actor has authorized the object. If
  56. -- a target is specified, it means that the authorization is specifically
  57. -- in regards to the target. For instance, a service can authorize a
  58. -- person to access a given application; in which case the actor is
  59. -- the service, the object is the person, and the target is the
  60. -- application. In contrast, a person can authorize a request; in
  61. -- which case the actor is the person and the object is the request
  62. -- and there might be no explicit target.
  63. | Borrow
  64. -- ^ Indicates that the actor has borrowed the object. If a target
  65. -- is specified, it identifies the entity from which the object was
  66. -- borrowed. For instance, if a person borrows a book from a library,
  67. -- the person is the actor, the book is the object and the library is
  68. -- the target.
  69. | Build
  70. -- ^ Indicates that the actor has built the object. For example, if a
  71. -- person builds a model or compiles code.
  72. | Cancel
  73. -- ^ Indicates that the actor has canceled the object. For instance,
  74. -- canceling a calendar event.
  75. | Close
  76. -- ^ Indicates that the actor has closed the object. For instance, the
  77. -- object could represent a ticket being tracked in an issue management
  78. -- system.
  79. | Complete
  80. -- ^ Indicates that the actor has completed the object.
  81. | Confirm
  82. -- ^ Indicates that the actor has confirmed or agrees with the object.
  83. -- For instance, a software developer might confirm an issue reported
  84. -- against a product.
  85. | Consume
  86. -- ^ Indicates that the actor has consumed the object. The specific
  87. -- meaning is dependent largely on the object's type. For instance,
  88. -- an actor may \"consume\" an audio object, indicating that the actor
  89. -- has listened to it; or an actor may \"consume\" a book, indicating
  90. -- that the book has been read. As such, the \"consume\" verb is a
  91. -- more generic form of other more specific verbs such as \"read\" and
  92. -- \"play\".
  93. | Checkin
  94. -- ^ Indicates that the actor has checked-in to the object. For
  95. -- instance, a person checking-in to a Place.
  96. | Create
  97. -- ^ Indicates that the actor has created the object.
  98. | Delete
  99. -- ^ Indicates that the actor has deleted the object. This implies,
  100. -- but does not require, the permanent destruction of the object.
  101. | Deliver
  102. -- ^ Indicates that the actor has delivered the object. For example,
  103. -- delivering a package.
  104. | Deny
  105. -- ^ Indicates that the actor has denied the object. For example, a
  106. -- manager may deny a travel request.
  107. | Disagree
  108. -- ^ Indicates that the actor disagrees with the object.
  109. | Dislike
  110. -- ^ Indicates that the actor dislikes the object. Note that the
  111. -- \"dislike\" verb is distinct from the \"unlike\" verb which assumes
  112. -- that the object had been previously \"liked\".
  113. | Experience
  114. -- ^ Indicates that the actor has experienced the object in some
  115. -- manner. Note that, depending on the specific object types used for
  116. -- both the actor and object, the meaning of this verb can overlap
  117. -- that of the \"consume\" and \"play\" verbs. For instance, a person
  118. -- might \"experience\" a movie; or \"play\" the movie; or \"consume\"
  119. -- the movie. The \"experience\" verb can be considered a more generic
  120. -- form of other more specific verbs as \"consume\", \"play\", \"watch\",
  121. -- \"listen\", and \"read\"
  122. | Favorite
  123. -- ^ Indicates that the actor marked the object as an item of special
  124. -- interest.
  125. | Find
  126. -- ^ Indicates that the actor has found the object.
  127. | FlagAsInappropriate
  128. -- ^ Indicates that the actor has flagged the object as being
  129. -- inappropriate for some reason. When using this verb, the context
  130. -- property can be used to provide additional detail about why the
  131. -- object has been flagged.
  132. | Follow
  133. -- ^ Indicates that the actor began following the activity of the
  134. -- object. In most cases, the objectType will be a \"person\", but it
  135. -- can potentially be of any type that can sensibly generate activity.
  136. -- Processors MAY ignore (silently drop) successive identical \"follow\"
  137. -- activities.
  138. | Give -- ^ Indicates that the actor is giving an object to the
  139. -- target. Examples include one person giving a badge object to another
  140. -- person. The object identifies the object being given. The target
  141. -- identifies the receiver.
  142. | Host
  143. -- ^ Indicates that the actor is hosting the object. As in hosting
  144. -- an event, or hosting a service.
  145. | Ignore
  146. -- ^ Indicates that the actor has ignored the object. For
  147. -- instance, this verb may be used when an actor has ignored a friend
  148. -- request, in which case the object may be the request-friend activity.
  149. | Insert
  150. -- ^ Indicates that the actor has inserted the object into the target.
  151. | Install
  152. -- ^ Indicates that the actor has installed the object, as in installing
  153. -- an application.
  154. | Interact
  155. -- ^ Indicates that the actor has interacted with the object. For
  156. -- instance, when one person interacts with another.
  157. | Invite
  158. -- ^ Indicates that the actor has invited the object, typically a
  159. -- person object, to join or participate in the object described
  160. -- by the target. The target could, for instance, be an event,
  161. -- group or a service.
  162. | Join
  163. -- ^ Indicates that the actor has become a member of the
  164. -- object. This specification only defines the meaning of this
  165. -- verb when the object of the Activity has an objectType of
  166. -- group, though implementors need to be prepared to handle other
  167. -- types of objects.
  168. | Leave
  169. -- ^ Indicates that the actor has left the object. For instance, a
  170. -- Person leaving a Group or checking-out of a Place.
  171. | Like
  172. -- ^ Indicates that the actor marked the object as an item of
  173. -- special interest. The \"like\" verb is considered to be an alias
  174. -- of \"favorite\". The two verb are semantically identical.
  175. | Listen
  176. -- ^ Indicates that the actor has listened to the object. This is
  177. -- typically only applicable for objects representing audio
  178. -- content, such as music, an audio-book, or a radio
  179. -- broadcast. The \"listen\" verb is a more specific form of the
  180. -- \"consume\", \"experience\" and \"play\" verbs.
  181. | Lose
  182. -- ^ Indicates that the actor has lost the object. For instance,
  183. -- if a person loses a game.
  184. | MakeFriend
  185. -- ^ Indicates the creation of a friendship that is reciprocated
  186. -- by the object. Since this verb implies an activity on the part
  187. -- of its object, processors MUST NOT accept activities with this
  188. -- verb unless they are able to verify through some external means
  189. -- that there is in fact a reciprocated connection. For example, a
  190. -- processor may have received a guarantee from a particular
  191. -- publisher that the publisher will only use this Verb in cases
  192. -- where a reciprocal relationship exists.
  193. | Open
  194. -- ^ Indicates that the actor has opened the object. For instance,
  195. -- the object could represent a ticket being tracked in an issue
  196. -- management system.
  197. | Play
  198. -- ^ Indicates that the actor spent some time enjoying the
  199. -- object. For example, if the object is a video this indicates
  200. -- that the subject watched all or part of the video. The \"play\"
  201. -- verb is a more specific form of the \"consume\" verb.
  202. | Post
  203. -- ^ The default action.
  204. | Present
  205. -- ^ Indicates that the actor has presented the object. For
  206. -- instance, when a person gives a presentation at a conference.
  207. | Purchase
  208. -- ^ Indicates that the actor has purchased the object. If a
  209. -- target is specified, in indicates the entity from which the
  210. -- object was purchased.
  211. | Qualify
  212. -- ^ Indicates that the actor has qualified for the object. If a
  213. -- target is specified, it indicates the context within which the
  214. -- qualification applies.
  215. | Read
  216. -- ^ Indicates that the actor read the object. This is typically
  217. -- only applicable for objects representing printed or written
  218. -- content, such as a book, a message or a comment. The \"read\"
  219. -- verb is a more specific form of the \"consume\", \"experience\" and
  220. -- \"play\" verbs.
  221. | Receive
  222. -- ^ Indicates that the actor is receiving an object. Examples
  223. -- include a person receiving a badge object. The object
  224. -- identifies the object being received.
  225. | Reject
  226. -- ^ Indicates that the actor has rejected the object.
  227. | Remove
  228. -- ^ Indicates that the actor has removed the object from the target.
  229. | RemoveFriend
  230. -- ^ Indicates that the actor has removed the object from the
  231. -- collection of friends.
  232. | Replace
  233. -- ^ Indicates that the actor has replaced the target with the object.
  234. | Request
  235. -- ^ Indicates that the actor has requested the object. If a
  236. -- target is specified, it indicates the entity from which the
  237. -- object is being requested.
  238. | RequestFriend
  239. -- ^ Indicates the creation of a friendship that has not yet been
  240. -- reciprocated by the object.
  241. | Resolve
  242. -- ^ Indicates that the actor has resolved the object. For
  243. -- instance, the object could represent a ticket being tracked in
  244. -- an issue management system.
  245. | Return
  246. -- ^ Indicates that the actor has returned the object. If a target
  247. -- is specified, it indicates the entity to which the object was
  248. -- returned.
  249. | Retract
  250. -- ^ Indicates that the actor has retracted the object. For
  251. -- instance, if an actor wishes to retract a previously published
  252. -- activity, the object would be the previously published activity
  253. -- that is being retracted.
  254. | RsvpMaybe
  255. -- ^ The \"possible RSVP\" verb indicates that the actor has made a
  256. -- possible RSVP for the object. This specification only defines
  257. -- the meaning of this verb when its object is an event, though
  258. -- implementors need to be prepared to handle other object
  259. -- types. The use of this verb is only appropriate when the RSVP
  260. -- was created by an explicit action by the actor. It is not
  261. -- appropriate to use this verb when a user has been added as an
  262. -- attendee by an event organiser or administrator.
  263. | RsvpNo
  264. -- ^ The \"negative RSVP\" verb indicates that the actor has made a
  265. -- negative RSVP for the object. This specification only defines
  266. -- the meaning of this verb when its object is an event, though
  267. -- implementors need to be prepared to handle other object
  268. -- types. The use of this verb is only appropriate when the RSVP
  269. -- was created by an explicit action by the actor. It is not
  270. -- appropriate to use this verb when a user has been added as an
  271. -- attendee by an event organiser or administrator.
  272. | RsvpYes
  273. -- ^ The \"positive RSVP\" verb indicates that the actor has made a
  274. -- positive RSVP for an object. This specification only defines
  275. -- the meaning of this verb when its object is an event, though
  276. -- implementors need to be prepared to handle other object
  277. -- types. The use of this verb is only appropriate when the RSVP
  278. -- was created by an explicit action by the actor. It is not
  279. -- appropriate to use this verb when a user has been added as an
  280. -- attendee by an event organiser or administrator.
  281. | Satisfy
  282. -- ^ Indicates that the actor has satisfied the object. If a
  283. -- target is specified, it indicate the context within which the
  284. -- object was satisfied. For instance, if a person satisfies the
  285. -- requirements for a particular challenge, the person is the
  286. -- actor; the requirement is the object; and the challenge is the
  287. -- target.
  288. | Save
  289. -- ^ Indicates that the actor has called out the object as being
  290. -- of interest primarily to him- or herself. Though this action
  291. -- MAY be shared publicly, the implication is that the object has
  292. -- been saved primarily for the actor's own benefit rather than to
  293. -- show it to others as would be indicated by the \"share\" verb.
  294. | Schedule
  295. -- ^ Indicates that the actor has scheduled the object. For
  296. -- instance, scheduling a meeting.
  297. | Search
  298. -- ^ Indicates that the actor is or has searched for the
  299. -- object. If a target is specified, it indicates the context
  300. -- within which the search is or has been conducted.
  301. | Sell
  302. -- ^ Indicates that the actor has sold the object. If a target is
  303. -- specified, it indicates the entity to which the object was
  304. -- sold.
  305. | Send
  306. -- ^ Indicates that the actor has sent the object. If a target is
  307. -- specified, it indicates the entity to which the object was
  308. -- sent.
  309. | Share
  310. -- ^ Indicates that the actor has called out the object to
  311. -- readers. In most cases, the actor did not create the object
  312. -- being shared, but is instead drawing attention to it.
  313. | Sponsor
  314. -- ^ Indicates that the actor has sponsored the object. If a
  315. -- target is specified, it indicates the context within which the
  316. -- sponsorship is offered. For instance, a company can sponsor an
  317. -- event; or an individual can sponsor a project; etc.
  318. | Start
  319. -- ^ Indicates that the actor has started the object. For
  320. -- instance, when a person starts a project.
  321. | StopFollowing
  322. -- ^ Indicates that the actor has stopped following the object.
  323. | Submit
  324. -- ^ Indicates that the actor has submitted the object. If a
  325. -- target is specified, it indicates the entity to which the
  326. -- object was submitted.
  327. | Tag
  328. -- ^ Indicates that the actor has associated the object with the
  329. -- target. For example, if the actor specifies that a particular
  330. -- user appears in a photo. the object is the user and the target
  331. -- is the photo.
  332. | Terminate
  333. -- ^ Indicates that the actor has terminated the object.
  334. | Tie
  335. -- ^ Indicates that the actor has neither won or lost the
  336. -- object. This verb is generally only applicable when the object
  337. -- represents some form of competition, such as a game.
  338. | Unfavorite
  339. -- ^ Indicates that the actor has removed the object from the
  340. -- collection of favorited items.
  341. | Unlike
  342. -- ^ Indicates that the actor has removed the object from the
  343. -- collection of liked items.
  344. | Unsatisfy
  345. -- ^ Indicates that the actor has not satisfied the object. If a
  346. -- target is specified, it indicates the context within which the
  347. -- object was not satisfied. For instance, if a person fails to
  348. -- satisfy the requirements of some particular challenge, the
  349. -- person is the actor; the requirement is the object and the
  350. -- challenge is the target.
  351. | Unsave
  352. -- ^ Indicates that the actor has removed the object from the
  353. -- collection of saved items.
  354. | Unshare
  355. -- ^ Indicates that the actor is no longer sharing the object. If
  356. -- a target is specified, it indicates the entity with whom the
  357. -- object is no longer being shared.
  358. | Update
  359. -- ^ The \"update\" verb indicates that the actor has modified the
  360. -- object. Use of the \"update\" verb is generally reserved to
  361. -- indicate modifications to existing objects or data such as
  362. -- changing an existing user's profile information.
  363. | Use
  364. -- ^ Indicates that the actor has used the object in some manner.
  365. | Watch
  366. -- ^ Indicates that the actor has watched the object. This verb is
  367. -- typically applicable only when the object represents dynamic,
  368. -- visible content such as a movie, a television show or a public
  369. -- performance. This verb is a more specific form of the verbs
  370. -- \"experience\", \"play\" and \"consume\".
  371. | Win
  372. -- ^ Indicates that the actor has won the object. This verb is
  373. -- typically applicable only when the object represents some form
  374. -- of competition, such as a game.
  375. deriving (Eq, Show, Read)
  376. deriveJSON (commonOptsCC "") ''SchemaVerb
  377. -- | This data type contains the core set of common objectTypes in addition
  378. -- to the "activity" objectType defined in Section 7 of
  379. -- activitystreams.
  380. --
  381. -- All Activity Stream Objects inherit the same
  382. -- fundamental set of basic properties as defined in section 3.4 of
  383. -- activitystreams. In addition to these, objects of any specific type
  384. -- are permitted to introduce additional optional or required
  385. -- properties that are meaningful to objects of that type.
  386. data SchemaObjectType
  387. = Alert
  388. -- ^ Represents any kind of significant notification.
  389. | Application
  390. -- ^ Represents any kind of software application.
  391. | Article
  392. -- ^ Represents objects such as news articles, knowledge base
  393. -- entries, or other similar construct. Such objects generally
  394. -- consist of paragraphs of text, in some cases incorporating
  395. -- embedded media such as photos and inline hyperlinks to other
  396. -- resources.
  397. | Audio
  398. -- ^ Represents audio content of any kind. Objects of this type
  399. -- MAY contain an additional property as specified
  400. -- <https://github.com/activitystreams/activity-schema/blob/master/activity-schema.md#audio-video here>.
  401. | Badge
  402. -- ^ Represents a badge or award granted to an object (typically a
  403. -- @person@ object)
  404. | Binary
  405. -- ^ Objects of this type are used to carry arbirary
  406. -- Base64-encoded binary data within an Activity Stream object. It
  407. -- is primarily intended to attach binary data to other types of
  408. -- objects through the use of the @attachments@ property. Objects
  409. -- of this type will contain the additional properties specified
  410. -- <https://github.com/activitystreams/activity-schema/blob/master/activity-schema.md#binary here>.
  411. | Bookmark
  412. -- ^ Represents a pointer to some URL -- typically a web page. In
  413. -- most cases, bookmarks are specific to a given user and contain
  414. -- metadata chosen by that user. Bookmark Objects are similar in
  415. -- principle to the concept of bookmarks or favorites in a web
  416. -- browser. A bookmark represents a pointer to the URL, not the
  417. -- URL or the associated resource itself. Objects of this type
  418. -- SHOULD contain an additional @targetUrl@ property whose value
  419. -- is a String containing the IRI of the target of the bookmark.
  420. | Collection
  421. -- ^ Represents a generic collection of objects of any type. This
  422. -- object type can be used, for instance, to represent a
  423. -- collection of files like a folder; a collection of photos like
  424. -- an album; and so forth. Objects of this type MAY contain an
  425. -- additional @objectTypes@ property whose value is an Array of
  426. -- Strings specifying the expected objectType of objects contained
  427. -- within the collection.
  428. | Comment
  429. -- ^ Represents a textual response to another object. Objects of
  430. -- this type MAY contain an additional @inReplyTo@ property whose
  431. -- value is an Array of one or more other Activity Stream Objects
  432. -- for which the object is to be considered a response.
  433. | Device
  434. -- ^ Represents a device of any type.
  435. | Event
  436. -- ^ Represents an event that occurs at a certain location during
  437. -- a particular period of time. Objects of this type MAY contain
  438. -- the additional properties specified
  439. -- <https://github.com/activitystreams/activity-schema/blob/master/activity-schema.md#event here>.
  440. | File
  441. -- ^ Represents any form of document or file. Objects of this type
  442. -- MAY contain an additional @fileUrl@ property whose value a
  443. -- dereferenceable IRI that can be used to retrieve the file; and
  444. -- an additional @mimeType@ property whose value is the MIME type
  445. -- of the file described by the object.
  446. | Game
  447. -- ^ Represents a game or competition of any kind.
  448. | Group
  449. -- ^ Represents a grouping of objects in which member objects can
  450. -- join or leave. Objects of this type MAY contain the additional
  451. -- properties specified
  452. -- <https://github.com/activitystreams/activity-schema/blob/master/activity-schema.md#roleGroup here>.
  453. | Image
  454. -- ^ Represents a graphical image. Objects of this type MAY
  455. -- contain an additional @fullImage@ property whose value is an
  456. -- Activity Streams Media Link to a "full-sized" representation of
  457. -- the image.
  458. | Issue
  459. -- ^ Represents a report about a problem or situation that needs
  460. -- to be resolved. For instance, the @issue@ object can be used to
  461. -- represent reports detailing software defects, or reports of
  462. -- acceptable use violations, and so forth. Objects of this type
  463. -- MAY contain the additional properties specified
  464. -- <https://github.com/activitystreams/activity-schema/blob/master/activity-schema.md#issue here>.
  465. | Job
  466. -- ^ Represents information about a job or a job posting.
  467. | Note
  468. -- ^ Represents a short-form text message. This object is intended
  469. -- primarily for use in "micro-blogging" scenarios and in systems
  470. -- where users are invited to publish short, often plain-text
  471. -- messages whose useful lifespan is generally shorter than that
  472. -- of an article of weblog entry. A note is similar in structure
  473. -- to an article, but typically does not have a title or distinct
  474. -- paragraphs and tends to be much shorter in length.
  475. | Offer
  476. -- ^ Represents an offer of any kind.
  477. | Organization
  478. -- ^ Represents an organization of any kind.
  479. | Page
  480. -- ^ Represents an area, typically a web page, that is
  481. -- representative of, and generally managed by a particular
  482. -- entity. Such areas are usually dedicated to displaying
  483. -- descriptive information about the entity and showcasing recent
  484. -- content such as articles, photographs and videos. Most social
  485. -- networking applications, for example, provide individual users
  486. -- with their own dedicated "profile" pages. Several allow similar
  487. -- types of pages to be created for commercial entities,
  488. -- organizations or events. While the specific details of how
  489. -- pages are implemented, their characteristics and use may vary,
  490. -- the one unifying property is that they are typically "owned" by
  491. -- a single entity that is represented by the content provided by
  492. -- the page itself.
  493. | Permission
  494. -- ^ Represents a permission that can be granted to an
  495. -- individual. For instance, a person can be granted permission to
  496. -- modify a file. Objects of this type MAY contain the additional
  497. -- properties specified
  498. -- <https://github.com/activitystreams/activity-schema/blob/master/activity-schema.md#permissions here>.
  499. | Person
  500. -- ^ Represents an individual person.
  501. | Place
  502. -- ^ Represents a physical location. Locations can be represented
  503. -- using geographic coordinates, a physical address, a free-form
  504. -- location name, or any combination of these. Objects of this
  505. -- type MAY contain the additional properties specified
  506. -- <https://github.com/activitystreams/activity-schema/blob/master/activity-schema.md#place here>.
  507. | Process
  508. -- ^ Represents any form of process. For instance, a long-running
  509. -- task that is started and expected to continue operating for a
  510. -- period of time.
  511. | Product
  512. -- ^ Represents a commercial good or service. Objects of this type
  513. -- MAY contain an additional @fullImage@ property whose value is
  514. -- an Activity Streams Media Link to an image resource
  515. -- representative of the product.
  516. | Question
  517. -- ^ Represents a question or a poll. Objects of this type MAY
  518. -- contain an additional @options@ property whose value is an
  519. -- Array of possible answers to the question in the form of
  520. -- Activity Stream objects of any type.
  521. | Review
  522. -- ^ Represents a primarily prose-based commentary on another
  523. -- object. Objects of this type MAY contain a @rating@ property as
  524. -- specified
  525. -- <https://github.com/activitystreams/activity-schema/blob/master/activity-schema.md#rating-property here>.
  526. | Service
  527. -- ^ Represents any form of hosted or consumable service that
  528. -- performs some kind of work or benefit for other
  529. -- entities. Examples of such objects include websites,
  530. -- businesses, etc.
  531. | Task
  532. -- ^ Represents an activity that has yet to be completed. Objects
  533. -- of this type can contain additional properties as specified
  534. -- here.
  535. | Team
  536. -- ^ Represents a team of any type.
  537. | Video
  538. -- ^ Represents video content of any kind. Objects of this type
  539. -- MAY contain additional properties as specified here.
  540. deriving (Eq, Show, Read)
  541. deriveJSON (commonOptsCC "") ''SchemaObjectType
  542. type SchemaObject = Object SchemaObjectType
  543. type SchemaCollection = Collection SchemaObjectType
  544. data AVObj = AVObj
  545. { avEmbedCode :: Maybe Text
  546. , avStream :: Maybe MediaLink
  547. , avRest :: SchemaObject
  548. } deriving (Eq, Show)
  549. data BinaryObj = BinaryObj
  550. { bnCompression :: Maybe Text
  551. , bnData :: Maybe Text
  552. , bnFileUrl :: Maybe Text
  553. , bnLength :: Maybe Int
  554. , bnMd5 :: Maybe Text
  555. , bnMimeType :: Maybe Text
  556. , bnRest :: SchemaObject
  557. } deriving (Eq, Show)
  558. data EventObj = EventObj
  559. { evAttendedBy :: Maybe SchemaCollection
  560. , evAttending :: Maybe SchemaCollection
  561. , evEndTime :: Maybe DateTime
  562. , evInvited :: Maybe SchemaCollection
  563. , evMaybeAttending :: Maybe SchemaCollection
  564. , evNotAttendedBy :: Maybe SchemaCollection
  565. , evNotAttending :: Maybe SchemaCollection
  566. , evStartTime :: Maybe DateTime
  567. , evRest :: SchemaObject
  568. } deriving (Eq, Show)
  569. data IssueObj = IssueObj
  570. { isTypes :: Maybe [Text]
  571. , isRest :: SchemaObject
  572. } deriving (Eq, Show)
  573. data PlaceObj = PlaceObj
  574. { plPosition :: Maybe PlacePositionObj
  575. , plAddress :: Maybe PlaceAddressObj
  576. , plRest :: SchemaObject
  577. } deriving (Eq, Show)
  578. data PlacePositionObj = PlacePositionObj
  579. { ppAltitude :: Integer
  580. , ppLatitude :: Integer
  581. , ppLongitude :: Integer
  582. } deriving (Eq, Show)
  583. data PlaceAddressObj = PlaceAddressObj
  584. { paFormatted :: Text
  585. , paStreetAddress :: Text
  586. , paLocality :: Text
  587. , paRegion :: Text
  588. , paPostalCode :: Text
  589. , paCountry :: Text
  590. } deriving (Eq, Show)
  591. data TaskObj = TaskObj
  592. { tsActor :: Maybe SchemaObject
  593. , tsBy :: Maybe DateTime
  594. , tsObject :: Maybe SchemaObject
  595. , tsPrerequisites :: Maybe [TaskObj]
  596. , tsRequired :: Maybe Bool
  597. , tsSupersedes :: Maybe [TaskObj]
  598. , tsVerb :: Maybe SchemaVerb
  599. , tsRest :: SchemaObject
  600. } deriving (Eq, Show)