/**
 * Appcelerator Platform SDK
 * Copyright (c) 2014 by Appcelerator, Inc. All Rights Reserved.
 * Proprietary and Confidential - This source code is not for redistribution
 */

#import <Foundation/Foundation.h>
#import "APSCloud.h"


/**
 * The CustomObjects API lets you define your own object types that can be integrated with existing APS objects.
 * The REST object of this class contains the following fields:<ul>
 * <li>acls (APSACLs[]): Single-element array containing the ACL associated with this object (if any).</li>
 * <li>created_at (NSString): Creation date for this user object.</li>
 * <li>id (NSString): Generated unique ID for this object.</li>
 * <li>photo (APSPhotos): Primary photo for this object.</li>
 * <li>tags (NSString[]): List of tags associated with this object.</li>
 * <li>updated_at (NSString): Last update time for this user object.</li>
 * <li>user (APSUsers): Owner of this object.</li>
 * </ul>
 * For more details about the underlying REST object, see the [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/Objects).
 */

@interface APSObjects : NSObject




/**
 * Create a custom object of type class_name. 
 *
 * To use this method, **a user must be logged in before calling this method.**
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/CustomObjects-method-create).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>class_name (NSString): Type of custom object. (required)</li>
 * <li>fields (NSDictionary): JSON encoding of object fields. (required)</li>
 * <li>tags (NSString): Comma-separated list of tags associated with this object.</li>
 * <li>photo (APSPhotos): New photo to attach as the primary photo for the object.</li>
 * <li>photo_id (NSString): ID of an existing photo to attach as the primary photo for the object.</li>
 * <li>acl_name (NSString): Name of an ACLs to associate with this checkin object.</li>
 * <li>acl_id (NSString): ID of an ACLs to associate with this checkin object.</li>
 * <li>user_id (NSString): User ID to create the object on behalf of.</li>
 * </ul>
 * @param handler Callback to handle the server response. See the Callback section in APSClient.
 * The response data returns the following method-specific properties:<ul>
 * <li>classname (APSObjects[]): A single-element array containing the newly-created custom object is returned in the classname property, where classname is the classname specified in the creation URL.</li>
 * </ul>
 */

+ (void)create:(NSDictionary *)data withBlock:(APSResponseHandler)handler;


/**
 * Create a custom object of type class_name. 
 *
 * To use this method, **a user must be logged in before calling this method.**
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/CustomObjects-method-create).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>class_name (NSString): Type of custom object. (required)</li>
 * <li>fields (NSDictionary): JSON encoding of object fields. (required)</li>
 * <li>tags (NSString): Comma-separated list of tags associated with this object.</li>
 * <li>photo (APSPhotos): New photo to attach as the primary photo for the object.</li>
 * <li>photo_id (NSString): ID of an existing photo to attach as the primary photo for the object.</li>
 * <li>acl_name (NSString): Name of an ACLs to associate with this checkin object.</li>
 * <li>acl_id (NSString): ID of an ACLs to associate with this checkin object.</li>
 * <li>user_id (NSString): User ID to create the object on behalf of.</li>
 * </ul>
 * @param handler Callback to handle the server response. See the Callback section in APSClient.
 * The response data returns the following method-specific properties:<ul>
 * <li>classname (APSObjects[]): A single-element array containing the newly-created custom object is returned in the classname property, where classname is the classname specified in the creation URL.</li>
 * </ul>
 * @param progressHandler Callback to handle the progress of the request. See the Callback section in APSClient.
 */

+ (void)create:(NSDictionary *)data withBlock:(APSResponseHandler)handler progressBlock:(APSProgressHandler)progressHandler;




/**
 * Show a custom object's info. 
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/CustomObjects-method-show).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>class_name (NSString): Type of custom object. (required)</li>
 * <li>id (NSString): The object ID of the custom object to show.</li>
 * <li>ids (NSString): A comma-separated list of object IDs of the custom objects to show.</li>
 * <li>response_json_depth (NSNumber): Nested object depth level counts in response json.</li>
 * <li>show_user_like (NSBoolean): If set to true the CustomObject in the response will include "current_user_liked: true" if the current user has liked the object.</li>
 * </ul>
 * @param handler Callback to handle the server response. See the Callback section in APSClient.
 * The response data returns the following method-specific properties:<ul>
 * <li>classname (APSObjects[]): The classname property stores a list of custom objects matching the specified ID or IDs, where classname matches the classname used in the URL.</li>
 * </ul>
 */

+ (void)show:(NSDictionary *)data withBlock:(APSResponseHandler)handler;




