/**
 * 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 Places API provides methods to create and manage places.
 * 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>address (NSString): Address.</li>
 * <li>city (NSString): City.</li>
 * <li>country (NSString): Country.</li>
 * <li>custom_fields (NSString/NSDictionary): User defined fields. </li>
 * <li>latitude (NSNumber): Latitude.</li>
 * <li>longitude (NSNumber): Longitude.</li>
 * <li>name (NSString): Place name.</li>
 * <li>phone_number (NSString): Phone number.</li>
 * <li>photo (APSPhotos): Primary photo for this place.</li>
 * <li>postal_code (NSString): Postal or ZIP code.</li>
 * <li>ratings_average (NSNumber): Average rating for this object. </li>
 * <li>ratings_count (NSNumber): Total number of reviews for this object that include a rating. </li>
 * <li>ratings_summary (NSDictionary): Breakdown of the number of reviews that specified a given rating value. </li>
 * <li>reviews (APSReviews[]): List of reviews for this object. </li>
 * <li>reviews_count (NSNumber): Total number of reviews for this object. </li>
 * <li>state (NSString): State.</li>
 * <li>tags (NSString[]): List of tags for this object.</li>
 * <li>twitter (NSString): Twitter ID.</li>
 * <li>user (APSUsers): Owner of this place object.</li>
 * <li>website (NSString): Website.</li>
 * </ul>
 * For more details about the underlying REST object, see the [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/Places).
 */

@interface APSPlaces : NSObject




/**
 * Creates a new place 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/Places-method-create).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>name (NSString): Place name. (required)</li>
 * <li>address (NSString): Address.</li>
 * <li>city (NSString): City.</li>
 * <li>state (NSString): State.</li>
 * <li>postal_code (NSString): Postal or ZIP code.</li>
 * <li>country (NSString): Country.</li>
 * <li>latitude (NSNumber): Latitude.</li>
 * <li>longitude (NSNumber): Longitude.</li>
 * <li>website (NSString): Website URL.</li>
 * <li>twitter (NSString): Twitter ID.</li>
 * <li>phone_number (NSString): Phone number.</li>
 * <li>photo (APSPhotos): New photo to attach as the primary photo for this place.</li>
 * <li>photo_id (NSString): ID of an existing photo to attach as the primary photo for this place.</li>
 * <li>tags (NSString): Comma separated list of tags for this place.</li>
 * <li>custom_fields (NSString/NSDictionary): User defined fields.</li>
 * <li>acl_name (NSString): Name of an ACLs to associate with this place object.</li>
 * <li>acl_id (NSString): ID of an ACLs to associate with this place object.</li>
 * <li>user_id (NSString): User ID to create this place 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>places (APSPlaces[]): Single-element array containing the newly-created place.</li>
 * </ul>
 */

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


/**
 * Creates a new place 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/Places-method-create).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>name (NSString): Place name. (required)</li>
 * <li>address (NSString): Address.</li>
 * <li>city (NSString): City.</li>
 * <li>state (NSString): State.</li>
 * <li>postal_code (NSString): Postal or ZIP code.</li>
 * <li>country (NSString): Country.</li>
 * <li>latitude (NSNumber): Latitude.</li>
 * <li>longitude (NSNumber): Longitude.</li>
 * <li>website (NSString): Website URL.</li>
 * <li>twitter (NSString): Twitter ID.</li>
 * <li>phone_number (NSString): Phone number.</li>
 * <li>photo (APSPhotos): New photo to attach as the primary photo for this place.</li>
 * <li>photo_id (NSString): ID of an existing photo to attach as the primary photo for this place.</li>
 * <li>tags (NSString): Comma separated list of tags for this place.</li>
 * <li>custom_fields (NSString/NSDictionary): User defined fields.</li>
 * <li>acl_name (NSString): Name of an ACLs to associate with this place object.</li>
 * <li>acl_id (NSString): ID of an ACLs to associate with this place object.</li>
 * <li>user_id (NSString): User ID to create this place 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>places (APSPlaces[]): Single-element array containing the newly-created place.</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;




/**
 * Returns the list of places that have been added to the app, sorted by search relevancy. 
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/Places-method-search).
 * @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>response_json_depth (NSNumber): Nested object depth level counts in the response JSON.</li>
 * <li>latitude (NSNumber): Latitude to center search on.</li>
 * <li>longitude (NSNumber): Longitude to center search on.</li>
 * <li>distance (NSNumber): Distance in km to search from the identified center point.</li>
 * <li>q (NSString): Space-separated list of keywords used to perform full text search on place name and tags.</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>places (APSPlaces[]): List of places matching the search criteria.</li>
 * </ul>
 */

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




