ari_resource.h.mustache 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. {{#api_declaration}}
  2. /*
  3. * Asterisk -- An open source telephony toolkit.
  4. *
  5. * {{{copyright}}}
  6. *
  7. * {{{author}}}
  8. *
  9. * See http://www.asterisk.org for more information about
  10. * the Asterisk project. Please do not directly contact
  11. * any of the maintainers of this project for assistance;
  12. * the project provides a web site, mailing lists and IRC
  13. * channels for your use.
  14. *
  15. * This program is free software, distributed under the terms of
  16. * the GNU General Public License Version 2. See the LICENSE file
  17. * at the top of the source tree.
  18. */
  19. /*! \file
  20. *
  21. * \brief Generated file - declares stubs to be implemented in
  22. * res/ari/resource_{{name}}.c
  23. *
  24. * {{{description}}}
  25. *
  26. * \author {{{author}}}
  27. */
  28. /*
  29. {{> do-not-edit}}
  30. * This file is generated by a mustache template. Please see the original
  31. * template in rest-api-templates/ari_resource.h.mustache
  32. */
  33. #ifndef _ASTERISK_RESOURCE_{{name_caps}}_H
  34. #define _ASTERISK_RESOURCE_{{name_caps}}_H
  35. #include "asterisk/ari.h"
  36. {{#apis}}
  37. {{#operations}}
  38. /*! Argument struct for ast_ari_{{c_name}}_{{c_nickname}}() */
  39. struct ast_ari_{{c_name}}_{{c_nickname}}_args {
  40. {{#parameters}}
  41. {{#description}}
  42. {{/description}}
  43. {{^allow_multiple}}
  44. {{#description}}
  45. /*! {{{description}}} */
  46. {{/description}}
  47. {{c_data_type}}{{c_space}}{{c_name}};
  48. {{/allow_multiple}}
  49. {{#allow_multiple}}
  50. /*! Array of {{{description}}} */
  51. {{c_data_type}}{{c_space}}*{{c_name}};
  52. /*! Length of {{c_name}} array. */
  53. size_t {{c_name}}_count;
  54. /*! Parsing context for {{c_name}}. */
  55. char *{{c_name}}_parse;
  56. {{/allow_multiple}}
  57. {{/parameters}}
  58. };
  59. {{#is_req}}
  60. {{#parse_body}}
  61. /*!
  62. * \brief Body parsing function for {{path}}.
  63. * \param body The JSON body from which to parse parameters.
  64. * \param[out] args The args structure to parse into.
  65. * \retval zero on success
  66. * \retval non-zero on failure
  67. */
  68. int ast_ari_{{c_name}}_{{c_nickname}}_parse_body(
  69. struct ast_json *body,
  70. struct ast_ari_{{c_name}}_{{c_nickname}}_args *args);
  71. {{/parse_body}}
  72. /*!
  73. * \brief {{{summary}}}
  74. {{#notes}}
  75. *
  76. * {{{notes}}}
  77. {{/notes}}
  78. *
  79. {{#is_binary_response}}
  80. * \param ser TCP/TLS session instance
  81. {{/is_binary_response}}
  82. * \param headers HTTP headers
  83. * \param args Swagger parameters
  84. * \param[out] response HTTP response
  85. */
  86. {{^is_binary_response}}
  87. void ast_ari_{{c_name}}_{{c_nickname}}(struct ast_variable *headers, struct ast_ari_{{c_name}}_{{c_nickname}}_args *args, struct ast_ari_response *response);
  88. {{/is_binary_response}}
  89. {{#is_binary_response}}
  90. void ast_ari_{{c_name}}_{{c_nickname}}(struct ast_tcptls_session_instance *ser, struct ast_variable *headers, struct ast_ari_{{c_name}}_{{c_nickname}}_args *args, struct ast_ari_response *response);
  91. {{/is_binary_response}}
  92. {{/is_req}}
  93. {{#is_websocket}}
  94. /*!
  95. * \brief {{{summary}}}
  96. {{#notes}}
  97. *
  98. * {{{notes}}}
  99. {{/notes}}
  100. *
  101. * \retval 0 success
  102. * \retval -1 error
  103. */
  104. int ast_ari_websocket_{{c_name}}_{{c_nickname}}_init(void);
  105. /*!
  106. * \brief {{{summary}}}
  107. {{#notes}}
  108. *
  109. * {{{notes}}}
  110. {{/notes}}
  111. */
  112. void ast_ari_websocket_{{c_name}}_{{c_nickname}}_dtor(void);
  113. /*!
  114. * \brief {{summary}}
  115. {{#notes}}
  116. *
  117. * {{{notes}}}
  118. {{/notes}}
  119. *
  120. * \param ser HTTP TCP/TLS Server Session
  121. * \param headers HTTP headers
  122. * \param args Swagger parameters
  123. * \param session_id The id of the current session.
  124. *
  125. * \retval 0 success
  126. * \retval non-zero error
  127. */
  128. int ast_ari_websocket_{{c_name}}_{{c_nickname}}_attempted(struct ast_tcptls_session_instance *ser,
  129. struct ast_variable *headers, struct ast_ari_{{c_name}}_{{c_nickname}}_args *args, const char *session_id);
  130. /*!
  131. * \brief {{summary}}
  132. {{#notes}}
  133. *
  134. * {{{notes}}}
  135. {{/notes}}
  136. *
  137. * \param session ARI WebSocket.
  138. * \param headers HTTP headers.
  139. * \param args Swagger parameters.
  140. */
  141. void ast_ari_websocket_{{c_name}}_{{c_nickname}}_established(struct ast_ari_websocket_session *session,
  142. struct ast_variable *headers, struct ast_ari_{{c_name}}_{{c_nickname}}_args *args);
  143. {{/is_websocket}}
  144. {{/operations}}
  145. {{/apis}}
  146. #endif /* _ASTERISK_RESOURCE_{{name_caps}}_H */
  147. {{/api_declaration}}