resource_applications.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2013, Digium, Inc.
  5. *
  6. * David M. Lee, II <dlee@digium.com>
  7. *
  8. * See http://www.asterisk.org for more information about
  9. * the Asterisk project. Please do not directly contact
  10. * any of the maintainers of this project for assistance;
  11. * the project provides a web site, mailing lists and IRC
  12. * channels for your use.
  13. *
  14. * This program is free software, distributed under the terms of
  15. * the GNU General Public License Version 2. See the LICENSE file
  16. * at the top of the source tree.
  17. */
  18. /*! \file
  19. *
  20. * \brief Generated file - declares stubs to be implemented in
  21. * res/ari/resource_applications.c
  22. *
  23. * Stasis application resources
  24. *
  25. * \author David M. Lee, II <dlee@digium.com>
  26. */
  27. /*
  28. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  29. * !!!!! DO NOT EDIT !!!!!
  30. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  31. * This file is generated by a mustache template. Please see the original
  32. * template in rest-api-templates/ari_resource.h.mustache
  33. */
  34. #ifndef _ASTERISK_RESOURCE_APPLICATIONS_H
  35. #define _ASTERISK_RESOURCE_APPLICATIONS_H
  36. #include "asterisk/ari.h"
  37. /*! Argument struct for ast_ari_applications_list() */
  38. struct ast_ari_applications_list_args {
  39. };
  40. /*!
  41. * \brief List all applications.
  42. *
  43. * \param headers HTTP headers
  44. * \param args Swagger parameters
  45. * \param[out] response HTTP response
  46. */
  47. void ast_ari_applications_list(struct ast_variable *headers, struct ast_ari_applications_list_args *args, struct ast_ari_response *response);
  48. /*! Argument struct for ast_ari_applications_get() */
  49. struct ast_ari_applications_get_args {
  50. /*! Application's name */
  51. const char *application_name;
  52. };
  53. /*!
  54. * \brief Get details of an application.
  55. *
  56. * \param headers HTTP headers
  57. * \param args Swagger parameters
  58. * \param[out] response HTTP response
  59. */
  60. void ast_ari_applications_get(struct ast_variable *headers, struct ast_ari_applications_get_args *args, struct ast_ari_response *response);
  61. /*! Argument struct for ast_ari_applications_subscribe() */
  62. struct ast_ari_applications_subscribe_args {
  63. /*! Application's name */
  64. const char *application_name;
  65. /*! Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName} */
  66. const char **event_source;
  67. /*! Length of event_source array. */
  68. size_t event_source_count;
  69. /*! Parsing context for event_source. */
  70. char *event_source_parse;
  71. };
  72. /*!
  73. * \brief Body parsing function for /applications/{applicationName}/subscription.
  74. * \param body The JSON body from which to parse parameters.
  75. * \param[out] args The args structure to parse into.
  76. * \retval zero on success
  77. * \retval non-zero on failure
  78. */
  79. int ast_ari_applications_subscribe_parse_body(
  80. struct ast_json *body,
  81. struct ast_ari_applications_subscribe_args *args);
  82. /*!
  83. * \brief Subscribe an application to a event source.
  84. *
  85. * Returns the state of the application after the subscriptions have changed
  86. *
  87. * \param headers HTTP headers
  88. * \param args Swagger parameters
  89. * \param[out] response HTTP response
  90. */
  91. void ast_ari_applications_subscribe(struct ast_variable *headers, struct ast_ari_applications_subscribe_args *args, struct ast_ari_response *response);
  92. /*! Argument struct for ast_ari_applications_unsubscribe() */
  93. struct ast_ari_applications_unsubscribe_args {
  94. /*! Application's name */
  95. const char *application_name;
  96. /*! Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName} */
  97. const char **event_source;
  98. /*! Length of event_source array. */
  99. size_t event_source_count;
  100. /*! Parsing context for event_source. */
  101. char *event_source_parse;
  102. };
  103. /*!
  104. * \brief Body parsing function for /applications/{applicationName}/subscription.
  105. * \param body The JSON body from which to parse parameters.
  106. * \param[out] args The args structure to parse into.
  107. * \retval zero on success
  108. * \retval non-zero on failure
  109. */
  110. int ast_ari_applications_unsubscribe_parse_body(
  111. struct ast_json *body,
  112. struct ast_ari_applications_unsubscribe_args *args);
  113. /*!
  114. * \brief Unsubscribe an application from an event source.
  115. *
  116. * Returns the state of the application after the subscriptions have changed
  117. *
  118. * \param headers HTTP headers
  119. * \param args Swagger parameters
  120. * \param[out] response HTTP response
  121. */
  122. void ast_ari_applications_unsubscribe(struct ast_variable *headers, struct ast_ari_applications_unsubscribe_args *args, struct ast_ari_response *response);
  123. #endif /* _ASTERISK_RESOURCE_APPLICATIONS_H */