2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_PAYLOAD_H__
18 #define __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_PAYLOAD_H__
29 * @file smartthings_payload.h
33 * @addtogroup CAPI_SMARTTHINGS_THING_PAYLOAD_MODULE
38 * @brief The SmartThings payload handle.
41 typedef struct smartthings_payload_s *smartthings_payload_h;
44 * @brief Creates a SmartThings payload handle.
47 * @remarks The @a payload must be released using smartthings_payload_destroy().
48 * @remarks If the @a payload is set to parent payload as an object or object array
49 * using smartthings_payload_set_object() or smartthings_payload_set_object_array(),
50 * the @a payload must not be released.
52 * @param[out] payload The SmartThings payload handle to be newly created on success
53 * @return @c 0 on success,
54 * otherwise a negative error value
55 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
56 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
57 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
59 * @see smartthings_payload_destroy()
61 int smartthings_payload_create(smartthings_payload_h *payload);
64 * @brief Destroys a SmartThings payload handle and releases all its resources.
67 * @remarks If the @a payload has child payload, its child payload will be released as well.
69 * @param[in] payload The SmartThings payload handle
71 * @return @c 0 on success,
72 * otherwise a negative error value
73 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
74 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
76 * @see smartthings_payload_create()
78 int smartthings_payload_destroy(smartthings_payload_h payload);
81 * @brief Sets an integer value for the attribute name.
84 * @remarks The @a attr_name is key value, one of several properties of the resource type.
85 * @remarks The function replaces any existing value for the given @a attr_name.
87 * @param[in] payload The SmartThings payload handle
88 * @param[in] attr_name The attribute name
89 * @param[in] value The value to set
91 * @return @c 0 on success,
92 * otherwise a negative error value
93 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
94 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
96 int smartthings_payload_set_int(smartthings_payload_h payload, const char *attr_name, int value);
99 * @brief Sets a boolean value for the attribute name.
102 * @remarks The @a attr_name is key value, one of several properties of the resource type.
103 * @remarks The function replaces any existing value for the given @a attr_name.
105 * @param[in] payload The SmartThings payload handle
106 * @param[in] attr_name The attribute name
107 * @param[in] value The value to set
109 * @return @c 0 on success,
110 * otherwise a negative error value
111 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
112 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
114 int smartthings_payload_set_bool(smartthings_payload_h payload, const char *attr_name, bool value);
117 * @brief Sets a double value for the attribute name.
120 * @remarks The @a attr_name is key value, one of several properties of the resource type.
121 * @remarks The function replaces any existing value for the given @a attr_name.
123 * @param[in] payload The SmartThings payload handle
124 * @param[in] attr_name The attribute name
125 * @param[in] value The value to set
127 * @return @c 0 on success,
128 * otherwise a negative error value
129 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
130 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
132 int smartthings_payload_set_double(smartthings_payload_h payload, const char *attr_name, double value);
135 * @brief Sets a string value for the attribute name.
138 * @remarks The @a attr_name is key value, one of several properties of the resource type.
139 * @remarks The function replaces any existing value for the given @a attr_name.
141 * @param[in] payload The SmartThings payload handle
142 * @param[in] attr_name The attribute name
143 * @param[in] value The value to set
145 * @return @c 0 on success,
146 * otherwise a negative error value
147 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
148 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
150 int smartthings_payload_set_string(smartthings_payload_h payload, const char *attr_name, const char *value);
153 * @brief Sets a byte string value and length for the attribute name.
156 * @remarks The @a attr_name is key value, one of several properties of the resource type.
157 * @remarks The function replaces any existing value for the given @a attr_name.
159 * @param[in] payload The SmartThings payload handle
160 * @param[in] attr_name The attribute name
161 * @param[in] value The value to set
162 * @param[in] length The size of value
164 * @return @c 0 on success,
165 * otherwise a negative error value
166 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
167 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
168 * @retval #SMARTTHINGS_RESOURCE_ERROR_OPERATION_FAILED Operation failed
170 int smartthings_payload_set_byte_string(smartthings_payload_h payload, const char *attr_name, const char *value, unsigned int length);
173 * @brief Sets an object value for the attribute name.
176 * @remarks The @a attr_name is key value, one of several properties of the resource type.
177 * @remarks The @a value is SmartThings payload handle.
178 * @remarks The function replaces any existing value for the given @a attr_name.
180 * @param[in] payload The SmartThings payload handle
181 * @param[in] attr_name The attribute name
182 * @param[in] value The value to set
184 * @return @c 0 on success,
185 * otherwise a negative error value
186 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
187 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
189 int smartthings_payload_set_object(smartthings_payload_h payload, const char *attr_name, smartthings_payload_h value);
192 * @brief Sets an integer array for the attribute name.
195 * @remarks The @a attr_name is key value, one of several properties of the resource type.
196 * @remarks The function replaces any existing array for the given @a attr_name.
198 * @param[in] payload The SmartThings payload handle
199 * @param[in] attr_name The attribute name
200 * @param[in] array The array associated with the given attribute name
201 * @param[in] length The length of @a array
203 * @return @c 0 on success,
204 * otherwise a negative error value
205 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
206 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
208 int smartthings_payload_set_int_array(smartthings_payload_h payload, const char *attr_name, const int *array, unsigned int length);
211 * @brief Sets a boolean array for the attribute name.
214 * @remarks The @a attr_name is key value, one of several properties of the resource type.
215 * @remarks The function replaces any existing array for the given @a attr_name.
217 * @param[in] payload The SmartThings payload handle
218 * @param[in] attr_name The attribute name
219 * @param[in] array The array associated with the given attribute name
220 * @param[in] length The length of @a array
222 * @return @c 0 on success,
223 * otherwise a negative error value
224 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
225 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
227 int smartthings_payload_set_bool_array(smartthings_payload_h payload, const char *attr_name, const bool *array, unsigned int length);
230 * @brief Sets a double array for the attribute name.
233 * @remarks The @a attr_name is key value, one of several properties of the resource type.
234 * @remarks The function replaces any existing array for the given @a attr_name.
236 * @param[in] payload The SmartThings payload handle
237 * @param[in] attr_name The attribute name
238 * @param[in] array The array associated with the given attribute name
239 * @param[in] length The length of @a array
241 * @return @c 0 on success,
242 * otherwise a negative error value
243 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
244 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
246 int smartthings_payload_set_double_array(smartthings_payload_h payload, const char *attr_name, const double *array, unsigned int length);
249 * @brief Sets a string array for the attribute name.
252 * @remarks The @a attr_name is key value, one of several properties of the resource type.
253 * @remarks The function replaces any existing array for the given @a attr_name.
255 * @param[in] payload The SmartThings payload handle
256 * @param[in] attr_name The attribute name
257 * @param[in] array The array associated with the given attribute name
258 * @param[in] length The length of @a array
260 * @return @c 0 on success,
261 * otherwise a negative error value
262 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
263 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
265 int smartthings_payload_set_string_array(smartthings_payload_h payload, const char *attr_name, const char **array, unsigned int length);
268 * @brief Sets an object array for the attribute name.
271 * @remarks The @a attr_name is key value, one of several properties of the resource type.
272 * @remarks The function replaces any existing array for the given @a attr_name.
274 * @param[in] payload The SmartThings payload handle
275 * @param[in] attr_name The attribute name
276 * @param[in] array The array associated with the given attribute name
277 * @param[in] length The length of @a array
279 * @return @c 0 on success,
280 * otherwise a negative error value
281 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
282 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
283 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
285 int smartthings_payload_set_object_array(smartthings_payload_h payload, const char *attr_name, smartthings_payload_h *array, unsigned int length);
288 * @brief Adds a payload for child resource of collection resource.
291 * @remarks The @a resource_uri is key value, one of several child resources of the collection resource.
292 * @remarks The @a value is SmartThings payload handle.
293 * @remarks The function replaces any existing payload for the given @a resource_uri.
295 * @param[in] payload The SmartThings payload handle
296 * @param[in] resource_uri The resource URI of child resource
297 * @param[in] value The payload associated with the given resource URI
299 * @return @c 0 on success,
300 * otherwise a negative error value
301 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
302 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
304 int smartthings_payload_add_collection_object(smartthings_payload_h payload, const char *resource_uri, smartthings_payload_h value);
307 * @brief Gets an integer value for the attribute name.
310 * @remarks The @a attr_name is key value, one of several properties of the resource type.
312 * @param[in] payload The SmartThings payload handle
313 * @param[in] attr_name The attribute name
314 * @param[out] value The value associated with the given attribute name
316 * @return @c 0 on success,
317 * otherwise a negative error value
318 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
319 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
320 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
322 int smartthings_payload_get_int(smartthings_payload_h payload, const char *attr_name, int *value);
325 * @brief Gets a boolean value for the attribute name.
328 * @remarks The @a attr_name is key value, one of several properties of the resource type.
330 * @param[in] payload The SmartThings payload handle
331 * @param[in] attr_name The attribute name
332 * @param[out] value The value associated with the given attribute name
334 * @return @c 0 on success,
335 * otherwise a negative error value
336 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
337 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
338 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
340 int smartthings_payload_get_bool(smartthings_payload_h payload, const char *attr_name, bool *value);
343 * @brief Gets a double value for the attribute name.
346 * @remarks The @a attr_name is key value, one of several properties of the resource type.
348 * @param[in] payload The SmartThings payload handle
349 * @param[in] attr_name The attribute name
350 * @param[out] value The value associated with the given attribute name
352 * @return @c 0 on success,
353 * otherwise a negative error value
354 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
355 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
356 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
358 int smartthings_payload_get_double(smartthings_payload_h payload, const char *attr_name, double *value);
361 * @brief Gets a string value for the attribute name.
364 * @remarks The @a attr_name is key value, one of several properties of the resource type.
365 * @remarks The @a value should be released using free().
367 * @param[in] payload The SmartThings payload handle
368 * @param[in] attr_name The attribute name
369 * @param[out] value The value associated with the given attribute name
371 * @return @c 0 on success,
372 * otherwise a negative error value
373 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
374 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
375 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
377 int smartthings_payload_get_string(smartthings_payload_h payload, const char *attr_name, char **value);
380 * @brief Gets a byte string value and length for the attribute name.
383 * @remarks The @a attr_name is key value, one of several properties of the resource type.
384 * @remarks The @a value should be released using free().
386 * @param[in] payload The SmartThings payload handle
387 * @param[in] attr_name The attribute name
388 * @param[out] value The value associated with the given attribute name
389 * @param[out] length The size of value
391 * @return @c 0 on success,
392 * otherwise a negative error value
393 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
394 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
395 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
397 int smartthings_payload_get_byte_string(smartthings_payload_h payload, const char *attr_name, char **value, unsigned int *length);
400 * @brief Gets an object value for the attribute name.
403 * @remarks The @a attr_name is key value, one of several properties of the resource type.
404 * @remarks The @a value is SmartThings payload handle.
405 * @remarks The @a value must be released using smartthings_payload_release_object().
407 * @param[in] payload The SmartThings payload handle
408 * @param[in] attr_name The attribute name
409 * @param[out] value The value associated with the given attribute name
411 * @return @c 0 on success,
412 * otherwise a negative error value
413 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
414 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
415 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
416 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
418 int smartthings_payload_get_object(smartthings_payload_h payload, const char *attr_name, smartthings_payload_h *value);
421 * @brief Gets an integer array for the attribute name.
424 * @remarks The @a attr_name is key value, one of several properties of the resource type.
425 * @remarks The @a array must be released using smartthings_payload_release_int_array().
427 * @param[in] payload The SmartThings payload handle
428 * @param[in] attr_name The attribute name
429 * @param[out] array The array associated with the given attribute name
430 * @param[out] length The length of @a array
432 * @return @c 0 on success,
433 * otherwise a negative error value
434 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
435 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
436 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
437 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
439 * @see smartthings_payload_release_int_array()
441 int smartthings_payload_get_int_array(smartthings_payload_h payload, const char *attr_name, int **array, unsigned int *length);
444 * @brief Gets a boolean array for the attribute name.
447 * @remarks The @a attr_name is key value, one of several properties of the resource type.
448 * @remarks The @a array must be released using smartthings_payload_release_bool_array().
450 * @param[in] payload The SmartThings payload handle
451 * @param[in] attr_name The attribute name
452 * @param[out] array The array associated with the given attribute name
453 * @param[out] length The length of @a array
455 * @return @c 0 on success,
456 * otherwise a negative error value
457 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
458 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
459 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
460 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
462 * @see smartthings_payload_release_bool_array()
464 int smartthings_payload_get_bool_array(smartthings_payload_h payload, const char *attr_name, bool **array, unsigned int *length);
467 * @brief Gets a double array for the attribute name.
470 * @remarks The @a attr_name is key value, one of several properties of the resource type.
471 * @remarks The @a array must be released using smartthings_payload_release_double_array().
473 * @param[in] payload The SmartThings payload handle
474 * @param[in] attr_name The attribute name
475 * @param[out] array The array associated with the given attribute name
476 * @param[out] length The length of @a array
478 * @return @c 0 on success,
479 * otherwise a negative error value
480 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
481 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
482 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
483 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
485 * @see smartthings_payload_release_double_array()
487 int smartthings_payload_get_double_array(smartthings_payload_h payload, const char *attr_name, double **array, unsigned int *length);
490 * @brief Gets a string array for the attribute name.
493 * @remarks The @a attr_name is key value, one of several properties of the resource type.
494 * @remarks The @a array must be released using smartthings_payload_release_string_array().
496 * @param[in] payload The SmartThings payload handle
497 * @param[in] attr_name The attribute name
498 * @param[out] array The array associated with the given attribute name
499 * @param[out] length The length of @a array
501 * @return @c 0 on success,
502 * otherwise a negative error value
503 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
504 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
505 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
506 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
508 * @see smartthings_payload_release_string_array()
510 int smartthings_payload_get_string_array(smartthings_payload_h payload, const char *attr_name, char ***array, unsigned int *length);
513 * @brief Gets an object array for the attribute name.
516 * @remarks The @a attr_name is key value, one of several properties of the resource type.
517 * @remarks The @a array is a list of SmartThings payload handle.
518 * @remarks The @a array must be released using smartthings_payload_release_object_array().
520 * @param[in] payload The SmartThings payload handle
521 * @param[in] attr_name The attribute name
522 * @param[out] array The array associated with the given attribute name
523 * @param[out] length The length of @a array
525 * @return @c 0 on success,
526 * otherwise a negative error value
527 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
528 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
529 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
530 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
532 * @see smartthings_payload_release_object_array()
534 int smartthings_payload_get_object_array(smartthings_payload_h payload, const char *attr_name, smartthings_payload_h **array, unsigned int *length);
537 * @brief Gets a payload for child resource of collection resource.
540 * @remarks The @a resource_uri is key value, one of several child resources of the collection resource.
541 * @remarks The @a value is SmartThings payload handle.
542 * @remarks The @a value must be released using smartthings_payload_release_object().
544 * @param[in] payload The SmartThings payload handle
545 * @param[in] resource_uri The resource URI of child resource
546 * @param[out] value The payload associated with the given resource URI
548 * @return @c 0 on success,
549 * otherwise a negative error value
550 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
551 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
552 * @retval #SMARTTHINGS_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
553 * @retval #SMARTTHINGS_RESOURCE_ERROR_NO_DATA No data
555 int smartthings_payload_get_collection_object(smartthings_payload_h payload, const char *resource_uri, smartthings_payload_h *value);
558 * @brief Releases an integer array of the SmartThings payload.
561 * @param[in] array The array to release
563 * @return @c 0 on success,
564 * otherwise a negative error value
565 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
566 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
568 * @see smartthings_payload_get_int_array()
570 int smartthings_payload_release_int_array(int *array);
573 * @brief Releases a boolean array of the SmartThings payload.
576 * @param[in] array The array to release
578 * @return @c 0 on success,
579 * otherwise a negative error value
580 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
581 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
583 * @see smartthings_payload_get_bool_array()
585 int smartthings_payload_release_bool_array(bool *array);
588 * @brief Releases a double array of the SmartThings payload.
591 * @param[in] array The array to release
593 * @return @c 0 on success,
594 * otherwise a negative error value
595 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
596 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
598 * @see smartthings_payload_get_double_array()
600 int smartthings_payload_release_double_array(double *array);
603 * @brief Releases a string array of the SmartThings payload.
606 * @param[in] array The array to release
607 * @param[in] length The length of @a array
609 * @return @c 0 on success,
610 * otherwise a negative error value
611 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
612 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
614 * @see smartthings_payload_get_string_array()
616 int smartthings_payload_release_string_array(char **array, unsigned int length);
619 * @brief Releases an object array of the SmartThings payload.
622 * @param[in] array The array to release
623 * @param[in] length The length of @a array
625 * @return @c 0 on success,
626 * otherwise a negative error value
627 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
628 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
630 * @see smartthings_payload_get_object_array()
632 int smartthings_payload_release_object_array(smartthings_payload_h *array, unsigned int length);
635 * @brief Releases a SmartThings payload.
638 * @remarks The function is different with smartthings_payload_destroy().
639 * @remarks The function releases only payload value that is obtained by smartthings_payload_get_object().
641 * @param[in] payload The payload to release
643 * @return @c 0 on success,
644 * otherwise a negative error value
645 * @retval #SMARTTHINGS_RESOURCE_ERROR_NONE Successful
646 * @retval #SMARTTHINGS_RESOURCE_ERROR_INVALID_PARAMETER Invalid parameter
648 * @see smartthings_payload_get_object()
650 int smartthings_payload_release_object(smartthings_payload_h payload);
660 #endif /* __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_PAYLOAD_H__ */