Asterisk - The Open Source Telephony Project  GIT-master-b7027de
ari_model_validators.c
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2013, Digium, Inc.
5  *
6  * See http://www.asterisk.org for more information about
7  * the Asterisk project. Please do not directly contact
8  * any of the maintainers of this project for assistance;
9  * the project provides a web site, mailing lists and IRC
10  * channels for your use.
11  *
12  * This program is free software, distributed under the terms of
13  * the GNU General Public License Version 2. See the LICENSE file
14  * at the top of the source tree.
15  */
16 
17 /*! \file
18  *
19  * \brief Generated file - Build validators for ARI model objects.
20  */
21 
22  /*
23  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24  * !!!!! DO NOT EDIT !!!!!
25  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26  * This file is generated by a mustache template. Please see the original
27  * template in rest-api-templates/ari_model_validators.c.mustache
28  */
29 
30 #include "asterisk.h"
31 
32 #include "asterisk/logger.h"
33 #include "asterisk/module.h"
34 #include "ari_model_validators.h"
35 
37 {
38  int res = 1;
39  struct ast_json_iter *iter;
40 
41  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
42  if (strcmp("build", ast_json_object_iter_key(iter)) == 0) {
43  int prop_is_valid;
44  prop_is_valid = ast_ari_validate_build_info(
46  if (!prop_is_valid) {
47  ast_log(LOG_ERROR, "ARI AsteriskInfo field build failed validation\n");
48  res = 0;
49  }
50  } else
51  if (strcmp("config", ast_json_object_iter_key(iter)) == 0) {
52  int prop_is_valid;
53  prop_is_valid = ast_ari_validate_config_info(
55  if (!prop_is_valid) {
56  ast_log(LOG_ERROR, "ARI AsteriskInfo field config failed validation\n");
57  res = 0;
58  }
59  } else
60  if (strcmp("status", ast_json_object_iter_key(iter)) == 0) {
61  int prop_is_valid;
62  prop_is_valid = ast_ari_validate_status_info(
64  if (!prop_is_valid) {
65  ast_log(LOG_ERROR, "ARI AsteriskInfo field status failed validation\n");
66  res = 0;
67  }
68  } else
69  if (strcmp("system", ast_json_object_iter_key(iter)) == 0) {
70  int prop_is_valid;
71  prop_is_valid = ast_ari_validate_system_info(
73  if (!prop_is_valid) {
74  ast_log(LOG_ERROR, "ARI AsteriskInfo field system failed validation\n");
75  res = 0;
76  }
77  } else
78  {
80  "ARI AsteriskInfo has undocumented field %s\n",
82  res = 0;
83  }
84  }
85 
86  return res;
87 }
88 
90 {
92 }
93 
95 {
96  int res = 1;
97  struct ast_json_iter *iter;
98  int has_asterisk_id = 0;
99  int has_ping = 0;
100  int has_timestamp = 0;
101 
102  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
103  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
104  int prop_is_valid;
105  has_asterisk_id = 1;
106  prop_is_valid = ast_ari_validate_string(
108  if (!prop_is_valid) {
109  ast_log(LOG_ERROR, "ARI AsteriskPing field asterisk_id failed validation\n");
110  res = 0;
111  }
112  } else
113  if (strcmp("ping", ast_json_object_iter_key(iter)) == 0) {
114  int prop_is_valid;
115  has_ping = 1;
116  prop_is_valid = ast_ari_validate_string(
118  if (!prop_is_valid) {
119  ast_log(LOG_ERROR, "ARI AsteriskPing field ping failed validation\n");
120  res = 0;
121  }
122  } else
123  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
124  int prop_is_valid;
125  has_timestamp = 1;
126  prop_is_valid = ast_ari_validate_string(
128  if (!prop_is_valid) {
129  ast_log(LOG_ERROR, "ARI AsteriskPing field timestamp failed validation\n");
130  res = 0;
131  }
132  } else
133  {
135  "ARI AsteriskPing has undocumented field %s\n",
137  res = 0;
138  }
139  }
140 
141  if (!has_asterisk_id) {
142  ast_log(LOG_ERROR, "ARI AsteriskPing missing required field asterisk_id\n");
143  res = 0;
144  }
145 
146  if (!has_ping) {
147  ast_log(LOG_ERROR, "ARI AsteriskPing missing required field ping\n");
148  res = 0;
149  }
150 
151  if (!has_timestamp) {
152  ast_log(LOG_ERROR, "ARI AsteriskPing missing required field timestamp\n");
153  res = 0;
154  }
155 
156  return res;
157 }
158 
160 {
162 }
163 
165 {
166  int res = 1;
167  struct ast_json_iter *iter;
168  int has_date = 0;
169  int has_kernel = 0;
170  int has_machine = 0;
171  int has_options = 0;
172  int has_os = 0;
173  int has_user = 0;
174 
175  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
176  if (strcmp("date", ast_json_object_iter_key(iter)) == 0) {
177  int prop_is_valid;
178  has_date = 1;
179  prop_is_valid = ast_ari_validate_string(
181  if (!prop_is_valid) {
182  ast_log(LOG_ERROR, "ARI BuildInfo field date failed validation\n");
183  res = 0;
184  }
185  } else
186  if (strcmp("kernel", ast_json_object_iter_key(iter)) == 0) {
187  int prop_is_valid;
188  has_kernel = 1;
189  prop_is_valid = ast_ari_validate_string(
191  if (!prop_is_valid) {
192  ast_log(LOG_ERROR, "ARI BuildInfo field kernel failed validation\n");
193  res = 0;
194  }
195  } else
196  if (strcmp("machine", ast_json_object_iter_key(iter)) == 0) {
197  int prop_is_valid;
198  has_machine = 1;
199  prop_is_valid = ast_ari_validate_string(
201  if (!prop_is_valid) {
202  ast_log(LOG_ERROR, "ARI BuildInfo field machine failed validation\n");
203  res = 0;
204  }
205  } else
206  if (strcmp("options", ast_json_object_iter_key(iter)) == 0) {
207  int prop_is_valid;
208  has_options = 1;
209  prop_is_valid = ast_ari_validate_string(
211  if (!prop_is_valid) {
212  ast_log(LOG_ERROR, "ARI BuildInfo field options failed validation\n");
213  res = 0;
214  }
215  } else
216  if (strcmp("os", ast_json_object_iter_key(iter)) == 0) {
217  int prop_is_valid;
218  has_os = 1;
219  prop_is_valid = ast_ari_validate_string(
221  if (!prop_is_valid) {
222  ast_log(LOG_ERROR, "ARI BuildInfo field os failed validation\n");
223  res = 0;
224  }
225  } else
226  if (strcmp("user", ast_json_object_iter_key(iter)) == 0) {
227  int prop_is_valid;
228  has_user = 1;
229  prop_is_valid = ast_ari_validate_string(
231  if (!prop_is_valid) {
232  ast_log(LOG_ERROR, "ARI BuildInfo field user failed validation\n");
233  res = 0;
234  }
235  } else
236  {
238  "ARI BuildInfo has undocumented field %s\n",
240  res = 0;
241  }
242  }
243 
244  if (!has_date) {
245  ast_log(LOG_ERROR, "ARI BuildInfo missing required field date\n");
246  res = 0;
247  }
248 
249  if (!has_kernel) {
250  ast_log(LOG_ERROR, "ARI BuildInfo missing required field kernel\n");
251  res = 0;
252  }
253 
254  if (!has_machine) {
255  ast_log(LOG_ERROR, "ARI BuildInfo missing required field machine\n");
256  res = 0;
257  }
258 
259  if (!has_options) {
260  ast_log(LOG_ERROR, "ARI BuildInfo missing required field options\n");
261  res = 0;
262  }
263 
264  if (!has_os) {
265  ast_log(LOG_ERROR, "ARI BuildInfo missing required field os\n");
266  res = 0;
267  }
268 
269  if (!has_user) {
270  ast_log(LOG_ERROR, "ARI BuildInfo missing required field user\n");
271  res = 0;
272  }
273 
274  return res;
275 }
276 
278 {
280 }
281 
283 {
284  int res = 1;
285  struct ast_json_iter *iter;
286  int has_default_language = 0;
287  int has_name = 0;
288  int has_setid = 0;
289 
290  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
291  if (strcmp("default_language", ast_json_object_iter_key(iter)) == 0) {
292  int prop_is_valid;
293  has_default_language = 1;
294  prop_is_valid = ast_ari_validate_string(
296  if (!prop_is_valid) {
297  ast_log(LOG_ERROR, "ARI ConfigInfo field default_language failed validation\n");
298  res = 0;
299  }
300  } else
301  if (strcmp("max_channels", ast_json_object_iter_key(iter)) == 0) {
302  int prop_is_valid;
303  prop_is_valid = ast_ari_validate_int(
305  if (!prop_is_valid) {
306  ast_log(LOG_ERROR, "ARI ConfigInfo field max_channels failed validation\n");
307  res = 0;
308  }
309  } else
310  if (strcmp("max_load", ast_json_object_iter_key(iter)) == 0) {
311  int prop_is_valid;
312  prop_is_valid = ast_ari_validate_double(
314  if (!prop_is_valid) {
315  ast_log(LOG_ERROR, "ARI ConfigInfo field max_load failed validation\n");
316  res = 0;
317  }
318  } else
319  if (strcmp("max_open_files", ast_json_object_iter_key(iter)) == 0) {
320  int prop_is_valid;
321  prop_is_valid = ast_ari_validate_int(
323  if (!prop_is_valid) {
324  ast_log(LOG_ERROR, "ARI ConfigInfo field max_open_files failed validation\n");
325  res = 0;
326  }
327  } else
328  if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
329  int prop_is_valid;
330  has_name = 1;
331  prop_is_valid = ast_ari_validate_string(
333  if (!prop_is_valid) {
334  ast_log(LOG_ERROR, "ARI ConfigInfo field name failed validation\n");
335  res = 0;
336  }
337  } else
338  if (strcmp("setid", ast_json_object_iter_key(iter)) == 0) {
339  int prop_is_valid;
340  has_setid = 1;
341  prop_is_valid = ast_ari_validate_set_id(
343  if (!prop_is_valid) {
344  ast_log(LOG_ERROR, "ARI ConfigInfo field setid failed validation\n");
345  res = 0;
346  }
347  } else
348  {
350  "ARI ConfigInfo has undocumented field %s\n",
352  res = 0;
353  }
354  }
355 
356  if (!has_default_language) {
357  ast_log(LOG_ERROR, "ARI ConfigInfo missing required field default_language\n");
358  res = 0;
359  }
360 
361  if (!has_name) {
362  ast_log(LOG_ERROR, "ARI ConfigInfo missing required field name\n");
363  res = 0;
364  }
365 
366  if (!has_setid) {
367  ast_log(LOG_ERROR, "ARI ConfigInfo missing required field setid\n");
368  res = 0;
369  }
370 
371  return res;
372 }
373 
375 {
377 }
378 
380 {
381  int res = 1;
382  struct ast_json_iter *iter;
383  int has_attribute = 0;
384  int has_value = 0;
385 
386  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
387  if (strcmp("attribute", ast_json_object_iter_key(iter)) == 0) {
388  int prop_is_valid;
389  has_attribute = 1;
390  prop_is_valid = ast_ari_validate_string(
392  if (!prop_is_valid) {
393  ast_log(LOG_ERROR, "ARI ConfigTuple field attribute failed validation\n");
394  res = 0;
395  }
396  } else
397  if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
398  int prop_is_valid;
399  has_value = 1;
400  prop_is_valid = ast_ari_validate_string(
402  if (!prop_is_valid) {
403  ast_log(LOG_ERROR, "ARI ConfigTuple field value failed validation\n");
404  res = 0;
405  }
406  } else
407  {
409  "ARI ConfigTuple has undocumented field %s\n",
411  res = 0;
412  }
413  }
414 
415  if (!has_attribute) {
416  ast_log(LOG_ERROR, "ARI ConfigTuple missing required field attribute\n");
417  res = 0;
418  }
419 
420  if (!has_value) {
421  ast_log(LOG_ERROR, "ARI ConfigTuple missing required field value\n");
422  res = 0;
423  }
424 
425  return res;
426 }
427 
429 {
431 }
432 
434 {
435  int res = 1;
436  struct ast_json_iter *iter;
437  int has_channel = 0;
438  int has_configuration = 0;
439  int has_status = 0;
440  int has_type = 0;
441 
442  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
443  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
444  int prop_is_valid;
445  has_channel = 1;
446  prop_is_valid = ast_ari_validate_string(
448  if (!prop_is_valid) {
449  ast_log(LOG_ERROR, "ARI LogChannel field channel failed validation\n");
450  res = 0;
451  }
452  } else
453  if (strcmp("configuration", ast_json_object_iter_key(iter)) == 0) {
454  int prop_is_valid;
455  has_configuration = 1;
456  prop_is_valid = ast_ari_validate_string(
458  if (!prop_is_valid) {
459  ast_log(LOG_ERROR, "ARI LogChannel field configuration failed validation\n");
460  res = 0;
461  }
462  } else
463  if (strcmp("status", ast_json_object_iter_key(iter)) == 0) {
464  int prop_is_valid;
465  has_status = 1;
466  prop_is_valid = ast_ari_validate_string(
468  if (!prop_is_valid) {
469  ast_log(LOG_ERROR, "ARI LogChannel field status failed validation\n");
470  res = 0;
471  }
472  } else
473  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
474  int prop_is_valid;
475  has_type = 1;
476  prop_is_valid = ast_ari_validate_string(
478  if (!prop_is_valid) {
479  ast_log(LOG_ERROR, "ARI LogChannel field type failed validation\n");
480  res = 0;
481  }
482  } else
483  {
485  "ARI LogChannel has undocumented field %s\n",
487  res = 0;
488  }
489  }
490 
491  if (!has_channel) {
492  ast_log(LOG_ERROR, "ARI LogChannel missing required field channel\n");
493  res = 0;
494  }
495 
496  if (!has_configuration) {
497  ast_log(LOG_ERROR, "ARI LogChannel missing required field configuration\n");
498  res = 0;
499  }
500 
501  if (!has_status) {
502  ast_log(LOG_ERROR, "ARI LogChannel missing required field status\n");
503  res = 0;
504  }
505 
506  if (!has_type) {
507  ast_log(LOG_ERROR, "ARI LogChannel missing required field type\n");
508  res = 0;
509  }
510 
511  return res;
512 }
513 
515 {
517 }
518 
520 {
521  int res = 1;
522  struct ast_json_iter *iter;
523  int has_description = 0;
524  int has_name = 0;
525  int has_status = 0;
526  int has_support_level = 0;
527  int has_use_count = 0;
528 
529  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
530  if (strcmp("description", ast_json_object_iter_key(iter)) == 0) {
531  int prop_is_valid;
532  has_description = 1;
533  prop_is_valid = ast_ari_validate_string(
535  if (!prop_is_valid) {
536  ast_log(LOG_ERROR, "ARI Module field description failed validation\n");
537  res = 0;
538  }
539  } else
540  if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
541  int prop_is_valid;
542  has_name = 1;
543  prop_is_valid = ast_ari_validate_string(
545  if (!prop_is_valid) {
546  ast_log(LOG_ERROR, "ARI Module field name failed validation\n");
547  res = 0;
548  }
549  } else
550  if (strcmp("status", ast_json_object_iter_key(iter)) == 0) {
551  int prop_is_valid;
552  has_status = 1;
553  prop_is_valid = ast_ari_validate_string(
555  if (!prop_is_valid) {
556  ast_log(LOG_ERROR, "ARI Module field status failed validation\n");
557  res = 0;
558  }
559  } else
560  if (strcmp("support_level", ast_json_object_iter_key(iter)) == 0) {
561  int prop_is_valid;
562  has_support_level = 1;
563  prop_is_valid = ast_ari_validate_string(
565  if (!prop_is_valid) {
566  ast_log(LOG_ERROR, "ARI Module field support_level failed validation\n");
567  res = 0;
568  }
569  } else
570  if (strcmp("use_count", ast_json_object_iter_key(iter)) == 0) {
571  int prop_is_valid;
572  has_use_count = 1;
573  prop_is_valid = ast_ari_validate_int(
575  if (!prop_is_valid) {
576  ast_log(LOG_ERROR, "ARI Module field use_count failed validation\n");
577  res = 0;
578  }
579  } else
580  {
582  "ARI Module has undocumented field %s\n",
584  res = 0;
585  }
586  }
587 
588  if (!has_description) {
589  ast_log(LOG_ERROR, "ARI Module missing required field description\n");
590  res = 0;
591  }
592 
593  if (!has_name) {
594  ast_log(LOG_ERROR, "ARI Module missing required field name\n");
595  res = 0;
596  }
597 
598  if (!has_status) {
599  ast_log(LOG_ERROR, "ARI Module missing required field status\n");
600  res = 0;
601  }
602 
603  if (!has_support_level) {
604  ast_log(LOG_ERROR, "ARI Module missing required field support_level\n");
605  res = 0;
606  }
607 
608  if (!has_use_count) {
609  ast_log(LOG_ERROR, "ARI Module missing required field use_count\n");
610  res = 0;
611  }
612 
613  return res;
614 }
615 
617 {
619 }
620 
622 {
623  int res = 1;
624  struct ast_json_iter *iter;
625  int has_group = 0;
626  int has_user = 0;
627 
628  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
629  if (strcmp("group", ast_json_object_iter_key(iter)) == 0) {
630  int prop_is_valid;
631  has_group = 1;
632  prop_is_valid = ast_ari_validate_string(
634  if (!prop_is_valid) {
635  ast_log(LOG_ERROR, "ARI SetId field group failed validation\n");
636  res = 0;
637  }
638  } else
639  if (strcmp("user", ast_json_object_iter_key(iter)) == 0) {
640  int prop_is_valid;
641  has_user = 1;
642  prop_is_valid = ast_ari_validate_string(
644  if (!prop_is_valid) {
645  ast_log(LOG_ERROR, "ARI SetId field user failed validation\n");
646  res = 0;
647  }
648  } else
649  {
651  "ARI SetId has undocumented field %s\n",
653  res = 0;
654  }
655  }
656 
657  if (!has_group) {
658  ast_log(LOG_ERROR, "ARI SetId missing required field group\n");
659  res = 0;
660  }
661 
662  if (!has_user) {
663  ast_log(LOG_ERROR, "ARI SetId missing required field user\n");
664  res = 0;
665  }
666 
667  return res;
668 }
669 
671 {
673 }
674 
676 {
677  int res = 1;
678  struct ast_json_iter *iter;
679  int has_last_reload_time = 0;
680  int has_startup_time = 0;
681 
682  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
683  if (strcmp("last_reload_time", ast_json_object_iter_key(iter)) == 0) {
684  int prop_is_valid;
685  has_last_reload_time = 1;
686  prop_is_valid = ast_ari_validate_date(
688  if (!prop_is_valid) {
689  ast_log(LOG_ERROR, "ARI StatusInfo field last_reload_time failed validation\n");
690  res = 0;
691  }
692  } else
693  if (strcmp("startup_time", ast_json_object_iter_key(iter)) == 0) {
694  int prop_is_valid;
695  has_startup_time = 1;
696  prop_is_valid = ast_ari_validate_date(
698  if (!prop_is_valid) {
699  ast_log(LOG_ERROR, "ARI StatusInfo field startup_time failed validation\n");
700  res = 0;
701  }
702  } else
703  {
705  "ARI StatusInfo has undocumented field %s\n",
707  res = 0;
708  }
709  }
710 
711  if (!has_last_reload_time) {
712  ast_log(LOG_ERROR, "ARI StatusInfo missing required field last_reload_time\n");
713  res = 0;
714  }
715 
716  if (!has_startup_time) {
717  ast_log(LOG_ERROR, "ARI StatusInfo missing required field startup_time\n");
718  res = 0;
719  }
720 
721  return res;
722 }
723 
725 {
727 }
728 
730 {
731  int res = 1;
732  struct ast_json_iter *iter;
733  int has_entity_id = 0;
734  int has_version = 0;
735 
736  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
737  if (strcmp("entity_id", ast_json_object_iter_key(iter)) == 0) {
738  int prop_is_valid;
739  has_entity_id = 1;
740  prop_is_valid = ast_ari_validate_string(
742  if (!prop_is_valid) {
743  ast_log(LOG_ERROR, "ARI SystemInfo field entity_id failed validation\n");
744  res = 0;
745  }
746  } else
747  if (strcmp("version", ast_json_object_iter_key(iter)) == 0) {
748  int prop_is_valid;
749  has_version = 1;
750  prop_is_valid = ast_ari_validate_string(
752  if (!prop_is_valid) {
753  ast_log(LOG_ERROR, "ARI SystemInfo field version failed validation\n");
754  res = 0;
755  }
756  } else
757  {
759  "ARI SystemInfo has undocumented field %s\n",
761  res = 0;
762  }
763  }
764 
765  if (!has_entity_id) {
766  ast_log(LOG_ERROR, "ARI SystemInfo missing required field entity_id\n");
767  res = 0;
768  }
769 
770  if (!has_version) {
771  ast_log(LOG_ERROR, "ARI SystemInfo missing required field version\n");
772  res = 0;
773  }
774 
775  return res;
776 }
777 
779 {
781 }
782 
784 {
785  int res = 1;
786  struct ast_json_iter *iter;
787  int has_value = 0;
788 
789  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
790  if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
791  int prop_is_valid;
792  has_value = 1;
793  prop_is_valid = ast_ari_validate_string(
795  if (!prop_is_valid) {
796  ast_log(LOG_ERROR, "ARI Variable field value failed validation\n");
797  res = 0;
798  }
799  } else
800  {
802  "ARI Variable has undocumented field %s\n",
804  res = 0;
805  }
806  }
807 
808  if (!has_value) {
809  ast_log(LOG_ERROR, "ARI Variable missing required field value\n");
810  res = 0;
811  }
812 
813  return res;
814 }
815 
817 {
819 }
820 
822 {
823  int res = 1;
824  struct ast_json_iter *iter;
825  int has_channel_ids = 0;
826  int has_resource = 0;
827  int has_technology = 0;
828 
829  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
830  if (strcmp("channel_ids", ast_json_object_iter_key(iter)) == 0) {
831  int prop_is_valid;
832  has_channel_ids = 1;
833  prop_is_valid = ast_ari_validate_list(
836  if (!prop_is_valid) {
837  ast_log(LOG_ERROR, "ARI Endpoint field channel_ids failed validation\n");
838  res = 0;
839  }
840  } else
841  if (strcmp("resource", ast_json_object_iter_key(iter)) == 0) {
842  int prop_is_valid;
843  has_resource = 1;
844  prop_is_valid = ast_ari_validate_string(
846  if (!prop_is_valid) {
847  ast_log(LOG_ERROR, "ARI Endpoint field resource failed validation\n");
848  res = 0;
849  }
850  } else
851  if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
852  int prop_is_valid;
853  prop_is_valid = ast_ari_validate_string(
855  if (!prop_is_valid) {
856  ast_log(LOG_ERROR, "ARI Endpoint field state failed validation\n");
857  res = 0;
858  }
859  } else
860  if (strcmp("technology", ast_json_object_iter_key(iter)) == 0) {
861  int prop_is_valid;
862  has_technology = 1;
863  prop_is_valid = ast_ari_validate_string(
865  if (!prop_is_valid) {
866  ast_log(LOG_ERROR, "ARI Endpoint field technology failed validation\n");
867  res = 0;
868  }
869  } else
870  {
872  "ARI Endpoint has undocumented field %s\n",
874  res = 0;
875  }
876  }
877 
878  if (!has_channel_ids) {
879  ast_log(LOG_ERROR, "ARI Endpoint missing required field channel_ids\n");
880  res = 0;
881  }
882 
883  if (!has_resource) {
884  ast_log(LOG_ERROR, "ARI Endpoint missing required field resource\n");
885  res = 0;
886  }
887 
888  if (!has_technology) {
889  ast_log(LOG_ERROR, "ARI Endpoint missing required field technology\n");
890  res = 0;
891  }
892 
893  return res;
894 }
895 
897 {
899 }
900 
902 {
903  int res = 1;
904  struct ast_json_iter *iter;
905  int has_body = 0;
906  int has_from = 0;
907  int has_to = 0;
908 
909  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
910  if (strcmp("body", ast_json_object_iter_key(iter)) == 0) {
911  int prop_is_valid;
912  has_body = 1;
913  prop_is_valid = ast_ari_validate_string(
915  if (!prop_is_valid) {
916  ast_log(LOG_ERROR, "ARI TextMessage field body failed validation\n");
917  res = 0;
918  }
919  } else
920  if (strcmp("from", ast_json_object_iter_key(iter)) == 0) {
921  int prop_is_valid;
922  has_from = 1;
923  prop_is_valid = ast_ari_validate_string(
925  if (!prop_is_valid) {
926  ast_log(LOG_ERROR, "ARI TextMessage field from failed validation\n");
927  res = 0;
928  }
929  } else
930  if (strcmp("to", ast_json_object_iter_key(iter)) == 0) {
931  int prop_is_valid;
932  has_to = 1;
933  prop_is_valid = ast_ari_validate_string(
935  if (!prop_is_valid) {
936  ast_log(LOG_ERROR, "ARI TextMessage field to failed validation\n");
937  res = 0;
938  }
939  } else
940  if (strcmp("variables", ast_json_object_iter_key(iter)) == 0) {
941  int prop_is_valid;
942  prop_is_valid = ast_ari_validate_object(
944  if (!prop_is_valid) {
945  ast_log(LOG_ERROR, "ARI TextMessage field variables failed validation\n");
946  res = 0;
947  }
948  } else
949  {
951  "ARI TextMessage has undocumented field %s\n",
953  res = 0;
954  }
955  }
956 
957  if (!has_body) {
958  ast_log(LOG_ERROR, "ARI TextMessage missing required field body\n");
959  res = 0;
960  }
961 
962  if (!has_from) {
963  ast_log(LOG_ERROR, "ARI TextMessage missing required field from\n");
964  res = 0;
965  }
966 
967  if (!has_to) {
968  ast_log(LOG_ERROR, "ARI TextMessage missing required field to\n");
969  res = 0;
970  }
971 
972  return res;
973 }
974 
976 {
978 }
979 
981 {
982  int res = 1;
983  struct ast_json_iter *iter;
984  int has_name = 0;
985  int has_number = 0;
986 
987  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
988  if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
989  int prop_is_valid;
990  has_name = 1;
991  prop_is_valid = ast_ari_validate_string(
993  if (!prop_is_valid) {
994  ast_log(LOG_ERROR, "ARI CallerID field name failed validation\n");
995  res = 0;
996  }
997  } else
998  if (strcmp("number", ast_json_object_iter_key(iter)) == 0) {
999  int prop_is_valid;
1000  has_number = 1;
1001  prop_is_valid = ast_ari_validate_string(
1003  if (!prop_is_valid) {
1004  ast_log(LOG_ERROR, "ARI CallerID field number failed validation\n");
1005  res = 0;
1006  }
1007  } else
1008  {
1010  "ARI CallerID has undocumented field %s\n",
1011  ast_json_object_iter_key(iter));
1012  res = 0;
1013  }
1014  }
1015 
1016  if (!has_name) {
1017  ast_log(LOG_ERROR, "ARI CallerID missing required field name\n");
1018  res = 0;
1019  }
1020 
1021  if (!has_number) {
1022  ast_log(LOG_ERROR, "ARI CallerID missing required field number\n");
1023  res = 0;
1024  }
1025 
1026  return res;
1027 }
1028 
1030 {
1032 }
1033 
1035 {
1036  int res = 1;
1037  struct ast_json_iter *iter;
1038  int has_accountcode = 0;
1039  int has_caller = 0;
1040  int has_connected = 0;
1041  int has_creationtime = 0;
1042  int has_dialplan = 0;
1043  int has_id = 0;
1044  int has_language = 0;
1045  int has_name = 0;
1046  int has_state = 0;
1047 
1048  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1049  if (strcmp("accountcode", ast_json_object_iter_key(iter)) == 0) {
1050  int prop_is_valid;
1051  has_accountcode = 1;
1052  prop_is_valid = ast_ari_validate_string(
1054  if (!prop_is_valid) {
1055  ast_log(LOG_ERROR, "ARI Channel field accountcode failed validation\n");
1056  res = 0;
1057  }
1058  } else
1059  if (strcmp("caller", ast_json_object_iter_key(iter)) == 0) {
1060  int prop_is_valid;
1061  has_caller = 1;
1062  prop_is_valid = ast_ari_validate_caller_id(
1064  if (!prop_is_valid) {
1065  ast_log(LOG_ERROR, "ARI Channel field caller failed validation\n");
1066  res = 0;
1067  }
1068  } else
1069  if (strcmp("channelvars", ast_json_object_iter_key(iter)) == 0) {
1070  int prop_is_valid;
1071  prop_is_valid = ast_ari_validate_object(
1073  if (!prop_is_valid) {
1074  ast_log(LOG_ERROR, "ARI Channel field channelvars failed validation\n");
1075  res = 0;
1076  }
1077  } else
1078  if (strcmp("connected", ast_json_object_iter_key(iter)) == 0) {
1079  int prop_is_valid;
1080  has_connected = 1;
1081  prop_is_valid = ast_ari_validate_caller_id(
1083  if (!prop_is_valid) {
1084  ast_log(LOG_ERROR, "ARI Channel field connected failed validation\n");
1085  res = 0;
1086  }
1087  } else
1088  if (strcmp("creationtime", ast_json_object_iter_key(iter)) == 0) {
1089  int prop_is_valid;
1090  has_creationtime = 1;
1091  prop_is_valid = ast_ari_validate_date(
1093  if (!prop_is_valid) {
1094  ast_log(LOG_ERROR, "ARI Channel field creationtime failed validation\n");
1095  res = 0;
1096  }
1097  } else
1098  if (strcmp("dialplan", ast_json_object_iter_key(iter)) == 0) {
1099  int prop_is_valid;
1100  has_dialplan = 1;
1101  prop_is_valid = ast_ari_validate_dialplan_cep(
1103  if (!prop_is_valid) {
1104  ast_log(LOG_ERROR, "ARI Channel field dialplan failed validation\n");
1105  res = 0;
1106  }
1107  } else
1108  if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
1109  int prop_is_valid;
1110  has_id = 1;
1111  prop_is_valid = ast_ari_validate_string(
1113  if (!prop_is_valid) {
1114  ast_log(LOG_ERROR, "ARI Channel field id failed validation\n");
1115  res = 0;
1116  }
1117  } else
1118  if (strcmp("language", ast_json_object_iter_key(iter)) == 0) {
1119  int prop_is_valid;
1120  has_language = 1;
1121  prop_is_valid = ast_ari_validate_string(
1123  if (!prop_is_valid) {
1124  ast_log(LOG_ERROR, "ARI Channel field language failed validation\n");
1125  res = 0;
1126  }
1127  } else
1128  if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
1129  int prop_is_valid;
1130  has_name = 1;
1131  prop_is_valid = ast_ari_validate_string(
1133  if (!prop_is_valid) {
1134  ast_log(LOG_ERROR, "ARI Channel field name failed validation\n");
1135  res = 0;
1136  }
1137  } else
1138  if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
1139  int prop_is_valid;
1140  has_state = 1;
1141  prop_is_valid = ast_ari_validate_string(
1143  if (!prop_is_valid) {
1144  ast_log(LOG_ERROR, "ARI Channel field state failed validation\n");
1145  res = 0;
1146  }
1147  } else
1148  {
1150  "ARI Channel has undocumented field %s\n",
1151  ast_json_object_iter_key(iter));
1152  res = 0;
1153  }
1154  }
1155 
1156  if (!has_accountcode) {
1157  ast_log(LOG_ERROR, "ARI Channel missing required field accountcode\n");
1158  res = 0;
1159  }
1160 
1161  if (!has_caller) {
1162  ast_log(LOG_ERROR, "ARI Channel missing required field caller\n");
1163  res = 0;
1164  }
1165 
1166  if (!has_connected) {
1167  ast_log(LOG_ERROR, "ARI Channel missing required field connected\n");
1168  res = 0;
1169  }
1170 
1171  if (!has_creationtime) {
1172  ast_log(LOG_ERROR, "ARI Channel missing required field creationtime\n");
1173  res = 0;
1174  }
1175 
1176  if (!has_dialplan) {
1177  ast_log(LOG_ERROR, "ARI Channel missing required field dialplan\n");
1178  res = 0;
1179  }
1180 
1181  if (!has_id) {
1182  ast_log(LOG_ERROR, "ARI Channel missing required field id\n");
1183  res = 0;
1184  }
1185 
1186  if (!has_language) {
1187  ast_log(LOG_ERROR, "ARI Channel missing required field language\n");
1188  res = 0;
1189  }
1190 
1191  if (!has_name) {
1192  ast_log(LOG_ERROR, "ARI Channel missing required field name\n");
1193  res = 0;
1194  }
1195 
1196  if (!has_state) {
1197  ast_log(LOG_ERROR, "ARI Channel missing required field state\n");
1198  res = 0;
1199  }
1200 
1201  return res;
1202 }
1203 
1205 {
1206  return ast_ari_validate_channel;
1207 }
1208 
1210 {
1211  int res = 1;
1212  struct ast_json_iter *iter;
1213 
1214  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1215  {
1217  "ARI Dialed has undocumented field %s\n",
1218  ast_json_object_iter_key(iter));
1219  res = 0;
1220  }
1221  }
1222 
1223  return res;
1224 }
1225 
1227 {
1228  return ast_ari_validate_dialed;
1229 }
1230 
1232 {
1233  int res = 1;
1234  struct ast_json_iter *iter;
1235  int has_app_data = 0;
1236  int has_app_name = 0;
1237  int has_context = 0;
1238  int has_exten = 0;
1239  int has_priority = 0;
1240 
1241  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1242  if (strcmp("app_data", ast_json_object_iter_key(iter)) == 0) {
1243  int prop_is_valid;
1244  has_app_data = 1;
1245  prop_is_valid = ast_ari_validate_string(
1247  if (!prop_is_valid) {
1248  ast_log(LOG_ERROR, "ARI DialplanCEP field app_data failed validation\n");
1249  res = 0;
1250  }
1251  } else
1252  if (strcmp("app_name", ast_json_object_iter_key(iter)) == 0) {
1253  int prop_is_valid;
1254  has_app_name = 1;
1255  prop_is_valid = ast_ari_validate_string(
1257  if (!prop_is_valid) {
1258  ast_log(LOG_ERROR, "ARI DialplanCEP field app_name failed validation\n");
1259  res = 0;
1260  }
1261  } else
1262  if (strcmp("context", ast_json_object_iter_key(iter)) == 0) {
1263  int prop_is_valid;
1264  has_context = 1;
1265  prop_is_valid = ast_ari_validate_string(
1267  if (!prop_is_valid) {
1268  ast_log(LOG_ERROR, "ARI DialplanCEP field context failed validation\n");
1269  res = 0;
1270  }
1271  } else
1272  if (strcmp("exten", ast_json_object_iter_key(iter)) == 0) {
1273  int prop_is_valid;
1274  has_exten = 1;
1275  prop_is_valid = ast_ari_validate_string(
1277  if (!prop_is_valid) {
1278  ast_log(LOG_ERROR, "ARI DialplanCEP field exten failed validation\n");
1279  res = 0;
1280  }
1281  } else
1282  if (strcmp("priority", ast_json_object_iter_key(iter)) == 0) {
1283  int prop_is_valid;
1284  has_priority = 1;
1285  prop_is_valid = ast_ari_validate_long(
1287  if (!prop_is_valid) {
1288  ast_log(LOG_ERROR, "ARI DialplanCEP field priority failed validation\n");
1289  res = 0;
1290  }
1291  } else
1292  {
1294  "ARI DialplanCEP has undocumented field %s\n",
1295  ast_json_object_iter_key(iter));
1296  res = 0;
1297  }
1298  }
1299 
1300  if (!has_app_data) {
1301  ast_log(LOG_ERROR, "ARI DialplanCEP missing required field app_data\n");
1302  res = 0;
1303  }
1304 
1305  if (!has_app_name) {
1306  ast_log(LOG_ERROR, "ARI DialplanCEP missing required field app_name\n");
1307  res = 0;
1308  }
1309 
1310  if (!has_context) {
1311  ast_log(LOG_ERROR, "ARI DialplanCEP missing required field context\n");
1312  res = 0;
1313  }
1314 
1315  if (!has_exten) {
1316  ast_log(LOG_ERROR, "ARI DialplanCEP missing required field exten\n");
1317  res = 0;
1318  }
1319 
1320  if (!has_priority) {
1321  ast_log(LOG_ERROR, "ARI DialplanCEP missing required field priority\n");
1322  res = 0;
1323  }
1324 
1325  return res;
1326 }
1327 
1329 {
1331 }
1332 
1334 {
1335  int res = 1;
1336  struct ast_json_iter *iter;
1337  int has_channel_uniqueid = 0;
1338  int has_local_ssrc = 0;
1339  int has_remote_ssrc = 0;
1340  int has_rxcount = 0;
1341  int has_rxoctetcount = 0;
1342  int has_rxploss = 0;
1343  int has_txcount = 0;
1344  int has_txoctetcount = 0;
1345  int has_txploss = 0;
1346 
1347  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1348  if (strcmp("channel_uniqueid", ast_json_object_iter_key(iter)) == 0) {
1349  int prop_is_valid;
1350  has_channel_uniqueid = 1;
1351  prop_is_valid = ast_ari_validate_string(
1353  if (!prop_is_valid) {
1354  ast_log(LOG_ERROR, "ARI RTPstat field channel_uniqueid failed validation\n");
1355  res = 0;
1356  }
1357  } else
1358  if (strcmp("local_maxjitter", ast_json_object_iter_key(iter)) == 0) {
1359  int prop_is_valid;
1360  prop_is_valid = ast_ari_validate_double(
1362  if (!prop_is_valid) {
1363  ast_log(LOG_ERROR, "ARI RTPstat field local_maxjitter failed validation\n");
1364  res = 0;
1365  }
1366  } else
1367  if (strcmp("local_maxrxploss", ast_json_object_iter_key(iter)) == 0) {
1368  int prop_is_valid;
1369  prop_is_valid = ast_ari_validate_double(
1371  if (!prop_is_valid) {
1372  ast_log(LOG_ERROR, "ARI RTPstat field local_maxrxploss failed validation\n");
1373  res = 0;
1374  }
1375  } else
1376  if (strcmp("local_minjitter", ast_json_object_iter_key(iter)) == 0) {
1377  int prop_is_valid;
1378  prop_is_valid = ast_ari_validate_double(
1380  if (!prop_is_valid) {
1381  ast_log(LOG_ERROR, "ARI RTPstat field local_minjitter failed validation\n");
1382  res = 0;
1383  }
1384  } else
1385  if (strcmp("local_minrxploss", ast_json_object_iter_key(iter)) == 0) {
1386  int prop_is_valid;
1387  prop_is_valid = ast_ari_validate_double(
1389  if (!prop_is_valid) {
1390  ast_log(LOG_ERROR, "ARI RTPstat field local_minrxploss failed validation\n");
1391  res = 0;
1392  }
1393  } else
1394  if (strcmp("local_normdevjitter", ast_json_object_iter_key(iter)) == 0) {
1395  int prop_is_valid;
1396  prop_is_valid = ast_ari_validate_double(
1398  if (!prop_is_valid) {
1399  ast_log(LOG_ERROR, "ARI RTPstat field local_normdevjitter failed validation\n");
1400  res = 0;
1401  }
1402  } else
1403  if (strcmp("local_normdevrxploss", ast_json_object_iter_key(iter)) == 0) {
1404  int prop_is_valid;
1405  prop_is_valid = ast_ari_validate_double(
1407  if (!prop_is_valid) {
1408  ast_log(LOG_ERROR, "ARI RTPstat field local_normdevrxploss failed validation\n");
1409  res = 0;
1410  }
1411  } else
1412  if (strcmp("local_ssrc", ast_json_object_iter_key(iter)) == 0) {
1413  int prop_is_valid;
1414  has_local_ssrc = 1;
1415  prop_is_valid = ast_ari_validate_int(
1417  if (!prop_is_valid) {
1418  ast_log(LOG_ERROR, "ARI RTPstat field local_ssrc failed validation\n");
1419  res = 0;
1420  }
1421  } else
1422  if (strcmp("local_stdevjitter", ast_json_object_iter_key(iter)) == 0) {
1423  int prop_is_valid;
1424  prop_is_valid = ast_ari_validate_double(
1426  if (!prop_is_valid) {
1427  ast_log(LOG_ERROR, "ARI RTPstat field local_stdevjitter failed validation\n");
1428  res = 0;
1429  }
1430  } else
1431  if (strcmp("local_stdevrxploss", ast_json_object_iter_key(iter)) == 0) {
1432  int prop_is_valid;
1433  prop_is_valid = ast_ari_validate_double(
1435  if (!prop_is_valid) {
1436  ast_log(LOG_ERROR, "ARI RTPstat field local_stdevrxploss failed validation\n");
1437  res = 0;
1438  }
1439  } else
1440  if (strcmp("maxrtt", ast_json_object_iter_key(iter)) == 0) {
1441  int prop_is_valid;
1442  prop_is_valid = ast_ari_validate_double(
1444  if (!prop_is_valid) {
1445  ast_log(LOG_ERROR, "ARI RTPstat field maxrtt failed validation\n");
1446  res = 0;
1447  }
1448  } else
1449  if (strcmp("minrtt", ast_json_object_iter_key(iter)) == 0) {
1450  int prop_is_valid;
1451  prop_is_valid = ast_ari_validate_double(
1453  if (!prop_is_valid) {
1454  ast_log(LOG_ERROR, "ARI RTPstat field minrtt failed validation\n");
1455  res = 0;
1456  }
1457  } else
1458  if (strcmp("normdevrtt", ast_json_object_iter_key(iter)) == 0) {
1459  int prop_is_valid;
1460  prop_is_valid = ast_ari_validate_double(
1462  if (!prop_is_valid) {
1463  ast_log(LOG_ERROR, "ARI RTPstat field normdevrtt failed validation\n");
1464  res = 0;
1465  }
1466  } else
1467  if (strcmp("remote_maxjitter", ast_json_object_iter_key(iter)) == 0) {
1468  int prop_is_valid;
1469  prop_is_valid = ast_ari_validate_double(
1471  if (!prop_is_valid) {
1472  ast_log(LOG_ERROR, "ARI RTPstat field remote_maxjitter failed validation\n");
1473  res = 0;
1474  }
1475  } else
1476  if (strcmp("remote_maxrxploss", ast_json_object_iter_key(iter)) == 0) {
1477  int prop_is_valid;
1478  prop_is_valid = ast_ari_validate_double(
1480  if (!prop_is_valid) {
1481  ast_log(LOG_ERROR, "ARI RTPstat field remote_maxrxploss failed validation\n");
1482  res = 0;
1483  }
1484  } else
1485  if (strcmp("remote_minjitter", ast_json_object_iter_key(iter)) == 0) {
1486  int prop_is_valid;
1487  prop_is_valid = ast_ari_validate_double(
1489  if (!prop_is_valid) {
1490  ast_log(LOG_ERROR, "ARI RTPstat field remote_minjitter failed validation\n");
1491  res = 0;
1492  }
1493  } else
1494  if (strcmp("remote_minrxploss", ast_json_object_iter_key(iter)) == 0) {
1495  int prop_is_valid;
1496  prop_is_valid = ast_ari_validate_double(
1498  if (!prop_is_valid) {
1499  ast_log(LOG_ERROR, "ARI RTPstat field remote_minrxploss failed validation\n");
1500  res = 0;
1501  }
1502  } else
1503  if (strcmp("remote_normdevjitter", ast_json_object_iter_key(iter)) == 0) {
1504  int prop_is_valid;
1505  prop_is_valid = ast_ari_validate_double(
1507  if (!prop_is_valid) {
1508  ast_log(LOG_ERROR, "ARI RTPstat field remote_normdevjitter failed validation\n");
1509  res = 0;
1510  }
1511  } else
1512  if (strcmp("remote_normdevrxploss", ast_json_object_iter_key(iter)) == 0) {
1513  int prop_is_valid;
1514  prop_is_valid = ast_ari_validate_double(
1516  if (!prop_is_valid) {
1517  ast_log(LOG_ERROR, "ARI RTPstat field remote_normdevrxploss failed validation\n");
1518  res = 0;
1519  }
1520  } else
1521  if (strcmp("remote_ssrc", ast_json_object_iter_key(iter)) == 0) {
1522  int prop_is_valid;
1523  has_remote_ssrc = 1;
1524  prop_is_valid = ast_ari_validate_int(
1526  if (!prop_is_valid) {
1527  ast_log(LOG_ERROR, "ARI RTPstat field remote_ssrc failed validation\n");
1528  res = 0;
1529  }
1530  } else
1531  if (strcmp("remote_stdevjitter", ast_json_object_iter_key(iter)) == 0) {
1532  int prop_is_valid;
1533  prop_is_valid = ast_ari_validate_double(
1535  if (!prop_is_valid) {
1536  ast_log(LOG_ERROR, "ARI RTPstat field remote_stdevjitter failed validation\n");
1537  res = 0;
1538  }
1539  } else
1540  if (strcmp("remote_stdevrxploss", ast_json_object_iter_key(iter)) == 0) {
1541  int prop_is_valid;
1542  prop_is_valid = ast_ari_validate_double(
1544  if (!prop_is_valid) {
1545  ast_log(LOG_ERROR, "ARI RTPstat field remote_stdevrxploss failed validation\n");
1546  res = 0;
1547  }
1548  } else
1549  if (strcmp("rtt", ast_json_object_iter_key(iter)) == 0) {
1550  int prop_is_valid;
1551  prop_is_valid = ast_ari_validate_double(
1553  if (!prop_is_valid) {
1554  ast_log(LOG_ERROR, "ARI RTPstat field rtt failed validation\n");
1555  res = 0;
1556  }
1557  } else
1558  if (strcmp("rxcount", ast_json_object_iter_key(iter)) == 0) {
1559  int prop_is_valid;
1560  has_rxcount = 1;
1561  prop_is_valid = ast_ari_validate_int(
1563  if (!prop_is_valid) {
1564  ast_log(LOG_ERROR, "ARI RTPstat field rxcount failed validation\n");
1565  res = 0;
1566  }
1567  } else
1568  if (strcmp("rxjitter", ast_json_object_iter_key(iter)) == 0) {
1569  int prop_is_valid;
1570  prop_is_valid = ast_ari_validate_double(
1572  if (!prop_is_valid) {
1573  ast_log(LOG_ERROR, "ARI RTPstat field rxjitter failed validation\n");
1574  res = 0;
1575  }
1576  } else
1577  if (strcmp("rxoctetcount", ast_json_object_iter_key(iter)) == 0) {
1578  int prop_is_valid;
1579  has_rxoctetcount = 1;
1580  prop_is_valid = ast_ari_validate_int(
1582  if (!prop_is_valid) {
1583  ast_log(LOG_ERROR, "ARI RTPstat field rxoctetcount failed validation\n");
1584  res = 0;
1585  }
1586  } else
1587  if (strcmp("rxploss", ast_json_object_iter_key(iter)) == 0) {
1588  int prop_is_valid;
1589  has_rxploss = 1;
1590  prop_is_valid = ast_ari_validate_int(
1592  if (!prop_is_valid) {
1593  ast_log(LOG_ERROR, "ARI RTPstat field rxploss failed validation\n");
1594  res = 0;
1595  }
1596  } else
1597  if (strcmp("stdevrtt", ast_json_object_iter_key(iter)) == 0) {
1598  int prop_is_valid;
1599  prop_is_valid = ast_ari_validate_double(
1601  if (!prop_is_valid) {
1602  ast_log(LOG_ERROR, "ARI RTPstat field stdevrtt failed validation\n");
1603  res = 0;
1604  }
1605  } else
1606  if (strcmp("txcount", ast_json_object_iter_key(iter)) == 0) {
1607  int prop_is_valid;
1608  has_txcount = 1;
1609  prop_is_valid = ast_ari_validate_int(
1611  if (!prop_is_valid) {
1612  ast_log(LOG_ERROR, "ARI RTPstat field txcount failed validation\n");
1613  res = 0;
1614  }
1615  } else
1616  if (strcmp("txjitter", ast_json_object_iter_key(iter)) == 0) {
1617  int prop_is_valid;
1618  prop_is_valid = ast_ari_validate_double(
1620  if (!prop_is_valid) {
1621  ast_log(LOG_ERROR, "ARI RTPstat field txjitter failed validation\n");
1622  res = 0;
1623  }
1624  } else
1625  if (strcmp("txoctetcount", ast_json_object_iter_key(iter)) == 0) {
1626  int prop_is_valid;
1627  has_txoctetcount = 1;
1628  prop_is_valid = ast_ari_validate_int(
1630  if (!prop_is_valid) {
1631  ast_log(LOG_ERROR, "ARI RTPstat field txoctetcount failed validation\n");
1632  res = 0;
1633  }
1634  } else
1635  if (strcmp("txploss", ast_json_object_iter_key(iter)) == 0) {
1636  int prop_is_valid;
1637  has_txploss = 1;
1638  prop_is_valid = ast_ari_validate_int(
1640  if (!prop_is_valid) {
1641  ast_log(LOG_ERROR, "ARI RTPstat field txploss failed validation\n");
1642  res = 0;
1643  }
1644  } else
1645  {
1647  "ARI RTPstat has undocumented field %s\n",
1648  ast_json_object_iter_key(iter));
1649  res = 0;
1650  }
1651  }
1652 
1653  if (!has_channel_uniqueid) {
1654  ast_log(LOG_ERROR, "ARI RTPstat missing required field channel_uniqueid\n");
1655  res = 0;
1656  }
1657 
1658  if (!has_local_ssrc) {
1659  ast_log(LOG_ERROR, "ARI RTPstat missing required field local_ssrc\n");
1660  res = 0;
1661  }
1662 
1663  if (!has_remote_ssrc) {
1664  ast_log(LOG_ERROR, "ARI RTPstat missing required field remote_ssrc\n");
1665  res = 0;
1666  }
1667 
1668  if (!has_rxcount) {
1669  ast_log(LOG_ERROR, "ARI RTPstat missing required field rxcount\n");
1670  res = 0;
1671  }
1672 
1673  if (!has_rxoctetcount) {
1674  ast_log(LOG_ERROR, "ARI RTPstat missing required field rxoctetcount\n");
1675  res = 0;
1676  }
1677 
1678  if (!has_rxploss) {
1679  ast_log(LOG_ERROR, "ARI RTPstat missing required field rxploss\n");
1680  res = 0;
1681  }
1682 
1683  if (!has_txcount) {
1684  ast_log(LOG_ERROR, "ARI RTPstat missing required field txcount\n");
1685  res = 0;
1686  }
1687 
1688  if (!has_txoctetcount) {
1689  ast_log(LOG_ERROR, "ARI RTPstat missing required field txoctetcount\n");
1690  res = 0;
1691  }
1692 
1693  if (!has_txploss) {
1694  ast_log(LOG_ERROR, "ARI RTPstat missing required field txploss\n");
1695  res = 0;
1696  }
1697 
1698  return res;
1699 }
1700 
1702 {
1703  return ast_ari_validate_rtpstat;
1704 }
1705 
1707 {
1708  int res = 1;
1709  struct ast_json_iter *iter;
1710  int has_bridge_class = 0;
1711  int has_bridge_type = 0;
1712  int has_channels = 0;
1713  int has_creationtime = 0;
1714  int has_creator = 0;
1715  int has_id = 0;
1716  int has_name = 0;
1717  int has_technology = 0;
1718 
1719  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1720  if (strcmp("bridge_class", ast_json_object_iter_key(iter)) == 0) {
1721  int prop_is_valid;
1722  has_bridge_class = 1;
1723  prop_is_valid = ast_ari_validate_string(
1725  if (!prop_is_valid) {
1726  ast_log(LOG_ERROR, "ARI Bridge field bridge_class failed validation\n");
1727  res = 0;
1728  }
1729  } else
1730  if (strcmp("bridge_type", ast_json_object_iter_key(iter)) == 0) {
1731  int prop_is_valid;
1732  has_bridge_type = 1;
1733  prop_is_valid = ast_ari_validate_string(
1735  if (!prop_is_valid) {
1736  ast_log(LOG_ERROR, "ARI Bridge field bridge_type failed validation\n");
1737  res = 0;
1738  }
1739  } else
1740  if (strcmp("channels", ast_json_object_iter_key(iter)) == 0) {
1741  int prop_is_valid;
1742  has_channels = 1;
1743  prop_is_valid = ast_ari_validate_list(
1746  if (!prop_is_valid) {
1747  ast_log(LOG_ERROR, "ARI Bridge field channels failed validation\n");
1748  res = 0;
1749  }
1750  } else
1751  if (strcmp("creationtime", ast_json_object_iter_key(iter)) == 0) {
1752  int prop_is_valid;
1753  has_creationtime = 1;
1754  prop_is_valid = ast_ari_validate_date(
1756  if (!prop_is_valid) {
1757  ast_log(LOG_ERROR, "ARI Bridge field creationtime failed validation\n");
1758  res = 0;
1759  }
1760  } else
1761  if (strcmp("creator", ast_json_object_iter_key(iter)) == 0) {
1762  int prop_is_valid;
1763  has_creator = 1;
1764  prop_is_valid = ast_ari_validate_string(
1766  if (!prop_is_valid) {
1767  ast_log(LOG_ERROR, "ARI Bridge field creator failed validation\n");
1768  res = 0;
1769  }
1770  } else
1771  if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
1772  int prop_is_valid;
1773  has_id = 1;
1774  prop_is_valid = ast_ari_validate_string(
1776  if (!prop_is_valid) {
1777  ast_log(LOG_ERROR, "ARI Bridge field id failed validation\n");
1778  res = 0;
1779  }
1780  } else
1781  if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
1782  int prop_is_valid;
1783  has_name = 1;
1784  prop_is_valid = ast_ari_validate_string(
1786  if (!prop_is_valid) {
1787  ast_log(LOG_ERROR, "ARI Bridge field name failed validation\n");
1788  res = 0;
1789  }
1790  } else
1791  if (strcmp("technology", ast_json_object_iter_key(iter)) == 0) {
1792  int prop_is_valid;
1793  has_technology = 1;
1794  prop_is_valid = ast_ari_validate_string(
1796  if (!prop_is_valid) {
1797  ast_log(LOG_ERROR, "ARI Bridge field technology failed validation\n");
1798  res = 0;
1799  }
1800  } else
1801  if (strcmp("video_mode", ast_json_object_iter_key(iter)) == 0) {
1802  int prop_is_valid;
1803  prop_is_valid = ast_ari_validate_string(
1805  if (!prop_is_valid) {
1806  ast_log(LOG_ERROR, "ARI Bridge field video_mode failed validation\n");
1807  res = 0;
1808  }
1809  } else
1810  if (strcmp("video_source_id", ast_json_object_iter_key(iter)) == 0) {
1811  int prop_is_valid;
1812  prop_is_valid = ast_ari_validate_string(
1814  if (!prop_is_valid) {
1815  ast_log(LOG_ERROR, "ARI Bridge field video_source_id failed validation\n");
1816  res = 0;
1817  }
1818  } else
1819  {
1821  "ARI Bridge has undocumented field %s\n",
1822  ast_json_object_iter_key(iter));
1823  res = 0;
1824  }
1825  }
1826 
1827  if (!has_bridge_class) {
1828  ast_log(LOG_ERROR, "ARI Bridge missing required field bridge_class\n");
1829  res = 0;
1830  }
1831 
1832  if (!has_bridge_type) {
1833  ast_log(LOG_ERROR, "ARI Bridge missing required field bridge_type\n");
1834  res = 0;
1835  }
1836 
1837  if (!has_channels) {
1838  ast_log(LOG_ERROR, "ARI Bridge missing required field channels\n");
1839  res = 0;
1840  }
1841 
1842  if (!has_creationtime) {
1843  ast_log(LOG_ERROR, "ARI Bridge missing required field creationtime\n");
1844  res = 0;
1845  }
1846 
1847  if (!has_creator) {
1848  ast_log(LOG_ERROR, "ARI Bridge missing required field creator\n");
1849  res = 0;
1850  }
1851 
1852  if (!has_id) {
1853  ast_log(LOG_ERROR, "ARI Bridge missing required field id\n");
1854  res = 0;
1855  }
1856 
1857  if (!has_name) {
1858  ast_log(LOG_ERROR, "ARI Bridge missing required field name\n");
1859  res = 0;
1860  }
1861 
1862  if (!has_technology) {
1863  ast_log(LOG_ERROR, "ARI Bridge missing required field technology\n");
1864  res = 0;
1865  }
1866 
1867  return res;
1868 }
1869 
1871 {
1872  return ast_ari_validate_bridge;
1873 }
1874 
1876 {
1877  int res = 1;
1878  struct ast_json_iter *iter;
1879  int has_format = 0;
1880  int has_name = 0;
1881  int has_state = 0;
1882  int has_target_uri = 0;
1883 
1884  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
1885  if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
1886  int prop_is_valid;
1887  prop_is_valid = ast_ari_validate_string(
1889  if (!prop_is_valid) {
1890  ast_log(LOG_ERROR, "ARI LiveRecording field cause failed validation\n");
1891  res = 0;
1892  }
1893  } else
1894  if (strcmp("duration", ast_json_object_iter_key(iter)) == 0) {
1895  int prop_is_valid;
1896  prop_is_valid = ast_ari_validate_int(
1898  if (!prop_is_valid) {
1899  ast_log(LOG_ERROR, "ARI LiveRecording field duration failed validation\n");
1900  res = 0;
1901  }
1902  } else
1903  if (strcmp("format", ast_json_object_iter_key(iter)) == 0) {
1904  int prop_is_valid;
1905  has_format = 1;
1906  prop_is_valid = ast_ari_validate_string(
1908  if (!prop_is_valid) {
1909  ast_log(LOG_ERROR, "ARI LiveRecording field format failed validation\n");
1910  res = 0;
1911  }
1912  } else
1913  if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
1914  int prop_is_valid;
1915  has_name = 1;
1916  prop_is_valid = ast_ari_validate_string(
1918  if (!prop_is_valid) {
1919  ast_log(LOG_ERROR, "ARI LiveRecording field name failed validation\n");
1920  res = 0;
1921  }
1922  } else
1923  if (strcmp("silence_duration", ast_json_object_iter_key(iter)) == 0) {
1924  int prop_is_valid;
1925  prop_is_valid = ast_ari_validate_int(
1927  if (!prop_is_valid) {
1928  ast_log(LOG_ERROR, "ARI LiveRecording field silence_duration failed validation\n");
1929  res = 0;
1930  }
1931  } else
1932  if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
1933  int prop_is_valid;
1934  has_state = 1;
1935  prop_is_valid = ast_ari_validate_string(
1937  if (!prop_is_valid) {
1938  ast_log(LOG_ERROR, "ARI LiveRecording field state failed validation\n");
1939  res = 0;
1940  }
1941  } else
1942  if (strcmp("talking_duration", ast_json_object_iter_key(iter)) == 0) {
1943  int prop_is_valid;
1944  prop_is_valid = ast_ari_validate_int(
1946  if (!prop_is_valid) {
1947  ast_log(LOG_ERROR, "ARI LiveRecording field talking_duration failed validation\n");
1948  res = 0;
1949  }
1950  } else
1951  if (strcmp("target_uri", ast_json_object_iter_key(iter)) == 0) {
1952  int prop_is_valid;
1953  has_target_uri = 1;
1954  prop_is_valid = ast_ari_validate_string(
1956  if (!prop_is_valid) {
1957  ast_log(LOG_ERROR, "ARI LiveRecording field target_uri failed validation\n");
1958  res = 0;
1959  }
1960  } else
1961  {
1963  "ARI LiveRecording has undocumented field %s\n",
1964  ast_json_object_iter_key(iter));
1965  res = 0;
1966  }
1967  }
1968 
1969  if (!has_format) {
1970  ast_log(LOG_ERROR, "ARI LiveRecording missing required field format\n");
1971  res = 0;
1972  }
1973 
1974  if (!has_name) {
1975  ast_log(LOG_ERROR, "ARI LiveRecording missing required field name\n");
1976  res = 0;
1977  }
1978 
1979  if (!has_state) {
1980  ast_log(LOG_ERROR, "ARI LiveRecording missing required field state\n");
1981  res = 0;
1982  }
1983 
1984  if (!has_target_uri) {
1985  ast_log(LOG_ERROR, "ARI LiveRecording missing required field target_uri\n");
1986  res = 0;
1987  }
1988 
1989  return res;
1990 }
1991 
1993 {
1995 }
1996 
1998 {
1999  int res = 1;
2000  struct ast_json_iter *iter;
2001  int has_format = 0;
2002  int has_name = 0;
2003 
2004  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2005  if (strcmp("format", ast_json_object_iter_key(iter)) == 0) {
2006  int prop_is_valid;
2007  has_format = 1;
2008  prop_is_valid = ast_ari_validate_string(
2010  if (!prop_is_valid) {
2011  ast_log(LOG_ERROR, "ARI StoredRecording field format failed validation\n");
2012  res = 0;
2013  }
2014  } else
2015  if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
2016  int prop_is_valid;
2017  has_name = 1;
2018  prop_is_valid = ast_ari_validate_string(
2020  if (!prop_is_valid) {
2021  ast_log(LOG_ERROR, "ARI StoredRecording field name failed validation\n");
2022  res = 0;
2023  }
2024  } else
2025  {
2027  "ARI StoredRecording has undocumented field %s\n",
2028  ast_json_object_iter_key(iter));
2029  res = 0;
2030  }
2031  }
2032 
2033  if (!has_format) {
2034  ast_log(LOG_ERROR, "ARI StoredRecording missing required field format\n");
2035  res = 0;
2036  }
2037 
2038  if (!has_name) {
2039  ast_log(LOG_ERROR, "ARI StoredRecording missing required field name\n");
2040  res = 0;
2041  }
2042 
2043  return res;
2044 }
2045 
2047 {
2049 }
2050 
2052 {
2053  int res = 1;
2054  struct ast_json_iter *iter;
2055  int has_format = 0;
2056  int has_language = 0;
2057 
2058  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2059  if (strcmp("format", ast_json_object_iter_key(iter)) == 0) {
2060  int prop_is_valid;
2061  has_format = 1;
2062  prop_is_valid = ast_ari_validate_string(
2064  if (!prop_is_valid) {
2065  ast_log(LOG_ERROR, "ARI FormatLangPair field format failed validation\n");
2066  res = 0;
2067  }
2068  } else
2069  if (strcmp("language", ast_json_object_iter_key(iter)) == 0) {
2070  int prop_is_valid;
2071  has_language = 1;
2072  prop_is_valid = ast_ari_validate_string(
2074  if (!prop_is_valid) {
2075  ast_log(LOG_ERROR, "ARI FormatLangPair field language failed validation\n");
2076  res = 0;
2077  }
2078  } else
2079  {
2081  "ARI FormatLangPair has undocumented field %s\n",
2082  ast_json_object_iter_key(iter));
2083  res = 0;
2084  }
2085  }
2086 
2087  if (!has_format) {
2088  ast_log(LOG_ERROR, "ARI FormatLangPair missing required field format\n");
2089  res = 0;
2090  }
2091 
2092  if (!has_language) {
2093  ast_log(LOG_ERROR, "ARI FormatLangPair missing required field language\n");
2094  res = 0;
2095  }
2096 
2097  return res;
2098 }
2099 
2101 {
2103 }
2104 
2106 {
2107  int res = 1;
2108  struct ast_json_iter *iter;
2109  int has_formats = 0;
2110  int has_id = 0;
2111 
2112  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2113  if (strcmp("formats", ast_json_object_iter_key(iter)) == 0) {
2114  int prop_is_valid;
2115  has_formats = 1;
2116  prop_is_valid = ast_ari_validate_list(
2119  if (!prop_is_valid) {
2120  ast_log(LOG_ERROR, "ARI Sound field formats failed validation\n");
2121  res = 0;
2122  }
2123  } else
2124  if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
2125  int prop_is_valid;
2126  has_id = 1;
2127  prop_is_valid = ast_ari_validate_string(
2129  if (!prop_is_valid) {
2130  ast_log(LOG_ERROR, "ARI Sound field id failed validation\n");
2131  res = 0;
2132  }
2133  } else
2134  if (strcmp("text", ast_json_object_iter_key(iter)) == 0) {
2135  int prop_is_valid;
2136  prop_is_valid = ast_ari_validate_string(
2138  if (!prop_is_valid) {
2139  ast_log(LOG_ERROR, "ARI Sound field text failed validation\n");
2140  res = 0;
2141  }
2142  } else
2143  {
2145  "ARI Sound has undocumented field %s\n",
2146  ast_json_object_iter_key(iter));
2147  res = 0;
2148  }
2149  }
2150 
2151  if (!has_formats) {
2152  ast_log(LOG_ERROR, "ARI Sound missing required field formats\n");
2153  res = 0;
2154  }
2155 
2156  if (!has_id) {
2157  ast_log(LOG_ERROR, "ARI Sound missing required field id\n");
2158  res = 0;
2159  }
2160 
2161  return res;
2162 }
2163 
2165 {
2166  return ast_ari_validate_sound;
2167 }
2168 
2170 {
2171  int res = 1;
2172  struct ast_json_iter *iter;
2173  int has_id = 0;
2174  int has_media_uri = 0;
2175  int has_state = 0;
2176  int has_target_uri = 0;
2177 
2178  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2179  if (strcmp("id", ast_json_object_iter_key(iter)) == 0) {
2180  int prop_is_valid;
2181  has_id = 1;
2182  prop_is_valid = ast_ari_validate_string(
2184  if (!prop_is_valid) {
2185  ast_log(LOG_ERROR, "ARI Playback field id failed validation\n");
2186  res = 0;
2187  }
2188  } else
2189  if (strcmp("language", ast_json_object_iter_key(iter)) == 0) {
2190  int prop_is_valid;
2191  prop_is_valid = ast_ari_validate_string(
2193  if (!prop_is_valid) {
2194  ast_log(LOG_ERROR, "ARI Playback field language failed validation\n");
2195  res = 0;
2196  }
2197  } else
2198  if (strcmp("media_uri", ast_json_object_iter_key(iter)) == 0) {
2199  int prop_is_valid;
2200  has_media_uri = 1;
2201  prop_is_valid = ast_ari_validate_string(
2203  if (!prop_is_valid) {
2204  ast_log(LOG_ERROR, "ARI Playback field media_uri failed validation\n");
2205  res = 0;
2206  }
2207  } else
2208  if (strcmp("next_media_uri", ast_json_object_iter_key(iter)) == 0) {
2209  int prop_is_valid;
2210  prop_is_valid = ast_ari_validate_string(
2212  if (!prop_is_valid) {
2213  ast_log(LOG_ERROR, "ARI Playback field next_media_uri failed validation\n");
2214  res = 0;
2215  }
2216  } else
2217  if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
2218  int prop_is_valid;
2219  has_state = 1;
2220  prop_is_valid = ast_ari_validate_string(
2222  if (!prop_is_valid) {
2223  ast_log(LOG_ERROR, "ARI Playback field state failed validation\n");
2224  res = 0;
2225  }
2226  } else
2227  if (strcmp("target_uri", ast_json_object_iter_key(iter)) == 0) {
2228  int prop_is_valid;
2229  has_target_uri = 1;
2230  prop_is_valid = ast_ari_validate_string(
2232  if (!prop_is_valid) {
2233  ast_log(LOG_ERROR, "ARI Playback field target_uri failed validation\n");
2234  res = 0;
2235  }
2236  } else
2237  {
2239  "ARI Playback has undocumented field %s\n",
2240  ast_json_object_iter_key(iter));
2241  res = 0;
2242  }
2243  }
2244 
2245  if (!has_id) {
2246  ast_log(LOG_ERROR, "ARI Playback missing required field id\n");
2247  res = 0;
2248  }
2249 
2250  if (!has_media_uri) {
2251  ast_log(LOG_ERROR, "ARI Playback missing required field media_uri\n");
2252  res = 0;
2253  }
2254 
2255  if (!has_state) {
2256  ast_log(LOG_ERROR, "ARI Playback missing required field state\n");
2257  res = 0;
2258  }
2259 
2260  if (!has_target_uri) {
2261  ast_log(LOG_ERROR, "ARI Playback missing required field target_uri\n");
2262  res = 0;
2263  }
2264 
2265  return res;
2266 }
2267 
2269 {
2271 }
2272 
2274 {
2275  int res = 1;
2276  struct ast_json_iter *iter;
2277  int has_name = 0;
2278  int has_state = 0;
2279 
2280  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2281  if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
2282  int prop_is_valid;
2283  has_name = 1;
2284  prop_is_valid = ast_ari_validate_string(
2286  if (!prop_is_valid) {
2287  ast_log(LOG_ERROR, "ARI DeviceState field name failed validation\n");
2288  res = 0;
2289  }
2290  } else
2291  if (strcmp("state", ast_json_object_iter_key(iter)) == 0) {
2292  int prop_is_valid;
2293  has_state = 1;
2294  prop_is_valid = ast_ari_validate_string(
2296  if (!prop_is_valid) {
2297  ast_log(LOG_ERROR, "ARI DeviceState field state failed validation\n");
2298  res = 0;
2299  }
2300  } else
2301  {
2303  "ARI DeviceState has undocumented field %s\n",
2304  ast_json_object_iter_key(iter));
2305  res = 0;
2306  }
2307  }
2308 
2309  if (!has_name) {
2310  ast_log(LOG_ERROR, "ARI DeviceState missing required field name\n");
2311  res = 0;
2312  }
2313 
2314  if (!has_state) {
2315  ast_log(LOG_ERROR, "ARI DeviceState missing required field state\n");
2316  res = 0;
2317  }
2318 
2319  return res;
2320 }
2321 
2323 {
2325 }
2326 
2328 {
2329  int res = 1;
2330  struct ast_json_iter *iter;
2331  int has_name = 0;
2332  int has_new_messages = 0;
2333  int has_old_messages = 0;
2334 
2335  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2336  if (strcmp("name", ast_json_object_iter_key(iter)) == 0) {
2337  int prop_is_valid;
2338  has_name = 1;
2339  prop_is_valid = ast_ari_validate_string(
2341  if (!prop_is_valid) {
2342  ast_log(LOG_ERROR, "ARI Mailbox field name failed validation\n");
2343  res = 0;
2344  }
2345  } else
2346  if (strcmp("new_messages", ast_json_object_iter_key(iter)) == 0) {
2347  int prop_is_valid;
2348  has_new_messages = 1;
2349  prop_is_valid = ast_ari_validate_int(
2351  if (!prop_is_valid) {
2352  ast_log(LOG_ERROR, "ARI Mailbox field new_messages failed validation\n");
2353  res = 0;
2354  }
2355  } else
2356  if (strcmp("old_messages", ast_json_object_iter_key(iter)) == 0) {
2357  int prop_is_valid;
2358  has_old_messages = 1;
2359  prop_is_valid = ast_ari_validate_int(
2361  if (!prop_is_valid) {
2362  ast_log(LOG_ERROR, "ARI Mailbox field old_messages failed validation\n");
2363  res = 0;
2364  }
2365  } else
2366  {
2368  "ARI Mailbox has undocumented field %s\n",
2369  ast_json_object_iter_key(iter));
2370  res = 0;
2371  }
2372  }
2373 
2374  if (!has_name) {
2375  ast_log(LOG_ERROR, "ARI Mailbox missing required field name\n");
2376  res = 0;
2377  }
2378 
2379  if (!has_new_messages) {
2380  ast_log(LOG_ERROR, "ARI Mailbox missing required field new_messages\n");
2381  res = 0;
2382  }
2383 
2384  if (!has_old_messages) {
2385  ast_log(LOG_ERROR, "ARI Mailbox missing required field old_messages\n");
2386  res = 0;
2387  }
2388 
2389  return res;
2390 }
2391 
2393 {
2394  return ast_ari_validate_mailbox;
2395 }
2396 
2398 {
2399  int res = 1;
2400  struct ast_json_iter *iter;
2401  int has_type = 0;
2402  int has_application = 0;
2403  int has_timestamp = 0;
2404  int has_args = 0;
2405  int has_channel = 0;
2406  int has_destination = 0;
2407 
2408  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2409  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2410  int prop_is_valid;
2411  prop_is_valid = ast_ari_validate_string(
2413  if (!prop_is_valid) {
2414  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field asterisk_id failed validation\n");
2415  res = 0;
2416  }
2417  } else
2418  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2419  int prop_is_valid;
2420  has_type = 1;
2421  prop_is_valid = ast_ari_validate_string(
2423  if (!prop_is_valid) {
2424  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field type failed validation\n");
2425  res = 0;
2426  }
2427  } else
2428  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2429  int prop_is_valid;
2430  has_application = 1;
2431  prop_is_valid = ast_ari_validate_string(
2433  if (!prop_is_valid) {
2434  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field application failed validation\n");
2435  res = 0;
2436  }
2437  } else
2438  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2439  int prop_is_valid;
2440  has_timestamp = 1;
2441  prop_is_valid = ast_ari_validate_date(
2443  if (!prop_is_valid) {
2444  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field timestamp failed validation\n");
2445  res = 0;
2446  }
2447  } else
2448  if (strcmp("args", ast_json_object_iter_key(iter)) == 0) {
2449  int prop_is_valid;
2450  has_args = 1;
2451  prop_is_valid = ast_ari_validate_list(
2454  if (!prop_is_valid) {
2455  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field args failed validation\n");
2456  res = 0;
2457  }
2458  } else
2459  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
2460  int prop_is_valid;
2461  has_channel = 1;
2462  prop_is_valid = ast_ari_validate_channel(
2464  if (!prop_is_valid) {
2465  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field channel failed validation\n");
2466  res = 0;
2467  }
2468  } else
2469  if (strcmp("destination", ast_json_object_iter_key(iter)) == 0) {
2470  int prop_is_valid;
2471  has_destination = 1;
2472  prop_is_valid = ast_ari_validate_string(
2474  if (!prop_is_valid) {
2475  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed field destination failed validation\n");
2476  res = 0;
2477  }
2478  } else
2479  {
2481  "ARI ApplicationMoveFailed has undocumented field %s\n",
2482  ast_json_object_iter_key(iter));
2483  res = 0;
2484  }
2485  }
2486 
2487  if (!has_type) {
2488  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field type\n");
2489  res = 0;
2490  }
2491 
2492  if (!has_application) {
2493  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field application\n");
2494  res = 0;
2495  }
2496 
2497  if (!has_timestamp) {
2498  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field timestamp\n");
2499  res = 0;
2500  }
2501 
2502  if (!has_args) {
2503  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field args\n");
2504  res = 0;
2505  }
2506 
2507  if (!has_channel) {
2508  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field channel\n");
2509  res = 0;
2510  }
2511 
2512  if (!has_destination) {
2513  ast_log(LOG_ERROR, "ARI ApplicationMoveFailed missing required field destination\n");
2514  res = 0;
2515  }
2516 
2517  return res;
2518 }
2519 
2521 {
2523 }
2524 
2526 {
2527  int res = 1;
2528  struct ast_json_iter *iter;
2529  int has_type = 0;
2530  int has_application = 0;
2531  int has_timestamp = 0;
2532 
2533  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2534  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2535  int prop_is_valid;
2536  prop_is_valid = ast_ari_validate_string(
2538  if (!prop_is_valid) {
2539  ast_log(LOG_ERROR, "ARI ApplicationReplaced field asterisk_id failed validation\n");
2540  res = 0;
2541  }
2542  } else
2543  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2544  int prop_is_valid;
2545  has_type = 1;
2546  prop_is_valid = ast_ari_validate_string(
2548  if (!prop_is_valid) {
2549  ast_log(LOG_ERROR, "ARI ApplicationReplaced field type failed validation\n");
2550  res = 0;
2551  }
2552  } else
2553  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2554  int prop_is_valid;
2555  has_application = 1;
2556  prop_is_valid = ast_ari_validate_string(
2558  if (!prop_is_valid) {
2559  ast_log(LOG_ERROR, "ARI ApplicationReplaced field application failed validation\n");
2560  res = 0;
2561  }
2562  } else
2563  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2564  int prop_is_valid;
2565  has_timestamp = 1;
2566  prop_is_valid = ast_ari_validate_date(
2568  if (!prop_is_valid) {
2569  ast_log(LOG_ERROR, "ARI ApplicationReplaced field timestamp failed validation\n");
2570  res = 0;
2571  }
2572  } else
2573  {
2575  "ARI ApplicationReplaced has undocumented field %s\n",
2576  ast_json_object_iter_key(iter));
2577  res = 0;
2578  }
2579  }
2580 
2581  if (!has_type) {
2582  ast_log(LOG_ERROR, "ARI ApplicationReplaced missing required field type\n");
2583  res = 0;
2584  }
2585 
2586  if (!has_application) {
2587  ast_log(LOG_ERROR, "ARI ApplicationReplaced missing required field application\n");
2588  res = 0;
2589  }
2590 
2591  if (!has_timestamp) {
2592  ast_log(LOG_ERROR, "ARI ApplicationReplaced missing required field timestamp\n");
2593  res = 0;
2594  }
2595 
2596  return res;
2597 }
2598 
2600 {
2602 }
2603 
2605 {
2606  int res = 1;
2607  struct ast_json_iter *iter;
2608  int has_type = 0;
2609  int has_application = 0;
2610  int has_timestamp = 0;
2611  int has_destination_type = 0;
2612  int has_is_external = 0;
2613  int has_result = 0;
2614  int has_transferer_first_leg = 0;
2615  int has_transferer_second_leg = 0;
2616 
2617  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2618  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2619  int prop_is_valid;
2620  prop_is_valid = ast_ari_validate_string(
2622  if (!prop_is_valid) {
2623  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field asterisk_id failed validation\n");
2624  res = 0;
2625  }
2626  } else
2627  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2628  int prop_is_valid;
2629  has_type = 1;
2630  prop_is_valid = ast_ari_validate_string(
2632  if (!prop_is_valid) {
2633  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field type failed validation\n");
2634  res = 0;
2635  }
2636  } else
2637  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2638  int prop_is_valid;
2639  has_application = 1;
2640  prop_is_valid = ast_ari_validate_string(
2642  if (!prop_is_valid) {
2643  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field application failed validation\n");
2644  res = 0;
2645  }
2646  } else
2647  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2648  int prop_is_valid;
2649  has_timestamp = 1;
2650  prop_is_valid = ast_ari_validate_date(
2652  if (!prop_is_valid) {
2653  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field timestamp failed validation\n");
2654  res = 0;
2655  }
2656  } else
2657  if (strcmp("destination_application", ast_json_object_iter_key(iter)) == 0) {
2658  int prop_is_valid;
2659  prop_is_valid = ast_ari_validate_string(
2661  if (!prop_is_valid) {
2662  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_application failed validation\n");
2663  res = 0;
2664  }
2665  } else
2666  if (strcmp("destination_bridge", ast_json_object_iter_key(iter)) == 0) {
2667  int prop_is_valid;
2668  prop_is_valid = ast_ari_validate_string(
2670  if (!prop_is_valid) {
2671  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_bridge failed validation\n");
2672  res = 0;
2673  }
2674  } else
2675  if (strcmp("destination_link_first_leg", ast_json_object_iter_key(iter)) == 0) {
2676  int prop_is_valid;
2677  prop_is_valid = ast_ari_validate_channel(
2679  if (!prop_is_valid) {
2680  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_link_first_leg failed validation\n");
2681  res = 0;
2682  }
2683  } else
2684  if (strcmp("destination_link_second_leg", ast_json_object_iter_key(iter)) == 0) {
2685  int prop_is_valid;
2686  prop_is_valid = ast_ari_validate_channel(
2688  if (!prop_is_valid) {
2689  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_link_second_leg failed validation\n");
2690  res = 0;
2691  }
2692  } else
2693  if (strcmp("destination_threeway_bridge", ast_json_object_iter_key(iter)) == 0) {
2694  int prop_is_valid;
2695  prop_is_valid = ast_ari_validate_bridge(
2697  if (!prop_is_valid) {
2698  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_threeway_bridge failed validation\n");
2699  res = 0;
2700  }
2701  } else
2702  if (strcmp("destination_threeway_channel", ast_json_object_iter_key(iter)) == 0) {
2703  int prop_is_valid;
2704  prop_is_valid = ast_ari_validate_channel(
2706  if (!prop_is_valid) {
2707  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_threeway_channel failed validation\n");
2708  res = 0;
2709  }
2710  } else
2711  if (strcmp("destination_type", ast_json_object_iter_key(iter)) == 0) {
2712  int prop_is_valid;
2713  has_destination_type = 1;
2714  prop_is_valid = ast_ari_validate_string(
2716  if (!prop_is_valid) {
2717  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field destination_type failed validation\n");
2718  res = 0;
2719  }
2720  } else
2721  if (strcmp("is_external", ast_json_object_iter_key(iter)) == 0) {
2722  int prop_is_valid;
2723  has_is_external = 1;
2724  prop_is_valid = ast_ari_validate_boolean(
2726  if (!prop_is_valid) {
2727  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field is_external failed validation\n");
2728  res = 0;
2729  }
2730  } else
2731  if (strcmp("replace_channel", ast_json_object_iter_key(iter)) == 0) {
2732  int prop_is_valid;
2733  prop_is_valid = ast_ari_validate_channel(
2735  if (!prop_is_valid) {
2736  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field replace_channel failed validation\n");
2737  res = 0;
2738  }
2739  } else
2740  if (strcmp("result", ast_json_object_iter_key(iter)) == 0) {
2741  int prop_is_valid;
2742  has_result = 1;
2743  prop_is_valid = ast_ari_validate_string(
2745  if (!prop_is_valid) {
2746  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field result failed validation\n");
2747  res = 0;
2748  }
2749  } else
2750  if (strcmp("transfer_target", ast_json_object_iter_key(iter)) == 0) {
2751  int prop_is_valid;
2752  prop_is_valid = ast_ari_validate_channel(
2754  if (!prop_is_valid) {
2755  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transfer_target failed validation\n");
2756  res = 0;
2757  }
2758  } else
2759  if (strcmp("transferee", ast_json_object_iter_key(iter)) == 0) {
2760  int prop_is_valid;
2761  prop_is_valid = ast_ari_validate_channel(
2763  if (!prop_is_valid) {
2764  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferee failed validation\n");
2765  res = 0;
2766  }
2767  } else
2768  if (strcmp("transferer_first_leg", ast_json_object_iter_key(iter)) == 0) {
2769  int prop_is_valid;
2770  has_transferer_first_leg = 1;
2771  prop_is_valid = ast_ari_validate_channel(
2773  if (!prop_is_valid) {
2774  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_first_leg failed validation\n");
2775  res = 0;
2776  }
2777  } else
2778  if (strcmp("transferer_first_leg_bridge", ast_json_object_iter_key(iter)) == 0) {
2779  int prop_is_valid;
2780  prop_is_valid = ast_ari_validate_bridge(
2782  if (!prop_is_valid) {
2783  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_first_leg_bridge failed validation\n");
2784  res = 0;
2785  }
2786  } else
2787  if (strcmp("transferer_second_leg", ast_json_object_iter_key(iter)) == 0) {
2788  int prop_is_valid;
2789  has_transferer_second_leg = 1;
2790  prop_is_valid = ast_ari_validate_channel(
2792  if (!prop_is_valid) {
2793  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_second_leg failed validation\n");
2794  res = 0;
2795  }
2796  } else
2797  if (strcmp("transferer_second_leg_bridge", ast_json_object_iter_key(iter)) == 0) {
2798  int prop_is_valid;
2799  prop_is_valid = ast_ari_validate_bridge(
2801  if (!prop_is_valid) {
2802  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer field transferer_second_leg_bridge failed validation\n");
2803  res = 0;
2804  }
2805  } else
2806  {
2808  "ARI BridgeAttendedTransfer has undocumented field %s\n",
2809  ast_json_object_iter_key(iter));
2810  res = 0;
2811  }
2812  }
2813 
2814  if (!has_type) {
2815  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field type\n");
2816  res = 0;
2817  }
2818 
2819  if (!has_application) {
2820  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field application\n");
2821  res = 0;
2822  }
2823 
2824  if (!has_timestamp) {
2825  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field timestamp\n");
2826  res = 0;
2827  }
2828 
2829  if (!has_destination_type) {
2830  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field destination_type\n");
2831  res = 0;
2832  }
2833 
2834  if (!has_is_external) {
2835  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field is_external\n");
2836  res = 0;
2837  }
2838 
2839  if (!has_result) {
2840  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field result\n");
2841  res = 0;
2842  }
2843 
2844  if (!has_transferer_first_leg) {
2845  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field transferer_first_leg\n");
2846  res = 0;
2847  }
2848 
2849  if (!has_transferer_second_leg) {
2850  ast_log(LOG_ERROR, "ARI BridgeAttendedTransfer missing required field transferer_second_leg\n");
2851  res = 0;
2852  }
2853 
2854  return res;
2855 }
2856 
2858 {
2860 }
2861 
2863 {
2864  int res = 1;
2865  struct ast_json_iter *iter;
2866  int has_type = 0;
2867  int has_application = 0;
2868  int has_timestamp = 0;
2869  int has_channel = 0;
2870  int has_context = 0;
2871  int has_exten = 0;
2872  int has_is_external = 0;
2873  int has_result = 0;
2874 
2875  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
2876  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
2877  int prop_is_valid;
2878  prop_is_valid = ast_ari_validate_string(
2880  if (!prop_is_valid) {
2881  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field asterisk_id failed validation\n");
2882  res = 0;
2883  }
2884  } else
2885  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
2886  int prop_is_valid;
2887  has_type = 1;
2888  prop_is_valid = ast_ari_validate_string(
2890  if (!prop_is_valid) {
2891  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field type failed validation\n");
2892  res = 0;
2893  }
2894  } else
2895  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
2896  int prop_is_valid;
2897  has_application = 1;
2898  prop_is_valid = ast_ari_validate_string(
2900  if (!prop_is_valid) {
2901  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field application failed validation\n");
2902  res = 0;
2903  }
2904  } else
2905  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
2906  int prop_is_valid;
2907  has_timestamp = 1;
2908  prop_is_valid = ast_ari_validate_date(
2910  if (!prop_is_valid) {
2911  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field timestamp failed validation\n");
2912  res = 0;
2913  }
2914  } else
2915  if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
2916  int prop_is_valid;
2917  prop_is_valid = ast_ari_validate_bridge(
2919  if (!prop_is_valid) {
2920  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field bridge failed validation\n");
2921  res = 0;
2922  }
2923  } else
2924  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
2925  int prop_is_valid;
2926  has_channel = 1;
2927  prop_is_valid = ast_ari_validate_channel(
2929  if (!prop_is_valid) {
2930  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field channel failed validation\n");
2931  res = 0;
2932  }
2933  } else
2934  if (strcmp("context", ast_json_object_iter_key(iter)) == 0) {
2935  int prop_is_valid;
2936  has_context = 1;
2937  prop_is_valid = ast_ari_validate_string(
2939  if (!prop_is_valid) {
2940  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field context failed validation\n");
2941  res = 0;
2942  }
2943  } else
2944  if (strcmp("exten", ast_json_object_iter_key(iter)) == 0) {
2945  int prop_is_valid;
2946  has_exten = 1;
2947  prop_is_valid = ast_ari_validate_string(
2949  if (!prop_is_valid) {
2950  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field exten failed validation\n");
2951  res = 0;
2952  }
2953  } else
2954  if (strcmp("is_external", ast_json_object_iter_key(iter)) == 0) {
2955  int prop_is_valid;
2956  has_is_external = 1;
2957  prop_is_valid = ast_ari_validate_boolean(
2959  if (!prop_is_valid) {
2960  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field is_external failed validation\n");
2961  res = 0;
2962  }
2963  } else
2964  if (strcmp("replace_channel", ast_json_object_iter_key(iter)) == 0) {
2965  int prop_is_valid;
2966  prop_is_valid = ast_ari_validate_channel(
2968  if (!prop_is_valid) {
2969  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field replace_channel failed validation\n");
2970  res = 0;
2971  }
2972  } else
2973  if (strcmp("result", ast_json_object_iter_key(iter)) == 0) {
2974  int prop_is_valid;
2975  has_result = 1;
2976  prop_is_valid = ast_ari_validate_string(
2978  if (!prop_is_valid) {
2979  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field result failed validation\n");
2980  res = 0;
2981  }
2982  } else
2983  if (strcmp("transferee", ast_json_object_iter_key(iter)) == 0) {
2984  int prop_is_valid;
2985  prop_is_valid = ast_ari_validate_channel(
2987  if (!prop_is_valid) {
2988  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer field transferee failed validation\n");
2989  res = 0;
2990  }
2991  } else
2992  {
2994  "ARI BridgeBlindTransfer has undocumented field %s\n",
2995  ast_json_object_iter_key(iter));
2996  res = 0;
2997  }
2998  }
2999 
3000  if (!has_type) {
3001  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field type\n");
3002  res = 0;
3003  }
3004 
3005  if (!has_application) {
3006  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field application\n");
3007  res = 0;
3008  }
3009 
3010  if (!has_timestamp) {
3011  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field timestamp\n");
3012  res = 0;
3013  }
3014 
3015  if (!has_channel) {
3016  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field channel\n");
3017  res = 0;
3018  }
3019 
3020  if (!has_context) {
3021  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field context\n");
3022  res = 0;
3023  }
3024 
3025  if (!has_exten) {
3026  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field exten\n");
3027  res = 0;
3028  }
3029 
3030  if (!has_is_external) {
3031  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field is_external\n");
3032  res = 0;
3033  }
3034 
3035  if (!has_result) {
3036  ast_log(LOG_ERROR, "ARI BridgeBlindTransfer missing required field result\n");
3037  res = 0;
3038  }
3039 
3040  return res;
3041 }
3042 
3044 {
3046 }
3047 
3049 {
3050  int res = 1;
3051  struct ast_json_iter *iter;
3052  int has_type = 0;
3053  int has_application = 0;
3054  int has_timestamp = 0;
3055  int has_bridge = 0;
3056 
3057  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3058  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3059  int prop_is_valid;
3060  prop_is_valid = ast_ari_validate_string(
3062  if (!prop_is_valid) {
3063  ast_log(LOG_ERROR, "ARI BridgeCreated field asterisk_id failed validation\n");
3064  res = 0;
3065  }
3066  } else
3067  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3068  int prop_is_valid;
3069  has_type = 1;
3070  prop_is_valid = ast_ari_validate_string(
3072  if (!prop_is_valid) {
3073  ast_log(LOG_ERROR, "ARI BridgeCreated field type failed validation\n");
3074  res = 0;
3075  }
3076  } else
3077  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3078  int prop_is_valid;
3079  has_application = 1;
3080  prop_is_valid = ast_ari_validate_string(
3082  if (!prop_is_valid) {
3083  ast_log(LOG_ERROR, "ARI BridgeCreated field application failed validation\n");
3084  res = 0;
3085  }
3086  } else
3087  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3088  int prop_is_valid;
3089  has_timestamp = 1;
3090  prop_is_valid = ast_ari_validate_date(
3092  if (!prop_is_valid) {
3093  ast_log(LOG_ERROR, "ARI BridgeCreated field timestamp failed validation\n");
3094  res = 0;
3095  }
3096  } else
3097  if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3098  int prop_is_valid;
3099  has_bridge = 1;
3100  prop_is_valid = ast_ari_validate_bridge(
3102  if (!prop_is_valid) {
3103  ast_log(LOG_ERROR, "ARI BridgeCreated field bridge failed validation\n");
3104  res = 0;
3105  }
3106  } else
3107  {
3109  "ARI BridgeCreated has undocumented field %s\n",
3110  ast_json_object_iter_key(iter));
3111  res = 0;
3112  }
3113  }
3114 
3115  if (!has_type) {
3116  ast_log(LOG_ERROR, "ARI BridgeCreated missing required field type\n");
3117  res = 0;
3118  }
3119 
3120  if (!has_application) {
3121  ast_log(LOG_ERROR, "ARI BridgeCreated missing required field application\n");
3122  res = 0;
3123  }
3124 
3125  if (!has_timestamp) {
3126  ast_log(LOG_ERROR, "ARI BridgeCreated missing required field timestamp\n");
3127  res = 0;
3128  }
3129 
3130  if (!has_bridge) {
3131  ast_log(LOG_ERROR, "ARI BridgeCreated missing required field bridge\n");
3132  res = 0;
3133  }
3134 
3135  return res;
3136 }
3137 
3139 {
3141 }
3142 
3144 {
3145  int res = 1;
3146  struct ast_json_iter *iter;
3147  int has_type = 0;
3148  int has_application = 0;
3149  int has_timestamp = 0;
3150  int has_bridge = 0;
3151 
3152  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3153  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3154  int prop_is_valid;
3155  prop_is_valid = ast_ari_validate_string(
3157  if (!prop_is_valid) {
3158  ast_log(LOG_ERROR, "ARI BridgeDestroyed field asterisk_id failed validation\n");
3159  res = 0;
3160  }
3161  } else
3162  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3163  int prop_is_valid;
3164  has_type = 1;
3165  prop_is_valid = ast_ari_validate_string(
3167  if (!prop_is_valid) {
3168  ast_log(LOG_ERROR, "ARI BridgeDestroyed field type failed validation\n");
3169  res = 0;
3170  }
3171  } else
3172  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3173  int prop_is_valid;
3174  has_application = 1;
3175  prop_is_valid = ast_ari_validate_string(
3177  if (!prop_is_valid) {
3178  ast_log(LOG_ERROR, "ARI BridgeDestroyed field application failed validation\n");
3179  res = 0;
3180  }
3181  } else
3182  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3183  int prop_is_valid;
3184  has_timestamp = 1;
3185  prop_is_valid = ast_ari_validate_date(
3187  if (!prop_is_valid) {
3188  ast_log(LOG_ERROR, "ARI BridgeDestroyed field timestamp failed validation\n");
3189  res = 0;
3190  }
3191  } else
3192  if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3193  int prop_is_valid;
3194  has_bridge = 1;
3195  prop_is_valid = ast_ari_validate_bridge(
3197  if (!prop_is_valid) {
3198  ast_log(LOG_ERROR, "ARI BridgeDestroyed field bridge failed validation\n");
3199  res = 0;
3200  }
3201  } else
3202  {
3204  "ARI BridgeDestroyed has undocumented field %s\n",
3205  ast_json_object_iter_key(iter));
3206  res = 0;
3207  }
3208  }
3209 
3210  if (!has_type) {
3211  ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field type\n");
3212  res = 0;
3213  }
3214 
3215  if (!has_application) {
3216  ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field application\n");
3217  res = 0;
3218  }
3219 
3220  if (!has_timestamp) {
3221  ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field timestamp\n");
3222  res = 0;
3223  }
3224 
3225  if (!has_bridge) {
3226  ast_log(LOG_ERROR, "ARI BridgeDestroyed missing required field bridge\n");
3227  res = 0;
3228  }
3229 
3230  return res;
3231 }
3232 
3234 {
3236 }
3237 
3239 {
3240  int res = 1;
3241  struct ast_json_iter *iter;
3242  int has_type = 0;
3243  int has_application = 0;
3244  int has_timestamp = 0;
3245  int has_bridge = 0;
3246  int has_bridge_from = 0;
3247 
3248  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3249  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3250  int prop_is_valid;
3251  prop_is_valid = ast_ari_validate_string(
3253  if (!prop_is_valid) {
3254  ast_log(LOG_ERROR, "ARI BridgeMerged field asterisk_id failed validation\n");
3255  res = 0;
3256  }
3257  } else
3258  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3259  int prop_is_valid;
3260  has_type = 1;
3261  prop_is_valid = ast_ari_validate_string(
3263  if (!prop_is_valid) {
3264  ast_log(LOG_ERROR, "ARI BridgeMerged field type failed validation\n");
3265  res = 0;
3266  }
3267  } else
3268  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3269  int prop_is_valid;
3270  has_application = 1;
3271  prop_is_valid = ast_ari_validate_string(
3273  if (!prop_is_valid) {
3274  ast_log(LOG_ERROR, "ARI BridgeMerged field application failed validation\n");
3275  res = 0;
3276  }
3277  } else
3278  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3279  int prop_is_valid;
3280  has_timestamp = 1;
3281  prop_is_valid = ast_ari_validate_date(
3283  if (!prop_is_valid) {
3284  ast_log(LOG_ERROR, "ARI BridgeMerged field timestamp failed validation\n");
3285  res = 0;
3286  }
3287  } else
3288  if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3289  int prop_is_valid;
3290  has_bridge = 1;
3291  prop_is_valid = ast_ari_validate_bridge(
3293  if (!prop_is_valid) {
3294  ast_log(LOG_ERROR, "ARI BridgeMerged field bridge failed validation\n");
3295  res = 0;
3296  }
3297  } else
3298  if (strcmp("bridge_from", ast_json_object_iter_key(iter)) == 0) {
3299  int prop_is_valid;
3300  has_bridge_from = 1;
3301  prop_is_valid = ast_ari_validate_bridge(
3303  if (!prop_is_valid) {
3304  ast_log(LOG_ERROR, "ARI BridgeMerged field bridge_from failed validation\n");
3305  res = 0;
3306  }
3307  } else
3308  {
3310  "ARI BridgeMerged has undocumented field %s\n",
3311  ast_json_object_iter_key(iter));
3312  res = 0;
3313  }
3314  }
3315 
3316  if (!has_type) {
3317  ast_log(LOG_ERROR, "ARI BridgeMerged missing required field type\n");
3318  res = 0;
3319  }
3320 
3321  if (!has_application) {
3322  ast_log(LOG_ERROR, "ARI BridgeMerged missing required field application\n");
3323  res = 0;
3324  }
3325 
3326  if (!has_timestamp) {
3327  ast_log(LOG_ERROR, "ARI BridgeMerged missing required field timestamp\n");
3328  res = 0;
3329  }
3330 
3331  if (!has_bridge) {
3332  ast_log(LOG_ERROR, "ARI BridgeMerged missing required field bridge\n");
3333  res = 0;
3334  }
3335 
3336  if (!has_bridge_from) {
3337  ast_log(LOG_ERROR, "ARI BridgeMerged missing required field bridge_from\n");
3338  res = 0;
3339  }
3340 
3341  return res;
3342 }
3343 
3345 {
3347 }
3348 
3350 {
3351  int res = 1;
3352  struct ast_json_iter *iter;
3353  int has_type = 0;
3354  int has_application = 0;
3355  int has_timestamp = 0;
3356  int has_bridge = 0;
3357 
3358  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3359  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3360  int prop_is_valid;
3361  prop_is_valid = ast_ari_validate_string(
3363  if (!prop_is_valid) {
3364  ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field asterisk_id failed validation\n");
3365  res = 0;
3366  }
3367  } else
3368  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3369  int prop_is_valid;
3370  has_type = 1;
3371  prop_is_valid = ast_ari_validate_string(
3373  if (!prop_is_valid) {
3374  ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field type failed validation\n");
3375  res = 0;
3376  }
3377  } else
3378  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3379  int prop_is_valid;
3380  has_application = 1;
3381  prop_is_valid = ast_ari_validate_string(
3383  if (!prop_is_valid) {
3384  ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field application failed validation\n");
3385  res = 0;
3386  }
3387  } else
3388  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3389  int prop_is_valid;
3390  has_timestamp = 1;
3391  prop_is_valid = ast_ari_validate_date(
3393  if (!prop_is_valid) {
3394  ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field timestamp failed validation\n");
3395  res = 0;
3396  }
3397  } else
3398  if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
3399  int prop_is_valid;
3400  has_bridge = 1;
3401  prop_is_valid = ast_ari_validate_bridge(
3403  if (!prop_is_valid) {
3404  ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field bridge failed validation\n");
3405  res = 0;
3406  }
3407  } else
3408  if (strcmp("old_video_source_id", ast_json_object_iter_key(iter)) == 0) {
3409  int prop_is_valid;
3410  prop_is_valid = ast_ari_validate_string(
3412  if (!prop_is_valid) {
3413  ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged field old_video_source_id failed validation\n");
3414  res = 0;
3415  }
3416  } else
3417  {
3419  "ARI BridgeVideoSourceChanged has undocumented field %s\n",
3420  ast_json_object_iter_key(iter));
3421  res = 0;
3422  }
3423  }
3424 
3425  if (!has_type) {
3426  ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field type\n");
3427  res = 0;
3428  }
3429 
3430  if (!has_application) {
3431  ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field application\n");
3432  res = 0;
3433  }
3434 
3435  if (!has_timestamp) {
3436  ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field timestamp\n");
3437  res = 0;
3438  }
3439 
3440  if (!has_bridge) {
3441  ast_log(LOG_ERROR, "ARI BridgeVideoSourceChanged missing required field bridge\n");
3442  res = 0;
3443  }
3444 
3445  return res;
3446 }
3447 
3449 {
3451 }
3452 
3454 {
3455  int res = 1;
3456  struct ast_json_iter *iter;
3457  int has_type = 0;
3458  int has_application = 0;
3459  int has_timestamp = 0;
3460  int has_caller_presentation = 0;
3461  int has_caller_presentation_txt = 0;
3462  int has_channel = 0;
3463 
3464  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3465  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3466  int prop_is_valid;
3467  prop_is_valid = ast_ari_validate_string(
3469  if (!prop_is_valid) {
3470  ast_log(LOG_ERROR, "ARI ChannelCallerId field asterisk_id failed validation\n");
3471  res = 0;
3472  }
3473  } else
3474  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3475  int prop_is_valid;
3476  has_type = 1;
3477  prop_is_valid = ast_ari_validate_string(
3479  if (!prop_is_valid) {
3480  ast_log(LOG_ERROR, "ARI ChannelCallerId field type failed validation\n");
3481  res = 0;
3482  }
3483  } else
3484  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3485  int prop_is_valid;
3486  has_application = 1;
3487  prop_is_valid = ast_ari_validate_string(
3489  if (!prop_is_valid) {
3490  ast_log(LOG_ERROR, "ARI ChannelCallerId field application failed validation\n");
3491  res = 0;
3492  }
3493  } else
3494  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3495  int prop_is_valid;
3496  has_timestamp = 1;
3497  prop_is_valid = ast_ari_validate_date(
3499  if (!prop_is_valid) {
3500  ast_log(LOG_ERROR, "ARI ChannelCallerId field timestamp failed validation\n");
3501  res = 0;
3502  }
3503  } else
3504  if (strcmp("caller_presentation", ast_json_object_iter_key(iter)) == 0) {
3505  int prop_is_valid;
3506  has_caller_presentation = 1;
3507  prop_is_valid = ast_ari_validate_int(
3509  if (!prop_is_valid) {
3510  ast_log(LOG_ERROR, "ARI ChannelCallerId field caller_presentation failed validation\n");
3511  res = 0;
3512  }
3513  } else
3514  if (strcmp("caller_presentation_txt", ast_json_object_iter_key(iter)) == 0) {
3515  int prop_is_valid;
3516  has_caller_presentation_txt = 1;
3517  prop_is_valid = ast_ari_validate_string(
3519  if (!prop_is_valid) {
3520  ast_log(LOG_ERROR, "ARI ChannelCallerId field caller_presentation_txt failed validation\n");
3521  res = 0;
3522  }
3523  } else
3524  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3525  int prop_is_valid;
3526  has_channel = 1;
3527  prop_is_valid = ast_ari_validate_channel(
3529  if (!prop_is_valid) {
3530  ast_log(LOG_ERROR, "ARI ChannelCallerId field channel failed validation\n");
3531  res = 0;
3532  }
3533  } else
3534  {
3536  "ARI ChannelCallerId has undocumented field %s\n",
3537  ast_json_object_iter_key(iter));
3538  res = 0;
3539  }
3540  }
3541 
3542  if (!has_type) {
3543  ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field type\n");
3544  res = 0;
3545  }
3546 
3547  if (!has_application) {
3548  ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field application\n");
3549  res = 0;
3550  }
3551 
3552  if (!has_timestamp) {
3553  ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field timestamp\n");
3554  res = 0;
3555  }
3556 
3557  if (!has_caller_presentation) {
3558  ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field caller_presentation\n");
3559  res = 0;
3560  }
3561 
3562  if (!has_caller_presentation_txt) {
3563  ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field caller_presentation_txt\n");
3564  res = 0;
3565  }
3566 
3567  if (!has_channel) {
3568  ast_log(LOG_ERROR, "ARI ChannelCallerId missing required field channel\n");
3569  res = 0;
3570  }
3571 
3572  return res;
3573 }
3574 
3576 {
3578 }
3579 
3581 {
3582  int res = 1;
3583  struct ast_json_iter *iter;
3584  int has_type = 0;
3585  int has_application = 0;
3586  int has_timestamp = 0;
3587  int has_channel = 0;
3588 
3589  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3590  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3591  int prop_is_valid;
3592  prop_is_valid = ast_ari_validate_string(
3594  if (!prop_is_valid) {
3595  ast_log(LOG_ERROR, "ARI ChannelConnectedLine field asterisk_id failed validation\n");
3596  res = 0;
3597  }
3598  } else
3599  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3600  int prop_is_valid;
3601  has_type = 1;
3602  prop_is_valid = ast_ari_validate_string(
3604  if (!prop_is_valid) {
3605  ast_log(LOG_ERROR, "ARI ChannelConnectedLine field type failed validation\n");
3606  res = 0;
3607  }
3608  } else
3609  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3610  int prop_is_valid;
3611  has_application = 1;
3612  prop_is_valid = ast_ari_validate_string(
3614  if (!prop_is_valid) {
3615  ast_log(LOG_ERROR, "ARI ChannelConnectedLine field application failed validation\n");
3616  res = 0;
3617  }
3618  } else
3619  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3620  int prop_is_valid;
3621  has_timestamp = 1;
3622  prop_is_valid = ast_ari_validate_date(
3624  if (!prop_is_valid) {
3625  ast_log(LOG_ERROR, "ARI ChannelConnectedLine field timestamp failed validation\n");
3626  res = 0;
3627  }
3628  } else
3629  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3630  int prop_is_valid;
3631  has_channel = 1;
3632  prop_is_valid = ast_ari_validate_channel(
3634  if (!prop_is_valid) {
3635  ast_log(LOG_ERROR, "ARI ChannelConnectedLine field channel failed validation\n");
3636  res = 0;
3637  }
3638  } else
3639  {
3641  "ARI ChannelConnectedLine has undocumented field %s\n",
3642  ast_json_object_iter_key(iter));
3643  res = 0;
3644  }
3645  }
3646 
3647  if (!has_type) {
3648  ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field type\n");
3649  res = 0;
3650  }
3651 
3652  if (!has_application) {
3653  ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field application\n");
3654  res = 0;
3655  }
3656 
3657  if (!has_timestamp) {
3658  ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field timestamp\n");
3659  res = 0;
3660  }
3661 
3662  if (!has_channel) {
3663  ast_log(LOG_ERROR, "ARI ChannelConnectedLine missing required field channel\n");
3664  res = 0;
3665  }
3666 
3667  return res;
3668 }
3669 
3671 {
3673 }
3674 
3676 {
3677  int res = 1;
3678  struct ast_json_iter *iter;
3679  int has_type = 0;
3680  int has_application = 0;
3681  int has_timestamp = 0;
3682  int has_channel = 0;
3683 
3684  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3685  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3686  int prop_is_valid;
3687  prop_is_valid = ast_ari_validate_string(
3689  if (!prop_is_valid) {
3690  ast_log(LOG_ERROR, "ARI ChannelCreated field asterisk_id failed validation\n");
3691  res = 0;
3692  }
3693  } else
3694  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3695  int prop_is_valid;
3696  has_type = 1;
3697  prop_is_valid = ast_ari_validate_string(
3699  if (!prop_is_valid) {
3700  ast_log(LOG_ERROR, "ARI ChannelCreated field type failed validation\n");
3701  res = 0;
3702  }
3703  } else
3704  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3705  int prop_is_valid;
3706  has_application = 1;
3707  prop_is_valid = ast_ari_validate_string(
3709  if (!prop_is_valid) {
3710  ast_log(LOG_ERROR, "ARI ChannelCreated field application failed validation\n");
3711  res = 0;
3712  }
3713  } else
3714  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3715  int prop_is_valid;
3716  has_timestamp = 1;
3717  prop_is_valid = ast_ari_validate_date(
3719  if (!prop_is_valid) {
3720  ast_log(LOG_ERROR, "ARI ChannelCreated field timestamp failed validation\n");
3721  res = 0;
3722  }
3723  } else
3724  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3725  int prop_is_valid;
3726  has_channel = 1;
3727  prop_is_valid = ast_ari_validate_channel(
3729  if (!prop_is_valid) {
3730  ast_log(LOG_ERROR, "ARI ChannelCreated field channel failed validation\n");
3731  res = 0;
3732  }
3733  } else
3734  {
3736  "ARI ChannelCreated has undocumented field %s\n",
3737  ast_json_object_iter_key(iter));
3738  res = 0;
3739  }
3740  }
3741 
3742  if (!has_type) {
3743  ast_log(LOG_ERROR, "ARI ChannelCreated missing required field type\n");
3744  res = 0;
3745  }
3746 
3747  if (!has_application) {
3748  ast_log(LOG_ERROR, "ARI ChannelCreated missing required field application\n");
3749  res = 0;
3750  }
3751 
3752  if (!has_timestamp) {
3753  ast_log(LOG_ERROR, "ARI ChannelCreated missing required field timestamp\n");
3754  res = 0;
3755  }
3756 
3757  if (!has_channel) {
3758  ast_log(LOG_ERROR, "ARI ChannelCreated missing required field channel\n");
3759  res = 0;
3760  }
3761 
3762  return res;
3763 }
3764 
3766 {
3768 }
3769 
3771 {
3772  int res = 1;
3773  struct ast_json_iter *iter;
3774  int has_type = 0;
3775  int has_application = 0;
3776  int has_timestamp = 0;
3777  int has_cause = 0;
3778  int has_cause_txt = 0;
3779  int has_channel = 0;
3780 
3781  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3782  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3783  int prop_is_valid;
3784  prop_is_valid = ast_ari_validate_string(
3786  if (!prop_is_valid) {
3787  ast_log(LOG_ERROR, "ARI ChannelDestroyed field asterisk_id failed validation\n");
3788  res = 0;
3789  }
3790  } else
3791  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3792  int prop_is_valid;
3793  has_type = 1;
3794  prop_is_valid = ast_ari_validate_string(
3796  if (!prop_is_valid) {
3797  ast_log(LOG_ERROR, "ARI ChannelDestroyed field type failed validation\n");
3798  res = 0;
3799  }
3800  } else
3801  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3802  int prop_is_valid;
3803  has_application = 1;
3804  prop_is_valid = ast_ari_validate_string(
3806  if (!prop_is_valid) {
3807  ast_log(LOG_ERROR, "ARI ChannelDestroyed field application failed validation\n");
3808  res = 0;
3809  }
3810  } else
3811  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3812  int prop_is_valid;
3813  has_timestamp = 1;
3814  prop_is_valid = ast_ari_validate_date(
3816  if (!prop_is_valid) {
3817  ast_log(LOG_ERROR, "ARI ChannelDestroyed field timestamp failed validation\n");
3818  res = 0;
3819  }
3820  } else
3821  if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
3822  int prop_is_valid;
3823  has_cause = 1;
3824  prop_is_valid = ast_ari_validate_int(
3826  if (!prop_is_valid) {
3827  ast_log(LOG_ERROR, "ARI ChannelDestroyed field cause failed validation\n");
3828  res = 0;
3829  }
3830  } else
3831  if (strcmp("cause_txt", ast_json_object_iter_key(iter)) == 0) {
3832  int prop_is_valid;
3833  has_cause_txt = 1;
3834  prop_is_valid = ast_ari_validate_string(
3836  if (!prop_is_valid) {
3837  ast_log(LOG_ERROR, "ARI ChannelDestroyed field cause_txt failed validation\n");
3838  res = 0;
3839  }
3840  } else
3841  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3842  int prop_is_valid;
3843  has_channel = 1;
3844  prop_is_valid = ast_ari_validate_channel(
3846  if (!prop_is_valid) {
3847  ast_log(LOG_ERROR, "ARI ChannelDestroyed field channel failed validation\n");
3848  res = 0;
3849  }
3850  } else
3851  {
3853  "ARI ChannelDestroyed has undocumented field %s\n",
3854  ast_json_object_iter_key(iter));
3855  res = 0;
3856  }
3857  }
3858 
3859  if (!has_type) {
3860  ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field type\n");
3861  res = 0;
3862  }
3863 
3864  if (!has_application) {
3865  ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field application\n");
3866  res = 0;
3867  }
3868 
3869  if (!has_timestamp) {
3870  ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field timestamp\n");
3871  res = 0;
3872  }
3873 
3874  if (!has_cause) {
3875  ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field cause\n");
3876  res = 0;
3877  }
3878 
3879  if (!has_cause_txt) {
3880  ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field cause_txt\n");
3881  res = 0;
3882  }
3883 
3884  if (!has_channel) {
3885  ast_log(LOG_ERROR, "ARI ChannelDestroyed missing required field channel\n");
3886  res = 0;
3887  }
3888 
3889  return res;
3890 }
3891 
3893 {
3895 }
3896 
3898 {
3899  int res = 1;
3900  struct ast_json_iter *iter;
3901  int has_type = 0;
3902  int has_application = 0;
3903  int has_timestamp = 0;
3904  int has_channel = 0;
3905  int has_dialplan_app = 0;
3906  int has_dialplan_app_data = 0;
3907 
3908  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
3909  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
3910  int prop_is_valid;
3911  prop_is_valid = ast_ari_validate_string(
3913  if (!prop_is_valid) {
3914  ast_log(LOG_ERROR, "ARI ChannelDialplan field asterisk_id failed validation\n");
3915  res = 0;
3916  }
3917  } else
3918  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
3919  int prop_is_valid;
3920  has_type = 1;
3921  prop_is_valid = ast_ari_validate_string(
3923  if (!prop_is_valid) {
3924  ast_log(LOG_ERROR, "ARI ChannelDialplan field type failed validation\n");
3925  res = 0;
3926  }
3927  } else
3928  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
3929  int prop_is_valid;
3930  has_application = 1;
3931  prop_is_valid = ast_ari_validate_string(
3933  if (!prop_is_valid) {
3934  ast_log(LOG_ERROR, "ARI ChannelDialplan field application failed validation\n");
3935  res = 0;
3936  }
3937  } else
3938  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
3939  int prop_is_valid;
3940  has_timestamp = 1;
3941  prop_is_valid = ast_ari_validate_date(
3943  if (!prop_is_valid) {
3944  ast_log(LOG_ERROR, "ARI ChannelDialplan field timestamp failed validation\n");
3945  res = 0;
3946  }
3947  } else
3948  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
3949  int prop_is_valid;
3950  has_channel = 1;
3951  prop_is_valid = ast_ari_validate_channel(
3953  if (!prop_is_valid) {
3954  ast_log(LOG_ERROR, "ARI ChannelDialplan field channel failed validation\n");
3955  res = 0;
3956  }
3957  } else
3958  if (strcmp("dialplan_app", ast_json_object_iter_key(iter)) == 0) {
3959  int prop_is_valid;
3960  has_dialplan_app = 1;
3961  prop_is_valid = ast_ari_validate_string(
3963  if (!prop_is_valid) {
3964  ast_log(LOG_ERROR, "ARI ChannelDialplan field dialplan_app failed validation\n");
3965  res = 0;
3966  }
3967  } else
3968  if (strcmp("dialplan_app_data", ast_json_object_iter_key(iter)) == 0) {
3969  int prop_is_valid;
3970  has_dialplan_app_data = 1;
3971  prop_is_valid = ast_ari_validate_string(
3973  if (!prop_is_valid) {
3974  ast_log(LOG_ERROR, "ARI ChannelDialplan field dialplan_app_data failed validation\n");
3975  res = 0;
3976  }
3977  } else
3978  {
3980  "ARI ChannelDialplan has undocumented field %s\n",
3981  ast_json_object_iter_key(iter));
3982  res = 0;
3983  }
3984  }
3985 
3986  if (!has_type) {
3987  ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field type\n");
3988  res = 0;
3989  }
3990 
3991  if (!has_application) {
3992  ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field application\n");
3993  res = 0;
3994  }
3995 
3996  if (!has_timestamp) {
3997  ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field timestamp\n");
3998  res = 0;
3999  }
4000 
4001  if (!has_channel) {
4002  ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field channel\n");
4003  res = 0;
4004  }
4005 
4006  if (!has_dialplan_app) {
4007  ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field dialplan_app\n");
4008  res = 0;
4009  }
4010 
4011  if (!has_dialplan_app_data) {
4012  ast_log(LOG_ERROR, "ARI ChannelDialplan missing required field dialplan_app_data\n");
4013  res = 0;
4014  }
4015 
4016  return res;
4017 }
4018 
4020 {
4022 }
4023 
4025 {
4026  int res = 1;
4027  struct ast_json_iter *iter;
4028  int has_type = 0;
4029  int has_application = 0;
4030  int has_timestamp = 0;
4031  int has_channel = 0;
4032  int has_digit = 0;
4033  int has_duration_ms = 0;
4034 
4035  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4036  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4037  int prop_is_valid;
4038  prop_is_valid = ast_ari_validate_string(
4040  if (!prop_is_valid) {
4041  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field asterisk_id failed validation\n");
4042  res = 0;
4043  }
4044  } else
4045  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4046  int prop_is_valid;
4047  has_type = 1;
4048  prop_is_valid = ast_ari_validate_string(
4050  if (!prop_is_valid) {
4051  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field type failed validation\n");
4052  res = 0;
4053  }
4054  } else
4055  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4056  int prop_is_valid;
4057  has_application = 1;
4058  prop_is_valid = ast_ari_validate_string(
4060  if (!prop_is_valid) {
4061  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field application failed validation\n");
4062  res = 0;
4063  }
4064  } else
4065  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4066  int prop_is_valid;
4067  has_timestamp = 1;
4068  prop_is_valid = ast_ari_validate_date(
4070  if (!prop_is_valid) {
4071  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field timestamp failed validation\n");
4072  res = 0;
4073  }
4074  } else
4075  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4076  int prop_is_valid;
4077  has_channel = 1;
4078  prop_is_valid = ast_ari_validate_channel(
4080  if (!prop_is_valid) {
4081  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field channel failed validation\n");
4082  res = 0;
4083  }
4084  } else
4085  if (strcmp("digit", ast_json_object_iter_key(iter)) == 0) {
4086  int prop_is_valid;
4087  has_digit = 1;
4088  prop_is_valid = ast_ari_validate_string(
4090  if (!prop_is_valid) {
4091  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field digit failed validation\n");
4092  res = 0;
4093  }
4094  } else
4095  if (strcmp("duration_ms", ast_json_object_iter_key(iter)) == 0) {
4096  int prop_is_valid;
4097  has_duration_ms = 1;
4098  prop_is_valid = ast_ari_validate_int(
4100  if (!prop_is_valid) {
4101  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived field duration_ms failed validation\n");
4102  res = 0;
4103  }
4104  } else
4105  {
4107  "ARI ChannelDtmfReceived has undocumented field %s\n",
4108  ast_json_object_iter_key(iter));
4109  res = 0;
4110  }
4111  }
4112 
4113  if (!has_type) {
4114  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field type\n");
4115  res = 0;
4116  }
4117 
4118  if (!has_application) {
4119  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field application\n");
4120  res = 0;
4121  }
4122 
4123  if (!has_timestamp) {
4124  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field timestamp\n");
4125  res = 0;
4126  }
4127 
4128  if (!has_channel) {
4129  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field channel\n");
4130  res = 0;
4131  }
4132 
4133  if (!has_digit) {
4134  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field digit\n");
4135  res = 0;
4136  }
4137 
4138  if (!has_duration_ms) {
4139  ast_log(LOG_ERROR, "ARI ChannelDtmfReceived missing required field duration_ms\n");
4140  res = 0;
4141  }
4142 
4143  return res;
4144 }
4145 
4147 {
4149 }
4150 
4152 {
4153  int res = 1;
4154  struct ast_json_iter *iter;
4155  int has_type = 0;
4156  int has_application = 0;
4157  int has_timestamp = 0;
4158  int has_bridge = 0;
4159 
4160  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4161  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4162  int prop_is_valid;
4163  prop_is_valid = ast_ari_validate_string(
4165  if (!prop_is_valid) {
4166  ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field asterisk_id failed validation\n");
4167  res = 0;
4168  }
4169  } else
4170  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4171  int prop_is_valid;
4172  has_type = 1;
4173  prop_is_valid = ast_ari_validate_string(
4175  if (!prop_is_valid) {
4176  ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field type failed validation\n");
4177  res = 0;
4178  }
4179  } else
4180  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4181  int prop_is_valid;
4182  has_application = 1;
4183  prop_is_valid = ast_ari_validate_string(
4185  if (!prop_is_valid) {
4186  ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field application failed validation\n");
4187  res = 0;
4188  }
4189  } else
4190  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4191  int prop_is_valid;
4192  has_timestamp = 1;
4193  prop_is_valid = ast_ari_validate_date(
4195  if (!prop_is_valid) {
4196  ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field timestamp failed validation\n");
4197  res = 0;
4198  }
4199  } else
4200  if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
4201  int prop_is_valid;
4202  has_bridge = 1;
4203  prop_is_valid = ast_ari_validate_bridge(
4205  if (!prop_is_valid) {
4206  ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field bridge failed validation\n");
4207  res = 0;
4208  }
4209  } else
4210  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4211  int prop_is_valid;
4212  prop_is_valid = ast_ari_validate_channel(
4214  if (!prop_is_valid) {
4215  ast_log(LOG_ERROR, "ARI ChannelEnteredBridge field channel failed validation\n");
4216  res = 0;
4217  }
4218  } else
4219  {
4221  "ARI ChannelEnteredBridge has undocumented field %s\n",
4222  ast_json_object_iter_key(iter));
4223  res = 0;
4224  }
4225  }
4226 
4227  if (!has_type) {
4228  ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field type\n");
4229  res = 0;
4230  }
4231 
4232  if (!has_application) {
4233  ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field application\n");
4234  res = 0;
4235  }
4236 
4237  if (!has_timestamp) {
4238  ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field timestamp\n");
4239  res = 0;
4240  }
4241 
4242  if (!has_bridge) {
4243  ast_log(LOG_ERROR, "ARI ChannelEnteredBridge missing required field bridge\n");
4244  res = 0;
4245  }
4246 
4247  return res;
4248 }
4249 
4251 {
4253 }
4254 
4256 {
4257  int res = 1;
4258  struct ast_json_iter *iter;
4259  int has_type = 0;
4260  int has_application = 0;
4261  int has_timestamp = 0;
4262  int has_channel = 0;
4263 
4264  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4265  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4266  int prop_is_valid;
4267  prop_is_valid = ast_ari_validate_string(
4269  if (!prop_is_valid) {
4270  ast_log(LOG_ERROR, "ARI ChannelHangupRequest field asterisk_id failed validation\n");
4271  res = 0;
4272  }
4273  } else
4274  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4275  int prop_is_valid;
4276  has_type = 1;
4277  prop_is_valid = ast_ari_validate_string(
4279  if (!prop_is_valid) {
4280  ast_log(LOG_ERROR, "ARI ChannelHangupRequest field type failed validation\n");
4281  res = 0;
4282  }
4283  } else
4284  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4285  int prop_is_valid;
4286  has_application = 1;
4287  prop_is_valid = ast_ari_validate_string(
4289  if (!prop_is_valid) {
4290  ast_log(LOG_ERROR, "ARI ChannelHangupRequest field application failed validation\n");
4291  res = 0;
4292  }
4293  } else
4294  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4295  int prop_is_valid;
4296  has_timestamp = 1;
4297  prop_is_valid = ast_ari_validate_date(
4299  if (!prop_is_valid) {
4300  ast_log(LOG_ERROR, "ARI ChannelHangupRequest field timestamp failed validation\n");
4301  res = 0;
4302  }
4303  } else
4304  if (strcmp("cause", ast_json_object_iter_key(iter)) == 0) {
4305  int prop_is_valid;
4306  prop_is_valid = ast_ari_validate_int(
4308  if (!prop_is_valid) {
4309  ast_log(LOG_ERROR, "ARI ChannelHangupRequest field cause failed validation\n");
4310  res = 0;
4311  }
4312  } else
4313  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4314  int prop_is_valid;
4315  has_channel = 1;
4316  prop_is_valid = ast_ari_validate_channel(
4318  if (!prop_is_valid) {
4319  ast_log(LOG_ERROR, "ARI ChannelHangupRequest field channel failed validation\n");
4320  res = 0;
4321  }
4322  } else
4323  if (strcmp("soft", ast_json_object_iter_key(iter)) == 0) {
4324  int prop_is_valid;
4325  prop_is_valid = ast_ari_validate_boolean(
4327  if (!prop_is_valid) {
4328  ast_log(LOG_ERROR, "ARI ChannelHangupRequest field soft failed validation\n");
4329  res = 0;
4330  }
4331  } else
4332  {
4334  "ARI ChannelHangupRequest has undocumented field %s\n",
4335  ast_json_object_iter_key(iter));
4336  res = 0;
4337  }
4338  }
4339 
4340  if (!has_type) {
4341  ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field type\n");
4342  res = 0;
4343  }
4344 
4345  if (!has_application) {
4346  ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field application\n");
4347  res = 0;
4348  }
4349 
4350  if (!has_timestamp) {
4351  ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field timestamp\n");
4352  res = 0;
4353  }
4354 
4355  if (!has_channel) {
4356  ast_log(LOG_ERROR, "ARI ChannelHangupRequest missing required field channel\n");
4357  res = 0;
4358  }
4359 
4360  return res;
4361 }
4362 
4364 {
4366 }
4367 
4369 {
4370  int res = 1;
4371  struct ast_json_iter *iter;
4372  int has_type = 0;
4373  int has_application = 0;
4374  int has_timestamp = 0;
4375  int has_channel = 0;
4376 
4377  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4378  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4379  int prop_is_valid;
4380  prop_is_valid = ast_ari_validate_string(
4382  if (!prop_is_valid) {
4383  ast_log(LOG_ERROR, "ARI ChannelHold field asterisk_id failed validation\n");
4384  res = 0;
4385  }
4386  } else
4387  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4388  int prop_is_valid;
4389  has_type = 1;
4390  prop_is_valid = ast_ari_validate_string(
4392  if (!prop_is_valid) {
4393  ast_log(LOG_ERROR, "ARI ChannelHold field type failed validation\n");
4394  res = 0;
4395  }
4396  } else
4397  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4398  int prop_is_valid;
4399  has_application = 1;
4400  prop_is_valid = ast_ari_validate_string(
4402  if (!prop_is_valid) {
4403  ast_log(LOG_ERROR, "ARI ChannelHold field application failed validation\n");
4404  res = 0;
4405  }
4406  } else
4407  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4408  int prop_is_valid;
4409  has_timestamp = 1;
4410  prop_is_valid = ast_ari_validate_date(
4412  if (!prop_is_valid) {
4413  ast_log(LOG_ERROR, "ARI ChannelHold field timestamp failed validation\n");
4414  res = 0;
4415  }
4416  } else
4417  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4418  int prop_is_valid;
4419  has_channel = 1;
4420  prop_is_valid = ast_ari_validate_channel(
4422  if (!prop_is_valid) {
4423  ast_log(LOG_ERROR, "ARI ChannelHold field channel failed validation\n");
4424  res = 0;
4425  }
4426  } else
4427  if (strcmp("musicclass", ast_json_object_iter_key(iter)) == 0) {
4428  int prop_is_valid;
4429  prop_is_valid = ast_ari_validate_string(
4431  if (!prop_is_valid) {
4432  ast_log(LOG_ERROR, "ARI ChannelHold field musicclass failed validation\n");
4433  res = 0;
4434  }
4435  } else
4436  {
4438  "ARI ChannelHold has undocumented field %s\n",
4439  ast_json_object_iter_key(iter));
4440  res = 0;
4441  }
4442  }
4443 
4444  if (!has_type) {
4445  ast_log(LOG_ERROR, "ARI ChannelHold missing required field type\n");
4446  res = 0;
4447  }
4448 
4449  if (!has_application) {
4450  ast_log(LOG_ERROR, "ARI ChannelHold missing required field application\n");
4451  res = 0;
4452  }
4453 
4454  if (!has_timestamp) {
4455  ast_log(LOG_ERROR, "ARI ChannelHold missing required field timestamp\n");
4456  res = 0;
4457  }
4458 
4459  if (!has_channel) {
4460  ast_log(LOG_ERROR, "ARI ChannelHold missing required field channel\n");
4461  res = 0;
4462  }
4463 
4464  return res;
4465 }
4466 
4468 {
4470 }
4471 
4473 {
4474  int res = 1;
4475  struct ast_json_iter *iter;
4476  int has_type = 0;
4477  int has_application = 0;
4478  int has_timestamp = 0;
4479  int has_bridge = 0;
4480  int has_channel = 0;
4481 
4482  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4483  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4484  int prop_is_valid;
4485  prop_is_valid = ast_ari_validate_string(
4487  if (!prop_is_valid) {
4488  ast_log(LOG_ERROR, "ARI ChannelLeftBridge field asterisk_id failed validation\n");
4489  res = 0;
4490  }
4491  } else
4492  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4493  int prop_is_valid;
4494  has_type = 1;
4495  prop_is_valid = ast_ari_validate_string(
4497  if (!prop_is_valid) {
4498  ast_log(LOG_ERROR, "ARI ChannelLeftBridge field type failed validation\n");
4499  res = 0;
4500  }
4501  } else
4502  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4503  int prop_is_valid;
4504  has_application = 1;
4505  prop_is_valid = ast_ari_validate_string(
4507  if (!prop_is_valid) {
4508  ast_log(LOG_ERROR, "ARI ChannelLeftBridge field application failed validation\n");
4509  res = 0;
4510  }
4511  } else
4512  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4513  int prop_is_valid;
4514  has_timestamp = 1;
4515  prop_is_valid = ast_ari_validate_date(
4517  if (!prop_is_valid) {
4518  ast_log(LOG_ERROR, "ARI ChannelLeftBridge field timestamp failed validation\n");
4519  res = 0;
4520  }
4521  } else
4522  if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
4523  int prop_is_valid;
4524  has_bridge = 1;
4525  prop_is_valid = ast_ari_validate_bridge(
4527  if (!prop_is_valid) {
4528  ast_log(LOG_ERROR, "ARI ChannelLeftBridge field bridge failed validation\n");
4529  res = 0;
4530  }
4531  } else
4532  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4533  int prop_is_valid;
4534  has_channel = 1;
4535  prop_is_valid = ast_ari_validate_channel(
4537  if (!prop_is_valid) {
4538  ast_log(LOG_ERROR, "ARI ChannelLeftBridge field channel failed validation\n");
4539  res = 0;
4540  }
4541  } else
4542  {
4544  "ARI ChannelLeftBridge has undocumented field %s\n",
4545  ast_json_object_iter_key(iter));
4546  res = 0;
4547  }
4548  }
4549 
4550  if (!has_type) {
4551  ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field type\n");
4552  res = 0;
4553  }
4554 
4555  if (!has_application) {
4556  ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field application\n");
4557  res = 0;
4558  }
4559 
4560  if (!has_timestamp) {
4561  ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field timestamp\n");
4562  res = 0;
4563  }
4564 
4565  if (!has_bridge) {
4566  ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field bridge\n");
4567  res = 0;
4568  }
4569 
4570  if (!has_channel) {
4571  ast_log(LOG_ERROR, "ARI ChannelLeftBridge missing required field channel\n");
4572  res = 0;
4573  }
4574 
4575  return res;
4576 }
4577 
4579 {
4581 }
4582 
4584 {
4585  int res = 1;
4586  struct ast_json_iter *iter;
4587  int has_type = 0;
4588  int has_application = 0;
4589  int has_timestamp = 0;
4590  int has_channel = 0;
4591 
4592  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4593  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4594  int prop_is_valid;
4595  prop_is_valid = ast_ari_validate_string(
4597  if (!prop_is_valid) {
4598  ast_log(LOG_ERROR, "ARI ChannelStateChange field asterisk_id failed validation\n");
4599  res = 0;
4600  }
4601  } else
4602  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4603  int prop_is_valid;
4604  has_type = 1;
4605  prop_is_valid = ast_ari_validate_string(
4607  if (!prop_is_valid) {
4608  ast_log(LOG_ERROR, "ARI ChannelStateChange field type failed validation\n");
4609  res = 0;
4610  }
4611  } else
4612  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4613  int prop_is_valid;
4614  has_application = 1;
4615  prop_is_valid = ast_ari_validate_string(
4617  if (!prop_is_valid) {
4618  ast_log(LOG_ERROR, "ARI ChannelStateChange field application failed validation\n");
4619  res = 0;
4620  }
4621  } else
4622  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4623  int prop_is_valid;
4624  has_timestamp = 1;
4625  prop_is_valid = ast_ari_validate_date(
4627  if (!prop_is_valid) {
4628  ast_log(LOG_ERROR, "ARI ChannelStateChange field timestamp failed validation\n");
4629  res = 0;
4630  }
4631  } else
4632  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4633  int prop_is_valid;
4634  has_channel = 1;
4635  prop_is_valid = ast_ari_validate_channel(
4637  if (!prop_is_valid) {
4638  ast_log(LOG_ERROR, "ARI ChannelStateChange field channel failed validation\n");
4639  res = 0;
4640  }
4641  } else
4642  {
4644  "ARI ChannelStateChange has undocumented field %s\n",
4645  ast_json_object_iter_key(iter));
4646  res = 0;
4647  }
4648  }
4649 
4650  if (!has_type) {
4651  ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field type\n");
4652  res = 0;
4653  }
4654 
4655  if (!has_application) {
4656  ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field application\n");
4657  res = 0;
4658  }
4659 
4660  if (!has_timestamp) {
4661  ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field timestamp\n");
4662  res = 0;
4663  }
4664 
4665  if (!has_channel) {
4666  ast_log(LOG_ERROR, "ARI ChannelStateChange missing required field channel\n");
4667  res = 0;
4668  }
4669 
4670  return res;
4671 }
4672 
4674 {
4676 }
4677 
4679 {
4680  int res = 1;
4681  struct ast_json_iter *iter;
4682  int has_type = 0;
4683  int has_application = 0;
4684  int has_timestamp = 0;
4685  int has_channel = 0;
4686  int has_duration = 0;
4687 
4688  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4689  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4690  int prop_is_valid;
4691  prop_is_valid = ast_ari_validate_string(
4693  if (!prop_is_valid) {
4694  ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field asterisk_id failed validation\n");
4695  res = 0;
4696  }
4697  } else
4698  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4699  int prop_is_valid;
4700  has_type = 1;
4701  prop_is_valid = ast_ari_validate_string(
4703  if (!prop_is_valid) {
4704  ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field type failed validation\n");
4705  res = 0;
4706  }
4707  } else
4708  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4709  int prop_is_valid;
4710  has_application = 1;
4711  prop_is_valid = ast_ari_validate_string(
4713  if (!prop_is_valid) {
4714  ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field application failed validation\n");
4715  res = 0;
4716  }
4717  } else
4718  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4719  int prop_is_valid;
4720  has_timestamp = 1;
4721  prop_is_valid = ast_ari_validate_date(
4723  if (!prop_is_valid) {
4724  ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field timestamp failed validation\n");
4725  res = 0;
4726  }
4727  } else
4728  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4729  int prop_is_valid;
4730  has_channel = 1;
4731  prop_is_valid = ast_ari_validate_channel(
4733  if (!prop_is_valid) {
4734  ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field channel failed validation\n");
4735  res = 0;
4736  }
4737  } else
4738  if (strcmp("duration", ast_json_object_iter_key(iter)) == 0) {
4739  int prop_is_valid;
4740  has_duration = 1;
4741  prop_is_valid = ast_ari_validate_int(
4743  if (!prop_is_valid) {
4744  ast_log(LOG_ERROR, "ARI ChannelTalkingFinished field duration failed validation\n");
4745  res = 0;
4746  }
4747  } else
4748  {
4750  "ARI ChannelTalkingFinished has undocumented field %s\n",
4751  ast_json_object_iter_key(iter));
4752  res = 0;
4753  }
4754  }
4755 
4756  if (!has_type) {
4757  ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field type\n");
4758  res = 0;
4759  }
4760 
4761  if (!has_application) {
4762  ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field application\n");
4763  res = 0;
4764  }
4765 
4766  if (!has_timestamp) {
4767  ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field timestamp\n");
4768  res = 0;
4769  }
4770 
4771  if (!has_channel) {
4772  ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field channel\n");
4773  res = 0;
4774  }
4775 
4776  if (!has_duration) {
4777  ast_log(LOG_ERROR, "ARI ChannelTalkingFinished missing required field duration\n");
4778  res = 0;
4779  }
4780 
4781  return res;
4782 }
4783 
4785 {
4787 }
4788 
4790 {
4791  int res = 1;
4792  struct ast_json_iter *iter;
4793  int has_type = 0;
4794  int has_application = 0;
4795  int has_timestamp = 0;
4796  int has_channel = 0;
4797 
4798  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4799  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4800  int prop_is_valid;
4801  prop_is_valid = ast_ari_validate_string(
4803  if (!prop_is_valid) {
4804  ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field asterisk_id failed validation\n");
4805  res = 0;
4806  }
4807  } else
4808  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4809  int prop_is_valid;
4810  has_type = 1;
4811  prop_is_valid = ast_ari_validate_string(
4813  if (!prop_is_valid) {
4814  ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field type failed validation\n");
4815  res = 0;
4816  }
4817  } else
4818  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4819  int prop_is_valid;
4820  has_application = 1;
4821  prop_is_valid = ast_ari_validate_string(
4823  if (!prop_is_valid) {
4824  ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field application failed validation\n");
4825  res = 0;
4826  }
4827  } else
4828  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4829  int prop_is_valid;
4830  has_timestamp = 1;
4831  prop_is_valid = ast_ari_validate_date(
4833  if (!prop_is_valid) {
4834  ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field timestamp failed validation\n");
4835  res = 0;
4836  }
4837  } else
4838  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4839  int prop_is_valid;
4840  has_channel = 1;
4841  prop_is_valid = ast_ari_validate_channel(
4843  if (!prop_is_valid) {
4844  ast_log(LOG_ERROR, "ARI ChannelTalkingStarted field channel failed validation\n");
4845  res = 0;
4846  }
4847  } else
4848  {
4850  "ARI ChannelTalkingStarted has undocumented field %s\n",
4851  ast_json_object_iter_key(iter));
4852  res = 0;
4853  }
4854  }
4855 
4856  if (!has_type) {
4857  ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field type\n");
4858  res = 0;
4859  }
4860 
4861  if (!has_application) {
4862  ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field application\n");
4863  res = 0;
4864  }
4865 
4866  if (!has_timestamp) {
4867  ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field timestamp\n");
4868  res = 0;
4869  }
4870 
4871  if (!has_channel) {
4872  ast_log(LOG_ERROR, "ARI ChannelTalkingStarted missing required field channel\n");
4873  res = 0;
4874  }
4875 
4876  return res;
4877 }
4878 
4880 {
4882 }
4883 
4885 {
4886  int res = 1;
4887  struct ast_json_iter *iter;
4888  int has_type = 0;
4889  int has_application = 0;
4890  int has_timestamp = 0;
4891  int has_channel = 0;
4892 
4893  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4894  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4895  int prop_is_valid;
4896  prop_is_valid = ast_ari_validate_string(
4898  if (!prop_is_valid) {
4899  ast_log(LOG_ERROR, "ARI ChannelUnhold field asterisk_id failed validation\n");
4900  res = 0;
4901  }
4902  } else
4903  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
4904  int prop_is_valid;
4905  has_type = 1;
4906  prop_is_valid = ast_ari_validate_string(
4908  if (!prop_is_valid) {
4909  ast_log(LOG_ERROR, "ARI ChannelUnhold field type failed validation\n");
4910  res = 0;
4911  }
4912  } else
4913  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
4914  int prop_is_valid;
4915  has_application = 1;
4916  prop_is_valid = ast_ari_validate_string(
4918  if (!prop_is_valid) {
4919  ast_log(LOG_ERROR, "ARI ChannelUnhold field application failed validation\n");
4920  res = 0;
4921  }
4922  } else
4923  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
4924  int prop_is_valid;
4925  has_timestamp = 1;
4926  prop_is_valid = ast_ari_validate_date(
4928  if (!prop_is_valid) {
4929  ast_log(LOG_ERROR, "ARI ChannelUnhold field timestamp failed validation\n");
4930  res = 0;
4931  }
4932  } else
4933  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
4934  int prop_is_valid;
4935  has_channel = 1;
4936  prop_is_valid = ast_ari_validate_channel(
4938  if (!prop_is_valid) {
4939  ast_log(LOG_ERROR, "ARI ChannelUnhold field channel failed validation\n");
4940  res = 0;
4941  }
4942  } else
4943  {
4945  "ARI ChannelUnhold has undocumented field %s\n",
4946  ast_json_object_iter_key(iter));
4947  res = 0;
4948  }
4949  }
4950 
4951  if (!has_type) {
4952  ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field type\n");
4953  res = 0;
4954  }
4955 
4956  if (!has_application) {
4957  ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field application\n");
4958  res = 0;
4959  }
4960 
4961  if (!has_timestamp) {
4962  ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field timestamp\n");
4963  res = 0;
4964  }
4965 
4966  if (!has_channel) {
4967  ast_log(LOG_ERROR, "ARI ChannelUnhold missing required field channel\n");
4968  res = 0;
4969  }
4970 
4971  return res;
4972 }
4973 
4975 {
4977 }
4978 
4980 {
4981  int res = 1;
4982  struct ast_json_iter *iter;
4983  int has_type = 0;
4984  int has_application = 0;
4985  int has_timestamp = 0;
4986  int has_eventname = 0;
4987  int has_userevent = 0;
4988 
4989  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
4990  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
4991  int prop_is_valid;
4992  prop_is_valid = ast_ari_validate_string(
4994  if (!prop_is_valid) {
4995  ast_log(LOG_ERROR, "ARI ChannelUserevent field asterisk_id failed validation\n");
4996  res = 0;
4997  }
4998  } else
4999  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5000  int prop_is_valid;
5001  has_type = 1;
5002  prop_is_valid = ast_ari_validate_string(
5004  if (!prop_is_valid) {
5005  ast_log(LOG_ERROR, "ARI ChannelUserevent field type failed validation\n");
5006  res = 0;
5007  }
5008  } else
5009  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5010  int prop_is_valid;
5011  has_application = 1;
5012  prop_is_valid = ast_ari_validate_string(
5014  if (!prop_is_valid) {
5015  ast_log(LOG_ERROR, "ARI ChannelUserevent field application failed validation\n");
5016  res = 0;
5017  }
5018  } else
5019  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5020  int prop_is_valid;
5021  has_timestamp = 1;
5022  prop_is_valid = ast_ari_validate_date(
5024  if (!prop_is_valid) {
5025  ast_log(LOG_ERROR, "ARI ChannelUserevent field timestamp failed validation\n");
5026  res = 0;
5027  }
5028  } else
5029  if (strcmp("bridge", ast_json_object_iter_key(iter)) == 0) {
5030  int prop_is_valid;
5031  prop_is_valid = ast_ari_validate_bridge(
5033  if (!prop_is_valid) {
5034  ast_log(LOG_ERROR, "ARI ChannelUserevent field bridge failed validation\n");
5035  res = 0;
5036  }
5037  } else
5038  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5039  int prop_is_valid;
5040  prop_is_valid = ast_ari_validate_channel(
5042  if (!prop_is_valid) {
5043  ast_log(LOG_ERROR, "ARI ChannelUserevent field channel failed validation\n");
5044  res = 0;
5045  }
5046  } else
5047  if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
5048  int prop_is_valid;
5049  prop_is_valid = ast_ari_validate_endpoint(
5051  if (!prop_is_valid) {
5052  ast_log(LOG_ERROR, "ARI ChannelUserevent field endpoint failed validation\n");
5053  res = 0;
5054  }
5055  } else
5056  if (strcmp("eventname", ast_json_object_iter_key(iter)) == 0) {
5057  int prop_is_valid;
5058  has_eventname = 1;
5059  prop_is_valid = ast_ari_validate_string(
5061  if (!prop_is_valid) {
5062  ast_log(LOG_ERROR, "ARI ChannelUserevent field eventname failed validation\n");
5063  res = 0;
5064  }
5065  } else
5066  if (strcmp("userevent", ast_json_object_iter_key(iter)) == 0) {
5067  int prop_is_valid;
5068  has_userevent = 1;
5069  prop_is_valid = ast_ari_validate_object(
5071  if (!prop_is_valid) {
5072  ast_log(LOG_ERROR, "ARI ChannelUserevent field userevent failed validation\n");
5073  res = 0;
5074  }
5075  } else
5076  {
5078  "ARI ChannelUserevent has undocumented field %s\n",
5079  ast_json_object_iter_key(iter));
5080  res = 0;
5081  }
5082  }
5083 
5084  if (!has_type) {
5085  ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field type\n");
5086  res = 0;
5087  }
5088 
5089  if (!has_application) {
5090  ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field application\n");
5091  res = 0;
5092  }
5093 
5094  if (!has_timestamp) {
5095  ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field timestamp\n");
5096  res = 0;
5097  }
5098 
5099  if (!has_eventname) {
5100  ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field eventname\n");
5101  res = 0;
5102  }
5103 
5104  if (!has_userevent) {
5105  ast_log(LOG_ERROR, "ARI ChannelUserevent missing required field userevent\n");
5106  res = 0;
5107  }
5108 
5109  return res;
5110 }
5111 
5113 {
5115 }
5116 
5118 {
5119  int res = 1;
5120  struct ast_json_iter *iter;
5121  int has_type = 0;
5122  int has_application = 0;
5123  int has_timestamp = 0;
5124  int has_value = 0;
5125  int has_variable = 0;
5126 
5127  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5128  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5129  int prop_is_valid;
5130  prop_is_valid = ast_ari_validate_string(
5132  if (!prop_is_valid) {
5133  ast_log(LOG_ERROR, "ARI ChannelVarset field asterisk_id failed validation\n");
5134  res = 0;
5135  }
5136  } else
5137  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5138  int prop_is_valid;
5139  has_type = 1;
5140  prop_is_valid = ast_ari_validate_string(
5142  if (!prop_is_valid) {
5143  ast_log(LOG_ERROR, "ARI ChannelVarset field type failed validation\n");
5144  res = 0;
5145  }
5146  } else
5147  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5148  int prop_is_valid;
5149  has_application = 1;
5150  prop_is_valid = ast_ari_validate_string(
5152  if (!prop_is_valid) {
5153  ast_log(LOG_ERROR, "ARI ChannelVarset field application failed validation\n");
5154  res = 0;
5155  }
5156  } else
5157  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5158  int prop_is_valid;
5159  has_timestamp = 1;
5160  prop_is_valid = ast_ari_validate_date(
5162  if (!prop_is_valid) {
5163  ast_log(LOG_ERROR, "ARI ChannelVarset field timestamp failed validation\n");
5164  res = 0;
5165  }
5166  } else
5167  if (strcmp("channel", ast_json_object_iter_key(iter)) == 0) {
5168  int prop_is_valid;
5169  prop_is_valid = ast_ari_validate_channel(
5171  if (!prop_is_valid) {
5172  ast_log(LOG_ERROR, "ARI ChannelVarset field channel failed validation\n");
5173  res = 0;
5174  }
5175  } else
5176  if (strcmp("value", ast_json_object_iter_key(iter)) == 0) {
5177  int prop_is_valid;
5178  has_value = 1;
5179  prop_is_valid = ast_ari_validate_string(
5181  if (!prop_is_valid) {
5182  ast_log(LOG_ERROR, "ARI ChannelVarset field value failed validation\n");
5183  res = 0;
5184  }
5185  } else
5186  if (strcmp("variable", ast_json_object_iter_key(iter)) == 0) {
5187  int prop_is_valid;
5188  has_variable = 1;
5189  prop_is_valid = ast_ari_validate_string(
5191  if (!prop_is_valid) {
5192  ast_log(LOG_ERROR, "ARI ChannelVarset field variable failed validation\n");
5193  res = 0;
5194  }
5195  } else
5196  {
5198  "ARI ChannelVarset has undocumented field %s\n",
5199  ast_json_object_iter_key(iter));
5200  res = 0;
5201  }
5202  }
5203 
5204  if (!has_type) {
5205  ast_log(LOG_ERROR, "ARI ChannelVarset missing required field type\n");
5206  res = 0;
5207  }
5208 
5209  if (!has_application) {
5210  ast_log(LOG_ERROR, "ARI ChannelVarset missing required field application\n");
5211  res = 0;
5212  }
5213 
5214  if (!has_timestamp) {
5215  ast_log(LOG_ERROR, "ARI ChannelVarset missing required field timestamp\n");
5216  res = 0;
5217  }
5218 
5219  if (!has_value) {
5220  ast_log(LOG_ERROR, "ARI ChannelVarset missing required field value\n");
5221  res = 0;
5222  }
5223 
5224  if (!has_variable) {
5225  ast_log(LOG_ERROR, "ARI ChannelVarset missing required field variable\n");
5226  res = 0;
5227  }
5228 
5229  return res;
5230 }
5231 
5233 {
5235 }
5236 
5238 {
5239  int res = 1;
5240  struct ast_json_iter *iter;
5241  int has_aor = 0;
5242  int has_contact_status = 0;
5243  int has_uri = 0;
5244 
5245  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5246  if (strcmp("aor", ast_json_object_iter_key(iter)) == 0) {
5247  int prop_is_valid;
5248  has_aor = 1;
5249  prop_is_valid = ast_ari_validate_string(
5251  if (!prop_is_valid) {
5252  ast_log(LOG_ERROR, "ARI ContactInfo field aor failed validation\n");
5253  res = 0;
5254  }
5255  } else
5256  if (strcmp("contact_status", ast_json_object_iter_key(iter)) == 0) {
5257  int prop_is_valid;
5258  has_contact_status = 1;
5259  prop_is_valid = ast_ari_validate_string(
5261  if (!prop_is_valid) {
5262  ast_log(LOG_ERROR, "ARI ContactInfo field contact_status failed validation\n");
5263  res = 0;
5264  }
5265  } else
5266  if (strcmp("roundtrip_usec", ast_json_object_iter_key(iter)) == 0) {
5267  int prop_is_valid;
5268  prop_is_valid = ast_ari_validate_string(
5270  if (!prop_is_valid) {
5271  ast_log(LOG_ERROR, "ARI ContactInfo field roundtrip_usec failed validation\n");
5272  res = 0;
5273  }
5274  } else
5275  if (strcmp("uri", ast_json_object_iter_key(iter)) == 0) {
5276  int prop_is_valid;
5277  has_uri = 1;
5278  prop_is_valid = ast_ari_validate_string(
5280  if (!prop_is_valid) {
5281  ast_log(LOG_ERROR, "ARI ContactInfo field uri failed validation\n");
5282  res = 0;
5283  }
5284  } else
5285  {
5287  "ARI ContactInfo has undocumented field %s\n",
5288  ast_json_object_iter_key(iter));
5289  res = 0;
5290  }
5291  }
5292 
5293  if (!has_aor) {
5294  ast_log(LOG_ERROR, "ARI ContactInfo missing required field aor\n");
5295  res = 0;
5296  }
5297 
5298  if (!has_contact_status) {
5299  ast_log(LOG_ERROR, "ARI ContactInfo missing required field contact_status\n");
5300  res = 0;
5301  }
5302 
5303  if (!has_uri) {
5304  ast_log(LOG_ERROR, "ARI ContactInfo missing required field uri\n");
5305  res = 0;
5306  }
5307 
5308  return res;
5309 }
5310 
5312 {
5314 }
5315 
5317 {
5318  int res = 1;
5319  struct ast_json_iter *iter;
5320  int has_type = 0;
5321  int has_application = 0;
5322  int has_timestamp = 0;
5323  int has_contact_info = 0;
5324  int has_endpoint = 0;
5325 
5326  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5327  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5328  int prop_is_valid;
5329  prop_is_valid = ast_ari_validate_string(
5331  if (!prop_is_valid) {
5332  ast_log(LOG_ERROR, "ARI ContactStatusChange field asterisk_id failed validation\n");
5333  res = 0;
5334  }
5335  } else
5336  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5337  int prop_is_valid;
5338  has_type = 1;
5339  prop_is_valid = ast_ari_validate_string(
5341  if (!prop_is_valid) {
5342  ast_log(LOG_ERROR, "ARI ContactStatusChange field type failed validation\n");
5343  res = 0;
5344  }
5345  } else
5346  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5347  int prop_is_valid;
5348  has_application = 1;
5349  prop_is_valid = ast_ari_validate_string(
5351  if (!prop_is_valid) {
5352  ast_log(LOG_ERROR, "ARI ContactStatusChange field application failed validation\n");
5353  res = 0;
5354  }
5355  } else
5356  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5357  int prop_is_valid;
5358  has_timestamp = 1;
5359  prop_is_valid = ast_ari_validate_date(
5361  if (!prop_is_valid) {
5362  ast_log(LOG_ERROR, "ARI ContactStatusChange field timestamp failed validation\n");
5363  res = 0;
5364  }
5365  } else
5366  if (strcmp("contact_info", ast_json_object_iter_key(iter)) == 0) {
5367  int prop_is_valid;
5368  has_contact_info = 1;
5369  prop_is_valid = ast_ari_validate_contact_info(
5371  if (!prop_is_valid) {
5372  ast_log(LOG_ERROR, "ARI ContactStatusChange field contact_info failed validation\n");
5373  res = 0;
5374  }
5375  } else
5376  if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
5377  int prop_is_valid;
5378  has_endpoint = 1;
5379  prop_is_valid = ast_ari_validate_endpoint(
5381  if (!prop_is_valid) {
5382  ast_log(LOG_ERROR, "ARI ContactStatusChange field endpoint failed validation\n");
5383  res = 0;
5384  }
5385  } else
5386  {
5388  "ARI ContactStatusChange has undocumented field %s\n",
5389  ast_json_object_iter_key(iter));
5390  res = 0;
5391  }
5392  }
5393 
5394  if (!has_type) {
5395  ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field type\n");
5396  res = 0;
5397  }
5398 
5399  if (!has_application) {
5400  ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field application\n");
5401  res = 0;
5402  }
5403 
5404  if (!has_timestamp) {
5405  ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field timestamp\n");
5406  res = 0;
5407  }
5408 
5409  if (!has_contact_info) {
5410  ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field contact_info\n");
5411  res = 0;
5412  }
5413 
5414  if (!has_endpoint) {
5415  ast_log(LOG_ERROR, "ARI ContactStatusChange missing required field endpoint\n");
5416  res = 0;
5417  }
5418 
5419  return res;
5420 }
5421 
5423 {
5425 }
5426 
5428 {
5429  int res = 1;
5430  struct ast_json_iter *iter;
5431  int has_type = 0;
5432  int has_application = 0;
5433  int has_timestamp = 0;
5434  int has_device_state = 0;
5435 
5436  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5437  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5438  int prop_is_valid;
5439  prop_is_valid = ast_ari_validate_string(
5441  if (!prop_is_valid) {
5442  ast_log(LOG_ERROR, "ARI DeviceStateChanged field asterisk_id failed validation\n");
5443  res = 0;
5444  }
5445  } else
5446  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5447  int prop_is_valid;
5448  has_type = 1;
5449  prop_is_valid = ast_ari_validate_string(
5451  if (!prop_is_valid) {
5452  ast_log(LOG_ERROR, "ARI DeviceStateChanged field type failed validation\n");
5453  res = 0;
5454  }
5455  } else
5456  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5457  int prop_is_valid;
5458  has_application = 1;
5459  prop_is_valid = ast_ari_validate_string(
5461  if (!prop_is_valid) {
5462  ast_log(LOG_ERROR, "ARI DeviceStateChanged field application failed validation\n");
5463  res = 0;
5464  }
5465  } else
5466  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5467  int prop_is_valid;
5468  has_timestamp = 1;
5469  prop_is_valid = ast_ari_validate_date(
5471  if (!prop_is_valid) {
5472  ast_log(LOG_ERROR, "ARI DeviceStateChanged field timestamp failed validation\n");
5473  res = 0;
5474  }
5475  } else
5476  if (strcmp("device_state", ast_json_object_iter_key(iter)) == 0) {
5477  int prop_is_valid;
5478  has_device_state = 1;
5479  prop_is_valid = ast_ari_validate_device_state(
5481  if (!prop_is_valid) {
5482  ast_log(LOG_ERROR, "ARI DeviceStateChanged field device_state failed validation\n");
5483  res = 0;
5484  }
5485  } else
5486  {
5488  "ARI DeviceStateChanged has undocumented field %s\n",
5489  ast_json_object_iter_key(iter));
5490  res = 0;
5491  }
5492  }
5493 
5494  if (!has_type) {
5495  ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field type\n");
5496  res = 0;
5497  }
5498 
5499  if (!has_application) {
5500  ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field application\n");
5501  res = 0;
5502  }
5503 
5504  if (!has_timestamp) {
5505  ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field timestamp\n");
5506  res = 0;
5507  }
5508 
5509  if (!has_device_state) {
5510  ast_log(LOG_ERROR, "ARI DeviceStateChanged missing required field device_state\n");
5511  res = 0;
5512  }
5513 
5514  return res;
5515 }
5516 
5518 {
5520 }
5521 
5523 {
5524  int res = 1;
5525  struct ast_json_iter *iter;
5526  int has_type = 0;
5527  int has_application = 0;
5528  int has_timestamp = 0;
5529  int has_dialstatus = 0;
5530  int has_peer = 0;
5531 
5532  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5533  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5534  int prop_is_valid;
5535  prop_is_valid = ast_ari_validate_string(
5537  if (!prop_is_valid) {
5538  ast_log(LOG_ERROR, "ARI Dial field asterisk_id failed validation\n");
5539  res = 0;
5540  }
5541  } else
5542  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5543  int prop_is_valid;
5544  has_type = 1;
5545  prop_is_valid = ast_ari_validate_string(
5547  if (!prop_is_valid) {
5548  ast_log(LOG_ERROR, "ARI Dial field type failed validation\n");
5549  res = 0;
5550  }
5551  } else
5552  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5553  int prop_is_valid;
5554  has_application = 1;
5555  prop_is_valid = ast_ari_validate_string(
5557  if (!prop_is_valid) {
5558  ast_log(LOG_ERROR, "ARI Dial field application failed validation\n");
5559  res = 0;
5560  }
5561  } else
5562  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5563  int prop_is_valid;
5564  has_timestamp = 1;
5565  prop_is_valid = ast_ari_validate_date(
5567  if (!prop_is_valid) {
5568  ast_log(LOG_ERROR, "ARI Dial field timestamp failed validation\n");
5569  res = 0;
5570  }
5571  } else
5572  if (strcmp("caller", ast_json_object_iter_key(iter)) == 0) {
5573  int prop_is_valid;
5574  prop_is_valid = ast_ari_validate_channel(
5576  if (!prop_is_valid) {
5577  ast_log(LOG_ERROR, "ARI Dial field caller failed validation\n");
5578  res = 0;
5579  }
5580  } else
5581  if (strcmp("dialstatus", ast_json_object_iter_key(iter)) == 0) {
5582  int prop_is_valid;
5583  has_dialstatus = 1;
5584  prop_is_valid = ast_ari_validate_string(
5586  if (!prop_is_valid) {
5587  ast_log(LOG_ERROR, "ARI Dial field dialstatus failed validation\n");
5588  res = 0;
5589  }
5590  } else
5591  if (strcmp("dialstring", ast_json_object_iter_key(iter)) == 0) {
5592  int prop_is_valid;
5593  prop_is_valid = ast_ari_validate_string(
5595  if (!prop_is_valid) {
5596  ast_log(LOG_ERROR, "ARI Dial field dialstring failed validation\n");
5597  res = 0;
5598  }
5599  } else
5600  if (strcmp("forward", ast_json_object_iter_key(iter)) == 0) {
5601  int prop_is_valid;
5602  prop_is_valid = ast_ari_validate_string(
5604  if (!prop_is_valid) {
5605  ast_log(LOG_ERROR, "ARI Dial field forward failed validation\n");
5606  res = 0;
5607  }
5608  } else
5609  if (strcmp("forwarded", ast_json_object_iter_key(iter)) == 0) {
5610  int prop_is_valid;
5611  prop_is_valid = ast_ari_validate_channel(
5613  if (!prop_is_valid) {
5614  ast_log(LOG_ERROR, "ARI Dial field forwarded failed validation\n");
5615  res = 0;
5616  }
5617  } else
5618  if (strcmp("peer", ast_json_object_iter_key(iter)) == 0) {
5619  int prop_is_valid;
5620  has_peer = 1;
5621  prop_is_valid = ast_ari_validate_channel(
5623  if (!prop_is_valid) {
5624  ast_log(LOG_ERROR, "ARI Dial field peer failed validation\n");
5625  res = 0;
5626  }
5627  } else
5628  {
5630  "ARI Dial has undocumented field %s\n",
5631  ast_json_object_iter_key(iter));
5632  res = 0;
5633  }
5634  }
5635 
5636  if (!has_type) {
5637  ast_log(LOG_ERROR, "ARI Dial missing required field type\n");
5638  res = 0;
5639  }
5640 
5641  if (!has_application) {
5642  ast_log(LOG_ERROR, "ARI Dial missing required field application\n");
5643  res = 0;
5644  }
5645 
5646  if (!has_timestamp) {
5647  ast_log(LOG_ERROR, "ARI Dial missing required field timestamp\n");
5648  res = 0;
5649  }
5650 
5651  if (!has_dialstatus) {
5652  ast_log(LOG_ERROR, "ARI Dial missing required field dialstatus\n");
5653  res = 0;
5654  }
5655 
5656  if (!has_peer) {
5657  ast_log(LOG_ERROR, "ARI Dial missing required field peer\n");
5658  res = 0;
5659  }
5660 
5661  return res;
5662 }
5663 
5665 {
5666  return ast_ari_validate_dial;
5667 }
5668 
5670 {
5671  int res = 1;
5672  struct ast_json_iter *iter;
5673  int has_type = 0;
5674  int has_application = 0;
5675  int has_timestamp = 0;
5676  int has_endpoint = 0;
5677 
5678  for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {
5679  if (strcmp("asterisk_id", ast_json_object_iter_key(iter)) == 0) {
5680  int prop_is_valid;
5681  prop_is_valid = ast_ari_validate_string(
5683  if (!prop_is_valid) {
5684  ast_log(LOG_ERROR, "ARI EndpointStateChange field asterisk_id failed validation\n");
5685  res = 0;
5686  }
5687  } else
5688  if (strcmp("type", ast_json_object_iter_key(iter)) == 0) {
5689  int prop_is_valid;
5690  has_type = 1;
5691  prop_is_valid = ast_ari_validate_string(
5693  if (!prop_is_valid) {
5694  ast_log(LOG_ERROR, "ARI EndpointStateChange field type failed validation\n");
5695  res = 0;
5696  }
5697  } else
5698  if (strcmp("application", ast_json_object_iter_key(iter)) == 0) {
5699  int prop_is_valid;
5700  has_application = 1;
5701  prop_is_valid = ast_ari_validate_string(
5703  if (!prop_is_valid) {
5704  ast_log(LOG_ERROR, "ARI EndpointStateChange field application failed validation\n");
5705  res = 0;
5706  }
5707  } else
5708  if (strcmp("timestamp", ast_json_object_iter_key(iter)) == 0) {
5709  int prop_is_valid;
5710  has_timestamp = 1;
5711  prop_is_valid = ast_ari_validate_date(
5713  if (!prop_is_valid) {
5714  ast_log(LOG_ERROR, "ARI EndpointStateChange field timestamp failed validation\n");
5715  res = 0;
5716  }
5717  } else
5718  if (strcmp("endpoint", ast_json_object_iter_key(iter)) == 0) {
5719  int prop_is_valid;
5720  has_endpoint = 1;
5721  prop_is_valid = ast_ari_validate_endpoint(
5723  if (!prop_is_valid) {
5724  ast_log(LOG_ERROR, "ARI EndpointStateChange field endpoint failed validation\n");
5725  res = 0;
5726  }
5727  } else
5728  {
5730  "ARI EndpointStateChange has undocumented field %s\n",
5731  ast_json_object_iter_key(iter));
5732  res = 0;
5733  }
5734  }
5735 
5736  if (!has_type) {
5737  ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field type\n");
5738  res = 0;
5739  }
5740 
5741  if (!has_application) {
5742  ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field application\n");
5743  res = 0;
5744  }
5745 
5746  if (!has_timestamp) {
5747  ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field timestamp\n");
5748  res = 0;
5749  }
5750 
5751  if (!has_endpoint) {
5752  ast_log(LOG_ERROR, "ARI EndpointStateChange missing required field endpoint\n");
5753  res = 0;
5754  }
5755 
5756  return res;
5757 }
5758 
5760 {
5762 }
5763 
5765 {
5766  int res = 1;
5767  struct ast_json_iter *iter;
5768  int has_type = 0;
5769  int has_application = 0;
5770  int has_timestamp = 0;
5771  const char *discriminator;
5772 
5773  discriminator = ast_json_string_get(ast_json_object_get(json, "type"));
5774  if (!discriminator) {
5775  ast_log(LOG_ERROR, "ARI Event missing required field type\n");
5776  return 0;
5777  }
5778 
5779  if (strcmp("Event", discriminator) == 0) {
5780  /* Self type; fall through */
5781  } else
5782  if (strcmp("ApplicationMoveFailed", discriminator) == 0) {
5784  } else
5785  if (strcmp("ApplicationReplaced", discriminator) == 0) {
5787  } else
5788  if (strcmp("BridgeAttendedTransfer", discriminator) == 0) {
5790  } else
5791  if (strcmp("BridgeBlindTransfer", discriminator) == 0) {
5793  } else
5794  if (strcmp("BridgeCreated", discriminator) == 0) {
5795  return ast_ari_validate_bridge_created(json);
5796  } else
5797  if (strcmp("BridgeDestroyed", discriminator) == 0) {
5798  return ast_ari_validate_bridge_destroyed(json);
5799  } else
5800  if (strcmp("BridgeMerged", discriminator) == 0) {
5801  return ast_ari_validate_bridge_merged(json);
5802  } else
5803  if (strcmp("BridgeVideoSourceChanged", discriminator) == 0) {
5805  } else
5806  if (strcmp("ChannelCallerId", discriminator) == 0) {
5808  } else
5809  if (strcmp("ChannelConnectedLine", discriminator) == 0) {
5811  } else
5812