summaryrefslogtreecommitdiff
path: root/rest-api-templates/ari_model_validators.h.mustache
blob: 65efbbd85a3f3548c898d4316b95a5f09e954a08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*
 * Asterisk -- An open source telephony toolkit.
 *
 * Copyright (C) 2013, Digium, Inc.
 *
 * See http://www.asterisk.org for more information about
 * the Asterisk project. Please do not directly contact
 * any of the maintainers of this project for assistance;
 * the project provides a web site, mailing lists and IRC
 * channels for your use.
 *
 * This program is free software, distributed under the terms of
 * the GNU General Public License Version 2. See the LICENSE file
 * at the top of the source tree.
 */

/*! \file
 *
 * \brief Generated file - Build validators for ARI model objects.
 */

 /*
{{> do-not-edit}}
 * This file is generated by a mustache template. Please see the original
 * template in rest-api-templates/ari_model_validators.h.mustache
 */

#ifndef _ASTERISK_ARI_MODEL_H
#define _ASTERISK_ARI_MODEL_H

#include "asterisk/json.h"

/*! @{ */

/*!
 * \brief Validator for native Swagger void.
 *
 * \param json JSON object to validate.
 * \returns True (non-zero) if valid.
 * \returns False (zero) if invalid.
 */
int ari_validate_void(struct ast_json *json);

/*!
 * \brief Validator for native Swagger byte.
 *
 * \param json JSON object to validate.
 * \returns True (non-zero) if valid.
 * \returns False (zero) if invalid.
 */
int ari_validate_byte(struct ast_json *json);

/*!
 * \brief Validator for native Swagger boolean.
 *
 * \param json JSON object to validate.
 * \returns True (non-zero) if valid.
 * \returns False (zero) if invalid.
 */
int ari_validate_boolean(struct ast_json *json);

/*!
 * \brief Validator for native Swagger int.
 *
 * \param json JSON object to validate.
 * \returns True (non-zero) if valid.
 * \returns False (zero) if invalid.
 */
int ari_validate_int(struct ast_json *json);

/*!
 * \brief Validator for native Swagger long.
 *
 * \param json JSON object to validate.
 * \returns True (non-zero) if valid.
 * \returns False (zero) if invalid.
 */
int ari_validate_long(struct ast_json *json);

/*!
 * \brief Validator for native Swagger float.
 *
 * \param json JSON object to validate.
 * \returns True (non-zero) if valid.
 * \returns False (zero) if invalid.
 */
int ari_validate_float(struct ast_json *json);

/*!
 * \brief Validator for native Swagger double.
 *
 * \param json JSON object to validate.
 * \returns True (non-zero) if valid.
 * \returns False (zero) if invalid.
 */
int ari_validate_double(struct ast_json *json);

/*!
 * \brief Validator for native Swagger string.
 *
 * \param json JSON object to validate.
 * \returns True (non-zero) if valid.
 * \returns False (zero) if invalid.
 */
int ari_validate_string(struct ast_json *json);

/*!
 * \brief Validator for native Swagger date.
 *
 * \param json JSON object to validate.
 * \returns True (non-zero) if valid.
 * \returns False (zero) if invalid.
 */
int ari_validate_date(struct ast_json *json);

/*!
 * \brief Validator for a Swagger List[]/JSON array.
 *
 * \param json JSON object to validate.
 * \param fn Validator to call on every element in the array.
 * \returns True (non-zero) if valid.
 * \returns False (zero) if invalid.
 */
int ari_validate_list(struct ast_json *json, int (*fn)(struct ast_json *));

/*! @} */
{{#apis}}
{{#api_declaration}}
{{#models}}

/*!
 * \brief Validator for {{id}}.
 *
 * {{{description_dox}}}
 *
 * \param json JSON object to validate.
 * \returns True (non-zero) if valid.
 * \returns False (zero) if invalid.
 */
int ari_validate_{{c_id}}(struct ast_json *json);
{{/models}}
{{/api_declaration}}
{{/apis}}

/*
 * JSON models
 *
{{#apis}}
{{#api_declaration}}
{{#models}}
 * {{id}}
{{#properties}}
 * - {{name}}: {{type.name}}{{#required}} (required){{/required}}
{{/properties}}
{{/models}}
{{/api_declaration}}
{{/apis}} */

#endif /* _ASTERISK_ARI_MODEL_H */