2 * Copyright (C) 2016, 2017, 2018 "IoT.bzh"
3 * Author: José Bollo <jose.bollo@iot.bzh>
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
28 struct afb_binding_v3;
33 extern struct afb_api_v3 *afb_api_v3_create(struct afb_apiset *declare_set,
34 struct afb_apiset *call_set,
38 int (*preinit)(void*, struct afb_api_x3 *),
41 struct afb_export* creator,
44 extern struct afb_api_v3 *afb_api_v3_from_binding(
45 const struct afb_binding_v3 *desc,
46 struct afb_apiset *declare_set,
47 struct afb_apiset * call_set);
49 extern int afb_api_v3_safe_preinit(
50 struct afb_api_x3 *api,
51 int (*preinit)(struct afb_api_x3 *));
53 extern int afb_api_v3_set_binding_fields(const struct afb_binding_v3 *desc, struct afb_api_x3 *api);
55 extern struct afb_api_v3 *afb_api_v3_addref(struct afb_api_v3 *api);
56 extern void afb_api_v3_unref(struct afb_api_v3 *api);
58 extern struct afb_export *afb_api_v3_export(struct afb_api_v3 *api);
60 extern void afb_api_v3_set_verbs_v2(
61 struct afb_api_v3 *api,
62 const struct afb_verb_v2 *verbs);
64 extern void afb_api_v3_set_verbs_v3(
65 struct afb_api_v3 *api,
66 const struct afb_verb_v3 *verbs);
68 extern int afb_api_v3_add_verb(
69 struct afb_api_v3 *api,
72 void (*callback)(struct afb_req_x2 *req),
74 const struct afb_auth *auth,
78 extern int afb_api_v3_del_verb(
79 struct afb_api_v3 *api,
83 extern void afb_api_v3_process_call(struct afb_api_v3 *api, struct afb_xreq *xreq);
84 extern struct json_object *afb_api_v3_make_description_openAPIv3(struct afb_api_v3 *api, const char *apiname);