ari_resource.h.mustache 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. * \param headers HTTP headers
  80. * \param args Swagger parameters
  81. * \param[out] response HTTP response
  82. */
  83. 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);
  84. {{/is_req}}
  85. {{#is_websocket}}
  86. /*!
  87. * \brief {{summary}}
  88. {{#notes}}
  89. *
  90. * {{{notes}}}
  91. {{/notes}}
  92. *
  93. * \param session ARI WebSocket.
  94. * \param headers HTTP headers.
  95. * \param args Swagger parameters.
  96. */
  97. void ast_ari_websocket_{{c_name}}_{{c_nickname}}(struct ast_ari_websocket_session *session, struct ast_variable *headers, struct ast_ari_{{c_name}}_{{c_nickname}}_args *args);
  98. {{/is_websocket}}
  99. {{/operations}}
  100. {{/apis}}
  101. #endif /* _ASTERISK_RESOURCE_{{name_caps}}_H */
  102. {{/api_declaration}}