resource_device_states.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2012 - 2013, Digium, Inc.
  5. *
  6. * Kevin Harwell <kharwell@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_deviceStates.c
  22. *
  23. * Device state resources
  24. *
  25. * \author Kevin Harwell <kharwell@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_DEVICESTATES_H
  35. #define _ASTERISK_RESOURCE_DEVICESTATES_H
  36. #include "asterisk/ari.h"
  37. /*! Argument struct for ast_ari_device_states_list() */
  38. struct ast_ari_device_states_list_args {
  39. };
  40. /*!
  41. * \brief List all ARI controlled device states.
  42. *
  43. * \param headers HTTP headers
  44. * \param args Swagger parameters
  45. * \param[out] response HTTP response
  46. */
  47. void ast_ari_device_states_list(struct ast_variable *headers, struct ast_ari_device_states_list_args *args, struct ast_ari_response *response);
  48. /*! Argument struct for ast_ari_device_states_get() */
  49. struct ast_ari_device_states_get_args {
  50. /*! Name of the device */
  51. const char *device_name;
  52. };
  53. /*!
  54. * \brief Retrieve the current state of a device.
  55. *
  56. * \param headers HTTP headers
  57. * \param args Swagger parameters
  58. * \param[out] response HTTP response
  59. */
  60. void ast_ari_device_states_get(struct ast_variable *headers, struct ast_ari_device_states_get_args *args, struct ast_ari_response *response);
  61. /*! Argument struct for ast_ari_device_states_update() */
  62. struct ast_ari_device_states_update_args {
  63. /*! Name of the device */
  64. const char *device_name;
  65. /*! Device state value */
  66. const char *device_state;
  67. };
  68. /*!
  69. * \brief Body parsing function for /deviceStates/{deviceName}.
  70. * \param body The JSON body from which to parse parameters.
  71. * \param[out] args The args structure to parse into.
  72. * \retval zero on success
  73. * \retval non-zero on failure
  74. */
  75. int ast_ari_device_states_update_parse_body(
  76. struct ast_json *body,
  77. struct ast_ari_device_states_update_args *args);
  78. /*!
  79. * \brief Change the state of a device controlled by ARI. (Note - implicitly creates the device state).
  80. *
  81. * \param headers HTTP headers
  82. * \param args Swagger parameters
  83. * \param[out] response HTTP response
  84. */
  85. void ast_ari_device_states_update(struct ast_variable *headers, struct ast_ari_device_states_update_args *args, struct ast_ari_response *response);
  86. /*! Argument struct for ast_ari_device_states_delete() */
  87. struct ast_ari_device_states_delete_args {
  88. /*! Name of the device */
  89. const char *device_name;
  90. };
  91. /*!
  92. * \brief Destroy a device-state controlled by ARI.
  93. *
  94. * \param headers HTTP headers
  95. * \param args Swagger parameters
  96. * \param[out] response HTTP response
  97. */
  98. void ast_ari_device_states_delete(struct ast_variable *headers, struct ast_ari_device_states_delete_args *args, struct ast_ari_response *response);
  99. #endif /* _ASTERISK_RESOURCE_DEVICESTATES_H */