//
//  LRRestyClient+PATCH.h
//  Assist Software
//
//  Created by Ovidiu on 6/19/13.
//

#import "LRRestyClient.h"

@class LRRestyRequest;

@interface LRRestyClient (PATCH)

/// ---------------------------------
/// @name Making PATCH requests
/// ---------------------------------

#pragma mark -
#pragma mark Delegate API

/**
 Performs a PATCH request with a payload on URL with delegate response handling.
 @param urlString   The URL to request.
 @param payload     The object to PATCH.
 @param delegate    The response delegate.
 @returns The request object.
 @see LRRestyRequestPayload
 */
- (LRRestyRequest *)patch:(NSString *)urlString payload:(id)payload delegate:(id<LRRestyClientResponseDelegate>)delegate;

/**
 Performs a PATCH request with a payload on URL with delegate response handling.
 @param urlString   The URL to request.
 @param delegate    The response delegate.
 @returns The request object.
 @see LRRestyRequestPayload
 */
- (LRRestyRequest *)patch:(NSString *)urlString payload:(id)payload headers:(NSDictionary *)headers delegate:(id<LRRestyClientResponseDelegate>)delegate;

#pragma mark -
#pragma mark Blocks API

/**
 Performs a PATCH request with a payload on URL with block response handling.
 @param urlString   The URL to request.
 @param payload     The object to PATCH.
 @param block       The response block.
 @returns The request object.
 @see LRRestyRequestPayload
 */
- (LRRestyRequest *)patch:(NSString *)urlString payload:(id)payload withBlock:(LRRestyResponseBlock)block;

/**
 Performs a PATCH request with a payload on URL with block response handling.
 @param urlString   The URL to request.
 @param block       The response block.
 @returns The request object.
 @see LRRestyRequestPayload
 */
- (LRRestyRequest *)patch:(NSString *)urlString payload:(id)payload headers:(NSDictionary *)headers withBlock:(LRRestyResponseBlock)block;

#pragma mark -
#pragma mark Synchronous API

/**
 Performs a *synchronous* PATCH request with a payload on URL, blocking the calling thread.
 @param urlString   The URL to request.
 @param payload     The object to PATCH.
 @returns The response object.
 @see LRRestyRequestPayload
 */
- (LRRestyResponse *)patch:(NSString *)urlString payload:(id)payload;

/**
 Performs a *synchronous* PATCH request with a payload on URL, blocking the calling thread.
 @param urlString   The URL to request.
 @param block       The response block.
 @returns The response object.
 @see LRRestyRequestPayload
 */
- (LRRestyResponse *)patch:(NSString *)urlString payload:(id)payload headers:(NSDictionary *)headers;

@end
