NUGU SDK Linux  1.7.6
nugu_event.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 SK Telecom Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __NUGU_EVENT_H__
18 #define __NUGU_EVENT_H__
19 
20 #include <nugu.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
54 };
55 
59 typedef struct _nugu_event NuguEvent;
60 
69 NUGU_API NuguEvent *nugu_event_new(const char *name_space, const char *name,
70  const char *version);
71 
77 NUGU_API void nugu_event_free(NuguEvent *nev);
78 
84 NUGU_API const char *nugu_event_peek_namespace(NuguEvent *nev);
85 
91 NUGU_API const char *nugu_event_peek_name(NuguEvent *nev);
92 
98 NUGU_API const char *nugu_event_peek_version(NuguEvent *nev);
99 
105 NUGU_API const char *nugu_event_peek_msg_id(NuguEvent *nev);
106 
115 NUGU_API int nugu_event_set_context(NuguEvent *nev, const char *context);
116 
122 NUGU_API const char *nugu_event_peek_context(NuguEvent *nev);
123 
132 NUGU_API int nugu_event_set_json(NuguEvent *nev, const char *json);
133 
139 NUGU_API const char *nugu_event_peek_json(NuguEvent *nev);
140 
149 NUGU_API int nugu_event_set_dialog_id(NuguEvent *nev, const char *dialog_id);
150 
156 NUGU_API const char *nugu_event_peek_dialog_id(NuguEvent *nev);
157 
167  const char *referrer_id);
168 
174 NUGU_API const char *nugu_event_peek_referrer_id(NuguEvent *nev);
175 
184 NUGU_API int nugu_event_set_type(NuguEvent *nev, enum nugu_event_type type);
185 
192 
198 NUGU_API int nugu_event_get_seq(NuguEvent *nev);
199 
208 
216 
225 NUGU_API int nugu_event_set_mime_type(NuguEvent *nev, const char *type);
226 
232 NUGU_API const char *nugu_event_peek_mime_type(NuguEvent *nev);
233 
238 #ifdef __cplusplus
239 }
240 #endif
241 
242 #endif
NUGU_API int nugu_event_set_referrer_id(NuguEvent *nev, const char *referrer_id)
Set the referer-dialog-request-id of event.
NUGU_API const char * nugu_event_peek_json(NuguEvent *nev)
Get the payload of event.
NUGU_API char * nugu_event_generate_payload(NuguEvent *nev)
Generate JSON payload using nugu_event attributes.
NUGU_API NuguEvent * nugu_event_new(const char *name_space, const char *name, const char *version)
Create new event object.
NUGU_API const char * nugu_event_peek_referrer_id(NuguEvent *nev)
Get the referer-dialog-request-id of event.
NUGU_API const char * nugu_event_peek_name(NuguEvent *nev)
Get the name of event.
NUGU_API const char * nugu_event_peek_msg_id(NuguEvent *nev)
Get the message-id of event.
NUGU_API int nugu_event_set_json(NuguEvent *nev, const char *json)
Set the payload of event.
NUGU_API int nugu_event_set_mime_type(NuguEvent *nev, const char *type)
Set the attachment mime type of NuguEvent.
NUGU_API int nugu_event_set_context(NuguEvent *nev, const char *context)
Set text context of event.
struct _nugu_event NuguEvent
Event object.
Definition: nugu_event.h:59
NUGU_API int nugu_event_get_seq(NuguEvent *nev)
Get the current sequence number of attachment data.
NUGU_API int nugu_event_set_dialog_id(NuguEvent *nev, const char *dialog_id)
Set the dialog-request-id of event.
NUGU_API void nugu_event_free(NuguEvent *nev)
Destroy the event object.
NUGU_API const char * nugu_event_peek_namespace(NuguEvent *nev)
Get the namespace of event.
NUGU_API const char * nugu_event_peek_version(NuguEvent *nev)
Get the version of event.
NUGU_API const char * nugu_event_peek_dialog_id(NuguEvent *nev)
Get the dialog-request-id of event.
NUGU_API enum nugu_event_type nugu_event_get_type(NuguEvent *nev)
Get the type of NuguEvent.
NUGU_API const char * nugu_event_peek_context(NuguEvent *nev)
Get the context of event.
NUGU_API const char * nugu_event_peek_mime_type(NuguEvent *nev)
Get the attachment mime type of NuguEvent.
nugu_event_type
event types
Definition: nugu_event.h:48
NUGU_API int nugu_event_increase_seq(NuguEvent *nev)
Increase the sequence number.
NUGU_API int nugu_event_set_type(NuguEvent *nev, enum nugu_event_type type)
Set the type of NuguEvent.
@ NUGU_EVENT_TYPE_WITH_ATTACHMENT
Definition: nugu_event.h:52
@ NUGU_EVENT_TYPE_DEFAULT
Definition: nugu_event.h:49