/**
 * 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 ACL object implements access control lists for APS objects.
 * The REST object of this class contains the following fields:<ul>
 * <li>created_at (NSString): ACL creation date.</li>
 * <li>id (NSString): ID of the ACL object, automatically generated by APS.</li>
 * <li>name (NSString): Name of the ACL object.</li>
 * <li>public_read (NSBoolean): Determines whether objects controlled by this ACS are publicly readable. </li>
 * <li>public_write (NSBoolean): Determines whether objects controlled by this ACS are publicly writable. </li>
 * <li>readers (NSString[]): List of IDs identifying users who can read objects controlled by this ACL.</li>
 * <li>updated_at (NSString): ACL update date.</li>
 * <li>user (APSUsers): Owner of the ACL.</li>
 * <li>writers (NSString[]): List of IDs identifying users who can update objects controlled by this ACL.</li>
 * </ul>
 * For more details about the underlying REST object, see the [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/ACLs).
 */

@interface APSACLs : NSObject




/**
 * Creates an ACL object, which can be used to control access to ACS objects. 
 *
 * 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/ACLs-method-create).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>name (NSString): Name of the ACL object. (required)</li>
 * <li>reader_ids (NSString): Comma separated list of IDs identifying users who can read objects controlled by this ACL.</li>
 * <li>writer_ids (NSString): Comma separated list of IDs identifying users who can update an object.</li>
 * <li>public_read (NSBoolean): Determines whether objects controlled by this APS are publically readable.</li>
 * <li>public_write (NSBoolean): Determines whether objects controlled by this APS are publically writable.</li>
 * <li>user_id (NSString): Specifies the owner of the new URL.</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>acls (APSACLs[]): Array containing the created ACL.</li>
 * </ul>
 */

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




/**
 * Updates an ACL object to change its access control list. 
 *
 * 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/ACLs-method-update).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>name (NSString): Name of the ACL object.</li>
 * <li>id (NSString): ID of the ACL oject.</li>
 * <li>reader_ids (NSString): Comma separated list of IDs identifying users who can read objects controlled by this ACL. (required)</li>
 * <li>writer_ids (NSString): Comma separated list of IDs identifying users who can update an object. (required)</li>
 * <li>public_read (NSBoolean): Determines whether objects controlled by this APS are publically readable.</li>
 * <li>public_write (NSBoolean): Determines whether objects controlled by this APS are publically writable.</li>
 * <li>user_id (NSString): User to update the ACL 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>acls (APSACLs[]): A single-element array containing the updated APS object.</li>
 * </ul>
 */

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




/**
 * Shows the ACL object with the given id or name. 
 *
 * For more details about the underlying REST method, see the
 * [ACS API Docs](http://docs.appcelerator.com/cloud/latest/#!/api/ACLs-method-show).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>name (NSString): Name of the ACL object.</li>
 * <li>id (NSString): ID of the ACL oject.</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>acls (APSACLs[]): One element array, containing the ACL object.</li>
 * </ul>
 */

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




/**
 * Deletes an ACL object with the given id or 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/ACLs-method-delete).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>name (NSString): Name of the ACL object to delete.</li>
 * <li>id (NSString): ID of the ACL oject to delete.</li>
 * <li>user_id (NSString): User to delete the ACL 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;




/**
 * Adds one or more user(s) to an existing ACL object, identified by its id or 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/ACLs-method-add).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>name (NSString): Name of the ACL object.</li>
 * <li>id (NSString): ID of the ACL oject.</li>
 * <li>reader_ids (NSString): Comma separated list of IDs identifying users who can read objects controlled by this ACL. (required)</li>
 * <li>writer_ids (NSString): Comma separated list of IDs identifying users who can update an object. (required)</li>
 * </ul>
 * @param handler Callback to handle the server response. See the Callback section in APSClient.
 */

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




/**
 * Removes one or more user(s) from an ACL object with the given id or 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/ACLs-method-remove).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>name (NSString): Name of the ACL object.</li>
 * <li>id (NSString): ID of the ACL oject.</li>
 * <li>reader_ids (NSString): Comma separated list of IDs to remove from the readers list. (required)</li>
 * <li>writer_ids (NSString): Comma separated list of IDs to remove from the writers list. (required)</li>
 * </ul>
 * @param handler Callback to handle the server response. See the Callback section in APSClient.
 */

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




/**
 * Checks the permissions a specified user is granted by a specified ACL. 
 *
 * 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/ACLs-method-check).
 * @param data Method parameters specified as an NSDictionary with the following key-value pairs:<ul> 
 * <li>name (NSString): Name of the ACL object.</li>
 * <li>id (NSString): ID of the ACL oject.</li>
 * <li>user_id (NSString): User ID of the user to check.</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>permission (NSDictionary): An object with two properties:   read_permission.</li>
 * </ul>
 */

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



@end
