1 /*****************************************************************
3 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
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.
17 ******************************************************************/
20 #ifndef __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_PAYLOAD_H__
21 #define __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_PAYLOAD_H__
32 * @file smartthings_payload.h
36 * @addtogroup CAPI_SMARTTHINGS_THING_PAYLOAD_MODULE
41 * @brief The SmartThings payload handle.
44 typedef struct smartthings_payload_s *smartthings_payload_h;
47 * @brief Creates a SmartThings payload handle.
50 * @remarks The @a payload must be released using smartthings_payload_destroy().
51 * @remarks If the @a payload is set to parent payload as an object or object array
52 * using smartthings_payload_set_object() or smartthings_payload_set_object_array(),
53 * the @a payload must not be released.
55 * @param[out] payload The SmartThings payload handle to be newly created on success
56 * @return @c 0 on success,
57 * otherwise a negative error value
58 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
59 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
60 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
62 * @see smartthings_payload_destroy()
64 int smartthings_payload_create(smartthings_payload_h *payload);
67 * @brief Destroys a SmartThings payload handle and releases all its resources.
70 * @remarks If the @a payload has child payload, its child payload will be released as well.
72 * @param[in] payload The SmartThings payload handle
74 * @return @c 0 on success,
75 * otherwise a negative error value
76 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
77 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
79 * @see smartthings_payload_create()
81 int smartthings_payload_destroy(smartthings_payload_h payload);
84 * @brief Sets an integer value for the attribute name.
87 * @remarks The @a attr_name is key value, one of several properties of the resource type.
88 * @remarks The function replaces any existing value for the given @a attr_name.
90 * @param[in] payload The SmartThings payload handle
91 * @param[in] attr_name The attribute name
92 * @param[in] value The value to set
94 * @return @c 0 on success,
95 * otherwise a negative error value
96 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
97 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
99 int smartthings_payload_set_int(smartthings_payload_h payload, const char *attr_name, int value);
102 * @brief Sets a boolean value for the attribute name.
105 * @remarks The @a attr_name is key value, one of several properties of the resource type.
106 * @remarks The function replaces any existing value for the given @a attr_name.
108 * @param[in] payload The SmartThings payload handle
109 * @param[in] attr_name The attribute name
110 * @param[in] value The value to set
112 * @return @c 0 on success,
113 * otherwise a negative error value
114 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
115 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
117 int smartthings_payload_set_bool(smartthings_payload_h payload, const char *attr_name, bool value);
120 * @brief Sets a double value for the attribute name.
123 * @remarks The @a attr_name is key value, one of several properties of the resource type.
124 * @remarks The function replaces any existing value for the given @a attr_name.
126 * @param[in] payload The SmartThings payload handle
127 * @param[in] attr_name The attribute name
128 * @param[in] value The value to set
130 * @return @c 0 on success,
131 * otherwise a negative error value
132 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
133 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
135 int smartthings_payload_set_double(smartthings_payload_h payload, const char *attr_name, double value);
138 * @brief Sets a string value for the attribute name.
141 * @remarks The @a attr_name is key value, one of several properties of the resource type.
142 * @remarks The function replaces any existing value for the given @a attr_name.
144 * @param[in] payload The SmartThings payload handle
145 * @param[in] attr_name The attribute name
146 * @param[in] value The value to set
148 * @return @c 0 on success,
149 * otherwise a negative error value
150 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
151 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
153 int smartthings_payload_set_string(smartthings_payload_h payload, const char *attr_name, const char *value);
156 * @brief Sets a byte string value and length for the attribute name.
159 * @remarks The @a attr_name is key value, one of several properties of the resource type.
160 * @remarks The function replaces any existing value for the given @a attr_name.
162 * @param[in] payload The SmartThings payload handle
163 * @param[in] attr_name The attribute name
164 * @param[in] value The value to set
165 * @param[in] length The size of value
167 * @return @c 0 on success,
168 * otherwise a negative error value
169 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
170 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
171 * @retval #SMARTTHINGS_RESOURCE_ERROR_OPERATION_FAILED Operation failed
173 int smartthings_payload_set_byte_string(smartthings_payload_h payload, const char *attr_name, const char *value, unsigned int length);
176 * @brief Sets an object value for the attribute name.
179 * @remarks The @a attr_name is key value, one of several properties of the resource type.
180 * @remarks The @a value is SmartThings payload handle.
181 * @remarks The function replaces any existing value for the given @a attr_name.
183 * @param[in] payload The SmartThings payload handle
184 * @param[in] attr_name The attribute name
185 * @param[in] value The value to set
187 * @return @c 0 on success,
188 * otherwise a negative error value
189 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
190 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
192 int smartthings_payload_set_object(smartthings_payload_h payload, const char *attr_name, smartthings_payload_h value);
195 * @brief Sets an integer array for the attribute name.
198 * @remarks The @a attr_name is key value, one of several properties of the resource type.
199 * @remarks The function replaces any existing array for the given @a attr_name.
201 * @param[in] payload The SmartThings payload handle
202 * @param[in] attr_name The attribute name
203 * @param[in] array The array associated with the given attribute name
204 * @param[in] length The length of @a array
206 * @return @c 0 on success,
207 * otherwise a negative error value
208 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
209 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
211 int smartthings_payload_set_int_array(smartthings_payload_h payload, const char *attr_name, const int *array, unsigned int length);
214 * @brief Sets a boolean array for the attribute name.
217 * @remarks The @a attr_name is key value, one of several properties of the resource type.
218 * @remarks The function replaces any existing array for the given @a attr_name.
220 * @param[in] payload The SmartThings payload handle
221 * @param[in] attr_name The attribute name
222 * @param[in] array The array associated with the given attribute name
223 * @param[in] length The length of @a array
225 * @return @c 0 on success,
226 * otherwise a negative error value
227 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
228 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
230 int smartthings_payload_set_bool_array(smartthings_payload_h payload, const char *attr_name, const bool *array, unsigned int length);
233 * @brief Sets a double array for the attribute name.
236 * @remarks The @a attr_name is key value, one of several properties of the resource type.
237 * @remarks The function replaces any existing array for the given @a attr_name.
239 * @param[in] payload The SmartThings payload handle
240 * @param[in] attr_name The attribute name
241 * @param[in] array The array associated with the given attribute name
242 * @param[in] length The length of @a array
244 * @return @c 0 on success,
245 * otherwise a negative error value
246 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
247 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
249 int smartthings_payload_set_double_array(smartthings_payload_h payload, const char *attr_name, const double *array, unsigned int length);
252 * @brief Sets a string array for the attribute name.
255 * @remarks The @a attr_name is key value, one of several properties of the resource type.
256 * @remarks The function replaces any existing array for the given @a attr_name.
258 * @param[in] payload The SmartThings payload handle
259 * @param[in] attr_name The attribute name
260 * @param[in] array The array associated with the given attribute name
261 * @param[in] length The length of @a array
263 * @return @c 0 on success,
264 * otherwise a negative error value
265 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
266 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
268 int smartthings_payload_set_string_array(smartthings_payload_h payload, const char *attr_name, const char **array, unsigned int length);
271 * @brief Sets an object array for the attribute name.
274 * @remarks The @a attr_name is key value, one of several properties of the resource type.
275 * @remarks The function replaces any existing array for the given @a attr_name.
277 * @param[in] payload The SmartThings payload handle
278 * @param[in] attr_name The attribute name
279 * @param[in] array The array associated with the given attribute name
280 * @param[in] length The length of @a array
282 * @return @c 0 on success,
283 * otherwise a negative error value
284 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
285 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
286 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
288 int smartthings_payload_set_object_array(smartthings_payload_h payload, const char *attr_name, smartthings_payload_h *array, unsigned int length);
291 * @brief Adds a payload for child resource of collection resource.
294 * @remarks The @a resource_uri is key value, one of several child resources of the collection resource.
295 * @remarks The @a value is SmartThings payload handle.
296 * @remarks The function replaces any existing payload for the given @a resource_uri.
298 * @param[in] payload The SmartThings payload handle
299 * @param[in] resource_uri The resource URI of child resource
300 * @param[in] value The payload associated with the given resource URI
302 * @return @c 0 on success,
303 * otherwise a negative error value
304 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
305 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
307 int smartthings_payload_add_collection_object(smartthings_payload_h payload, const char *resource_uri, smartthings_payload_h value);
310 * @brief Gets an integer value for the attribute name.
313 * @remarks The @a attr_name is key value, one of several properties of the resource type.
315 * @param[in] payload The SmartThings payload handle
316 * @param[in] attr_name The attribute name
317 * @param[out] value The value associated with the given attribute name
319 * @return @c 0 on success,
320 * otherwise a negative error value
321 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
322 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
323 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
325 int smartthings_payload_get_int(smartthings_payload_h payload, const char *attr_name, int *value);
328 * @brief Gets a boolean value for the attribute name.
331 * @remarks The @a attr_name is key value, one of several properties of the resource type.
333 * @param[in] payload The SmartThings payload handle
334 * @param[in] attr_name The attribute name
335 * @param[out] value The value associated with the given attribute name
337 * @return @c 0 on success,
338 * otherwise a negative error value
339 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
340 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
341 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
343 int smartthings_payload_get_bool(smartthings_payload_h payload, const char *attr_name, bool *value);
346 * @brief Gets a double value for the attribute name.
349 * @remarks The @a attr_name is key value, one of several properties of the resource type.
351 * @param[in] payload The SmartThings payload handle
352 * @param[in] attr_name The attribute name
353 * @param[out] value The value associated with the given attribute name
355 * @return @c 0 on success,
356 * otherwise a negative error value
357 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
358 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
359 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
361 int smartthings_payload_get_double(smartthings_payload_h payload, const char *attr_name, double *value);
364 * @brief Gets a string value for the attribute name.
367 * @remarks The @a attr_name is key value, one of several properties of the resource type.
368 * @remarks The @a value should be released using free().
370 * @param[in] payload The SmartThings payload handle
371 * @param[in] attr_name The attribute name
372 * @param[out] value The value associated with the given attribute name
374 * @return @c 0 on success,
375 * otherwise a negative error value
376 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
377 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
378 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
380 int smartthings_payload_get_string(smartthings_payload_h payload, const char *attr_name, char **value);
383 * @brief Gets a byte string value and length for the attribute name.
386 * @remarks The @a attr_name is key value, one of several properties of the resource type.
387 * @remarks The @a value should be released using free().
389 * @param[in] payload The SmartThings payload handle
390 * @param[in] attr_name The attribute name
391 * @param[out] value The value associated with the given attribute name
392 * @param[out] length The size of value
394 * @return @c 0 on success,
395 * otherwise a negative error value
396 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
397 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
398 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
400 int smartthings_payload_get_byte_string(smartthings_payload_h payload, const char *attr_name, char **value, unsigned int *length);
403 * @brief Gets an object value for the attribute name.
406 * @remarks The @a attr_name is key value, one of several properties of the resource type.
407 * @remarks The @a value is SmartThings payload handle.
408 * @remarks The @a value must be released using smartthings_payload_release_object().
410 * @param[in] payload The SmartThings payload handle
411 * @param[in] attr_name The attribute name
412 * @param[out] value The value associated with the given attribute name
414 * @return @c 0 on success,
415 * otherwise a negative error value
416 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
417 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
418 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
419 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
421 int smartthings_payload_get_object(smartthings_payload_h payload, const char *attr_name, smartthings_payload_h *value);
424 * @brief Gets an integer array for the attribute name.
427 * @remarks The @a attr_name is key value, one of several properties of the resource type.
428 * @remarks The @a array must be released using smartthings_payload_release_int_array().
430 * @param[in] payload The SmartThings payload handle
431 * @param[in] attr_name The attribute name
432 * @param[out] array The array associated with the given attribute name
433 * @param[out] length The length of @a array
435 * @return @c 0 on success,
436 * otherwise a negative error value
437 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
438 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
439 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
440 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
442 * @see smartthings_payload_release_int_array()
444 int smartthings_payload_get_int_array(smartthings_payload_h payload, const char *attr_name, int **array, unsigned int *length);
447 * @brief Gets a boolean array for the attribute name.
450 * @remarks The @a attr_name is key value, one of several properties of the resource type.
451 * @remarks The @a array must be released using smartthings_payload_release_bool_array().
453 * @param[in] payload The SmartThings payload handle
454 * @param[in] attr_name The attribute name
455 * @param[out] array The array associated with the given attribute name
456 * @param[out] length The length of @a array
458 * @return @c 0 on success,
459 * otherwise a negative error value
460 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
461 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
462 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
463 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
465 * @see smartthings_payload_release_bool_array()
467 int smartthings_payload_get_bool_array(smartthings_payload_h payload, const char *attr_name, bool **array, unsigned int *length);
470 * @brief Gets a double array for the attribute name.
473 * @remarks The @a attr_name is key value, one of several properties of the resource type.
474 * @remarks The @a array must be released using smartthings_payload_release_double_array().
476 * @param[in] payload The SmartThings payload handle
477 * @param[in] attr_name The attribute name
478 * @param[out] array The array associated with the given attribute name
479 * @param[out] length The length of @a array
481 * @return @c 0 on success,
482 * otherwise a negative error value
483 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
484 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
485 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
486 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
488 * @see smartthings_payload_release_double_array()
490 int smartthings_payload_get_double_array(smartthings_payload_h payload, const char *attr_name, double **array, unsigned int *length);
493 * @brief Gets a string array for the attribute name.
496 * @remarks The @a attr_name is key value, one of several properties of the resource type.
497 * @remarks The @a array must be released using smartthings_payload_release_string_array().
499 * @param[in] payload The SmartThings payload handle
500 * @param[in] attr_name The attribute name
501 * @param[out] array The array associated with the given attribute name
502 * @param[out] length The length of @a array
504 * @return @c 0 on success,
505 * otherwise a negative error value
506 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
507 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
508 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
509 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
511 * @see smartthings_payload_release_string_array()
513 int smartthings_payload_get_string_array(smartthings_payload_h payload, const char *attr_name, char ***array, unsigned int *length);
516 * @brief Gets an object array for the attribute name.
519 * @remarks The @a attr_name is key value, one of several properties of the resource type.
520 * @remarks The @a array is a list of SmartThings payload handle.
521 * @remarks The @a array must be released using smartthings_payload_release_object_array().
523 * @param[in] payload The SmartThings payload handle
524 * @param[in] attr_name The attribute name
525 * @param[out] array The array associated with the given attribute name
526 * @param[out] length The length of @a array
528 * @return @c 0 on success,
529 * otherwise a negative error value
530 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
531 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
532 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
533 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
535 * @see smartthings_payload_release_object_array()
537 int smartthings_payload_get_object_array(smartthings_payload_h payload, const char *attr_name, smartthings_payload_h **array, unsigned int *length);
540 * @brief Gets a payload for child resource of collection resource.
543 * @remarks The @a resource_uri is key value, one of several child resources of the collection resource.
544 * @remarks The @a value is SmartThings payload handle.
545 * @remarks The @a value must be released using smartthings_payload_release_object().
547 * @param[in] payload The SmartThings payload handle
548 * @param[in] resource_uri The resource URI of child resource
549 * @param[out] value The payload associated with the given resource URI
551 * @return @c 0 on success,
552 * otherwise a negative error value
553 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
554 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
555 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
556 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
558 int smartthings_payload_get_collection_object(smartthings_payload_h payload, const char *resource_uri, smartthings_payload_h *value);
561 * @brief Releases an integer array of the SmartThings payload.
564 * @param[in] array The array to release
566 * @return @c 0 on success,
567 * otherwise a negative error value
568 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
569 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
571 * @see smartthings_payload_get_int_array()
573 int smartthings_payload_release_int_array(int *array);
576 * @brief Releases a boolean array of the SmartThings payload.
579 * @param[in] array The array to release
581 * @return @c 0 on success,
582 * otherwise a negative error value
583 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
584 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
586 * @see smartthings_payload_get_bool_array()
588 int smartthings_payload_release_bool_array(bool *array);
591 * @brief Releases a double array of the SmartThings payload.
594 * @param[in] array The array to release
596 * @return @c 0 on success,
597 * otherwise a negative error value
598 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
599 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
601 * @see smartthings_payload_get_double_array()
603 int smartthings_payload_release_double_array(double *array);
606 * @brief Releases a string array of the SmartThings payload.
609 * @param[in] array The array to release
610 * @param[in] length The length of @a array
612 * @return @c 0 on success,
613 * otherwise a negative error value
614 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
615 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
617 * @see smartthings_payload_get_string_array()
619 int smartthings_payload_release_string_array(char **array, unsigned int length);
622 * @brief Releases an object array of the SmartThings payload.
625 * @param[in] array The array to release
626 * @param[in] length The length of @a array
628 * @return @c 0 on success,
629 * otherwise a negative error value
630 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
631 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
633 * @see smartthings_payload_get_object_array()
635 int smartthings_payload_release_object_array(smartthings_payload_h *array, unsigned int length);
638 * @brief Releases a SmartThings payload.
641 * @remarks The function is different with smartthings_payload_destroy().
642 * @remarks The function releases only payload value that is obtained by smartthings_payload_get_object().
644 * @param[in] payload The payload to release
646 * @return @c 0 on success,
647 * otherwise a negative error value
648 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
649 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
651 * @see smartthings_payload_get_object()
653 int smartthings_payload_release_object(smartthings_payload_h payload);
663 #endif /* __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_PAYLOAD_H__ */