/**
 * Any of the same parameters as Create Custom Object can be used to update a custom object. 
 *
 * To use this method, **a user must be logged in before calling this method.**
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/CustomObjects-method-update).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>id (NSString): The object ID of the custom object to update. (required)</li>
 * <li>fields (NSDictionary): JSON encoding of object fields to update. (required)</li>
 * <li>tags (NSString): Comma-separated list of tags to associate with this object, for example, "hiking,swiming.</li>
 * <li>photo (APSPhotos): New photo to attach as the primary photo for the object.</li>
 * <li>photo_id (NSString): ID of an existing photo to attach as the primary photo for the object.</li>
 * <li>acl_name (NSString): Name of an ACLs to associate with this object.</li>
 * <li>acl_id (NSString): ID of an ACLs to associate with this object.</li>
 * <li>user_id (NSString): User to update the Custom object on behalf of.</li>
 * </ul>
 * @param handler Callback to handle the server response. See the Callback section in APSClient.
 * The response data returns the following method-specific properties:<ul>
 * <li>classname (NSDictionary[]): The response object has a classname property, where classname matches the classname used in the URL.</li>
 * </ul>
 */

+ (void)update:(NSDictionary *)data withBlock:(APSResponseHandler)handler;


/**
 * Any of the same parameters as Create Custom Object can be used to update a custom object. 
 *
 * To use this method, **a user must be logged in before calling this method.**
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/CustomObjects-method-update).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>id (NSString): The object ID of the custom object to update. (required)</li>
 * <li>fields (NSDictionary): JSON encoding of object fields to update. (required)</li>
 * <li>tags (NSString): Comma-separated list of tags to associate with this object, for example, "hiking,swiming.</li>
 * <li>photo (APSPhotos): New photo to attach as the primary photo for the object.</li>
 * <li>photo_id (NSString): ID of an existing photo to attach as the primary photo for the object.</li>
 * <li>acl_name (NSString): Name of an ACLs to associate with this object.</li>
 * <li>acl_id (NSString): ID of an ACLs to associate with this object.</li>
 * <li>user_id (NSString): User to update the Custom object on behalf of.</li>
 * </ul>
 * @param handler Callback to handle the server response. See the Callback section in APSClient.
 * The response data returns the following method-specific properties:<ul>
 * <li>classname (NSDictionary[]): The response object has a classname property, where classname matches the classname used in the URL.</li>
 * </ul>
 * @param progressHandler Callback to handle the progress of the request. See the Callback section in APSClient.
 */

+ (void)update:(NSDictionary *)data withBlock:(APSResponseHandler)handler progressBlock:(APSProgressHandler)progressHandler;




/**
 * Only the owner of the object or user who is granted write permission by the object's ACL can delete the object. 
 *
 * To use this method, **a user must be logged in before calling this method.**
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/CustomObjects-method-delete).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>class_name (NSString): Type of custom object. (required)</li>
 * <li>id (NSString): The object ID of the custom object to delete.</li>
 * <li>ids (NSString): A comma-separated list of object IDs of the custom objects to delete.</li>
 * <li>user_id (NSString): User to delete the Custom object on behalf of.</li>
 * </ul>
 * @param handler Callback to handle the server response. See the Callback section in APSClient.
 */

+ (void)remove:(NSDictionary *)data withBlock:(APSResponseHandler)handler;




/**
 * Query custom object by specified fields with sorting and paginating. 
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/CustomObjects-method-query).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>class_name (NSString): Type of custom object. (required)</li>
 * <li>page (NSNumber): Request page number, default is 1.</li>
 * <li>per_page (NSNumber): Number of results per page, default is 10.</li>
 * <li>limit (NSNumber): Instead of using page and per_page for pagination, you can use limit and skip to do your own pagination.</li>
 * <li>skip (NSNumber): Number of records to skip.</li>
 * <li>show_user_like (NSBoolean): If set to true, each CustomObject in the response includes "current_user_liked: true"  if the current user has liked the object.</li>
 * <li>where (NSDictionary): Constraint values for fields.</li>
 * <li>order (NSString): Sort results by one or more fields, specified as a comma-separated list of field names.</li>
 * <li>sel (NSDictionary): Selects the object fields to display.</li>
 * <li>unsel (NSDictionary): Selects the object fields NOT to display.</li>
 * <li>response_json_depth (NSNumber): Nested object depth level counts in response json.</li>
 * </ul>
 * @param handler Callback to handle the server response. See the Callback section in APSClient.
 * The response data returns the following method-specific properties:<ul>
 * <li>classname (NSDictionary[]): The classname property stores a list of custom objects matching the query parameters.</li>
 * </ul>
 */

+ (void)query:(NSDictionary *)data withBlock:(APSResponseHandler)handler;



@end
