/**
 * 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"


/**
 * This feature requires an Appcelerator Platform subscription, and the current user must be an application administrator to create, update or delete a geo-fence object.
 * The REST object of this class contains the following fields:<ul>
 * <li>created_at (NSString): Date when the geo-fence was created.</li>
 * <li>end_time (NSString): Datetime when the geo-fence expires.</li>
 * <li>id (NSString): Generated ID for this geo-fence.</li>
 * <li>loc (NSDictionary): JSON-encoded object describing the geographic perimeter of the geo-fence, specified as a circle with
a center point o</li>
 * <li>payload (NSDictionary): JSON-encoded data to retrieve if the geo-fence area intersects the device's location.</li>
 * <li>start_time (NSString): Datetime when to start the geo-fence.</li>
 * <li>update_at (NSString): Date when the geo-fence was updated.</li>
 * </ul>
 * For more details about the underlying REST object, see the [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/GeoFences).
 */

@interface APSGeoFences : NSObject




/**
 * Creates a geo-fence object with an optional start and end time. 
 *
 * 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/GeoFences-method-create).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>geo_fence (NSDictionary): JSON object describing the geographic perimeter, data payload, and start and end time for the geo-fence object. (required)</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>geo_fences (APSGeoFences[]): Single-element array containing the newly-created geo-fence object.</li>
 * </ul>
 */

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




/**
 * Updates an existing geo-fence 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/GeoFences-method-update).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>id (NSString): ID of the geo-fence object to update. (required)</li>
 * <li>geo_fence (NSDictionary): JSON object describing the geographic perimeter, data payload, and start and end time for the geo-fence 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>geo_fences (APSGeoFences[]): Single-element array containing the updated geo-fence object.</li>
 * </ul>
 */

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




/**
 * Deletes an existing geo-fence 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/GeoFences-method-delete).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>id (NSString): ID of the geo-fence object to delete. (required)</li>
 * </ul>
 * @param handler Callback to handle the server response. See the Callback section in APSClient.
 */

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




/**
 * Perform custom query of geofences with sorting and paginating. 
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/GeoFences-method-query).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <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>response_json_depth (NSNumber): Nested object depth level for response data.</li>
 * <li>skip (NSNumber): Number of records to skip.</li>
 * <li>where (NSDictionary): A JSON-encoded object that defines the query used.</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>geo_fences (APSGeoFences[]): List of geo-fence objects matching the query parameters.</li>
 * </ul>
 */

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



@end
