Skip to content
Snippets Groups Projects
ari_model_validators.h.mustache 4.66 KiB
/*
 * 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.
 *
 * In addition to the normal validation functions one would normally expect,
 * each validator has a ast_ari_validate_{id}_fn() companion function that returns
 * the validator's function pointer.
 *
 * The reason for this seamingly useless indirection is the way function
 * pointers used to interfere with module loading. Previously, Asterisk
 * attempted to dlopen() each module using \c RTLD_LAZY in order to read some
 * metadata from the module. Using functions to get the function pointer
 * allowed us to be lazy.
 */

 /*
{{> 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.
 * \retval True (non-zero) if valid.
 * \retval False (zero) if invalid.
 */
int ast_ari_validate_void(struct ast_json *json);

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

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