PageRenderTime 101ms CodeModel.GetById 44ms RepoModel.GetById 8ms app.codeStats 0ms

/Code/Channels/Facebook/REST/IFacebookClient.cs

http://github.com/waseems/inbox2_desktop
C# | 110 lines | 98 code | 12 blank | 0 comment | 0 complexity | 341551d5fe1c9c7719c8afe01419a0bb MD5 | raw file
Possible License(s): BSD-3-Clause
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.ServiceModel;
  5. using System.ServiceModel.Web;
  6. using System.Xml.Linq;
  7. namespace Inbox2.Channels.Facebook.REST
  8. {
  9. [ServiceContract]
  10. [XmlSerializerFormat]
  11. public interface IFacebookClient
  12. {
  13. [OperationContract]
  14. [WebGet(
  15. BodyStyle = WebMessageBodyStyle.Bare,
  16. RequestFormat = WebMessageFormat.Xml,
  17. ResponseFormat = WebMessageFormat.Xml,
  18. UriTemplate = "?method=auth.createToken&api_key={api_key}&sig={signature}&v=1.0")]
  19. XElement CreateToken(string api_key, string signature);
  20. [OperationContract]
  21. [WebGet(
  22. BodyStyle = WebMessageBodyStyle.Bare,
  23. RequestFormat = WebMessageFormat.Xml,
  24. ResponseFormat = WebMessageFormat.Xml,
  25. UriTemplate = "?method=auth.getSession&api_key={api_key}&sig={signature}&v=1.0&auth_token={auth_token}")]
  26. XElement GetSession(string api_key, string signature, string auth_token);
  27. [OperationContract]
  28. [WebGet(
  29. BodyStyle = WebMessageBodyStyle.Bare,
  30. RequestFormat = WebMessageFormat.Xml,
  31. ResponseFormat = WebMessageFormat.Xml,
  32. UriTemplate = "?method=users.getloggedinuser&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0")]
  33. XElement GetLoggedInUser(string api_key, string session_key, string call_id, string signature);
  34. [OperationContract]
  35. [WebGet(
  36. BodyStyle = WebMessageBodyStyle.Bare,
  37. RequestFormat = WebMessageFormat.Xml,
  38. ResponseFormat = WebMessageFormat.Xml,
  39. UriTemplate = "?method=friends.get&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0")]
  40. XElement GetContacts(string api_key, string session_key, string call_id, string signature);
  41. [OperationContract]
  42. [WebGet(
  43. BodyStyle = WebMessageBodyStyle.Bare,
  44. RequestFormat = WebMessageFormat.Xml,
  45. ResponseFormat = WebMessageFormat.Xml,
  46. UriTemplate = "?method=users.getinfo&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&uids={uids}&fields={fields}")]
  47. XElement GetUserInfo(string api_key, string session_key, string call_id, string signature, string uids, string fields);
  48. [OperationContract]
  49. [WebGet(
  50. BodyStyle = WebMessageBodyStyle.Bare,
  51. RequestFormat = WebMessageFormat.Xml,
  52. ResponseFormat = WebMessageFormat.Xml,
  53. UriTemplate = "?method=notifications.get&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0")]
  54. XElement GetNotifications(string api_key, string session_key, string call_id, string signature);
  55. [OperationContract]
  56. [WebGet(
  57. BodyStyle = WebMessageBodyStyle.Bare,
  58. RequestFormat = WebMessageFormat.Xml,
  59. ResponseFormat = WebMessageFormat.Xml,
  60. UriTemplate = "?method=stream.get&api_key={api_key}&session_key={session_key}&call_id={call_id}&source_ids={source_ids}&sig={signature}&v=1.0&limit={limit}")]
  61. XElement GetStream(string api_key, string session_key, string call_id, string signature, string source_ids, string limit);
  62. [OperationContract]
  63. [WebGet(
  64. BodyStyle = WebMessageBodyStyle.Bare,
  65. RequestFormat = WebMessageFormat.Xml,
  66. ResponseFormat = WebMessageFormat.Xml,
  67. UriTemplate = "?method=fql.query&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&query={query}")]
  68. XElement ExecuteQuery(string api_key, string session_key, string call_id, string signature, string query);
  69. [OperationContract]
  70. [WebGet(
  71. BodyStyle = WebMessageBodyStyle.Bare,
  72. RequestFormat = WebMessageFormat.Xml,
  73. ResponseFormat = WebMessageFormat.Xml,
  74. UriTemplate = "?method=fql.multiquery&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&queries={queries}")]
  75. XElement ExecuteMultiQueries(string api_key, string session_key, string call_id, string signature, string queries);
  76. [OperationContract]
  77. [WebGet(
  78. BodyStyle = WebMessageBodyStyle.Bare,
  79. RequestFormat = WebMessageFormat.Xml,
  80. ResponseFormat = WebMessageFormat.Xml,
  81. UriTemplate = "?method=status.set&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&status={status}")]
  82. XElement SetStatus(string api_key, string session_key, string call_id, string signature, string status);
  83. [OperationContract]
  84. [WebGet(
  85. BodyStyle = WebMessageBodyStyle.Bare,
  86. RequestFormat = WebMessageFormat.Xml,
  87. ResponseFormat = WebMessageFormat.Xml,
  88. UriTemplate = "?method=stream.addcomment&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&post_id={post_id}&comment={comment}")]
  89. XElement AddComment(string api_key, string session_key, string call_id, string signature, string post_id, string comment);
  90. [OperationContract]
  91. [WebGet(
  92. BodyStyle = WebMessageBodyStyle.Bare,
  93. RequestFormat = WebMessageFormat.Xml,
  94. ResponseFormat = WebMessageFormat.Xml,
  95. UriTemplate = "?method=notifications.send&api_key={api_key}&session_key={session_key}&call_id={call_id}&sig={signature}&v=1.0&to_ids={to_ids}&notification={notification}")]
  96. XElement SendNotification(string api_key, string session_key, string call_id, string signature, string to_ids, string notification);
  97. }
  98. }