/**
 * Returns information for the identified place. 
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/Places-method-show).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>place_id (NSString): ID of the place to show. (required)</li>
 * <li>response_json_depth (NSNumber): Nested object depth level counts in the response JSON.</li>
 * <li>show_user_like (NSBoolean): If set to true the Place object 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>places (APSPlaces[]): Single-element array containing the identified place object.</li>
 * </ul>
 */

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




/**
 * Any of the parameters used to Create a Place can be used to update it as well. 
 *
 * 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/Places-method-update).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>place_id (NSString): ID of the place to delete. (required)</li>
 * <li>name (NSString): Place name. (required)</li>
 * <li>address (NSString): Address.</li>
 * <li>city (NSString): City.</li>
 * <li>state (NSString): State.</li>
 * <li>postal_code (NSString): Postal or ZIP code.</li>
 * <li>country (NSString): Country.</li>
 * <li>latitude (NSNumber): Latitude.</li>
 * <li>longitude (NSNumber): Longitude.</li>
 * <li>website (NSString): Website URL.</li>
 * <li>twitter (NSString): Twitter ID.</li>
 * <li>phone_number (NSString): Phone number.</li>
 * <li>photo (APSPhotos): New photo to attach as the primary photo for this place.</li>
 * <li>photo_id (NSString): ID of an existing photo to attach as the primary photo for this place.</li>
 * <li>tags (NSString): Comma separated list of tags for this place.</li>
 * <li>custom_fields (NSString/NSDictionary): User defined fields.</li>
 * <li>acl_name (NSString): Name of an ACLs to associate with this place object.</li>
 * <li>acl_id (NSString): ID of an ACLs to associate with this place object.</li>
 * <li>user_id (NSString): User ID to update the Place 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>places (APSPlaces[]): Single-element array containing the updated object.</li>
 * </ul>
 */

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


/**
 * Any of the parameters used to Create a Place can be used to update it as well. 
 *
 * 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/Places-method-update).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>place_id (NSString): ID of the place to delete. (required)</li>
 * <li>name (NSString): Place name. (required)</li>
 * <li>address (NSString): Address.</li>
 * <li>city (NSString): City.</li>
 * <li>state (NSString): State.</li>
 * <li>postal_code (NSString): Postal or ZIP code.</li>
 * <li>country (NSString): Country.</li>
 * <li>latitude (NSNumber): Latitude.</li>
 * <li>longitude (NSNumber): Longitude.</li>
 * <li>website (NSString): Website URL.</li>
 * <li>twitter (NSString): Twitter ID.</li>
 * <li>phone_number (NSString): Phone number.</li>
 * <li>photo (APSPhotos): New photo to attach as the primary photo for this place.</li>
 * <li>photo_id (NSString): ID of an existing photo to attach as the primary photo for this place.</li>
 * <li>tags (NSString): Comma separated list of tags for this place.</li>
 * <li>custom_fields (NSString/NSDictionary): User defined fields.</li>
 * <li>acl_name (NSString): Name of an ACLs to associate with this place object.</li>
 * <li>acl_id (NSString): ID of an ACLs to associate with this place object.</li>
 * <li>user_id (NSString): User ID to update the Place 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>places (APSPlaces[]): Single-element array containing the updated object.</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;




/**
 * Deletes a place. 
 *
 * 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/Places-method-delete).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>place_id (NSString): ID of the place to delete. (required)</li>
 * <li>user_id (NSString): User ID to delete the Place 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;




/**
 * Performs custom query of places with sorting and paginating. 
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/Places-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>skip (NSNumber): Number of records to skip.</li>
 * <li>where (NSDictionary): Constraint values for fields.</li>
 * <li>order (NSString): Sort results by one or more fields.</li>
 * <li>sel (NSDictionary): Selects the object fields to display.</li>
 * <li>show_user_like (NSBoolean): If set to true, each Place object in the response includes "current_user_liked: true"  if the current user has liked the object.</li>
 * <li>unsel (NSDictionary): Selects the object fields NOT to display.</li>
 * <li>response_json_depth (NSNumber): Nested object depth level counts in the 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>places (APSPlaces[]): List of places matching the query criteria.</li>
 * </ul>
 */

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



@end
