Accela SDK for iOS  V3.2
 All Classes Functions Properties Pages
AMRequest Class Reference
Inheritance diagram for AMRequest:

Instance Methods

(id) - initWithPath:urlParams:httpMethod:
 
(BOOL) - isLoading
 
(void) - cancelRequest
 
(id) - fetchWithData:error:
 
(AMRequest *) - sendRequestWithData:requestDelegate:
 
(AMRequest *) - sendRequestWithData:attachments:requestDelegate:
 
(AMRequest *) - uploadAttachment:requestDelegate:
 
(AMRequest *) - downloadAttachment:requestDelegate:
 
(AMRequest *) - downloadAttachment:localFile:requestDelegate:
 
(void) - setProgressLabelText:
 
(void) - waitUntilFinished
 

Properties

id< AMRequestDelegateamRequestDelegate
 
NSString * amServiceURL
 
NSDictionary * amParams
 
HTTP_METHOD amHttpMethod
 
long amTimeOutSeconds
 
AMErrorBlock amErrorBlock
 
AMDataBlock amCompletionBlock
 
NSString * amDownloadDestinationPath
 
NSString * amUploadDestinationPath
 
UIView * amOwnerView
 
NSDictionary * userProfile
 
NSInteger tag
 

Method Documentation

- (void) cancelRequest

Cancels the current request.

Since
1.0
- (AMRequest*) downloadAttachment: (NSString *)  postData
localFile: (NSString *)  localFile
requestDelegate: (id< AMRequestDelegate >)  requestDelegate 

Downloads a binary file represented by an AMAttachmentModel object as an asynchronous operation.

Parameters
postDatapost data for the request
localFileThe path for file
requestDelegateA delegate object to inform of the results.
See Also
AMRequestDelegate for information on the delegate protocol.
Returns
The AMRequest object corresponding to this API call.
Since
3.1
- (AMRequest *) downloadAttachment: (NSString *)  localFile
requestDelegate: (id< AMRequestDelegate >)  requestDelegate 

Downloads a binary file represented by an AMAttachmentModel object as an asynchronous operation.

Parameters
localFileThe path for file
requestDelegateA delegate object to inform of the results.
See Also
AMRequestDelegate for information on the delegate protocol.
Returns
The AMRequest object corresponding to this API call.
Since
1.0
- (id) fetchWithData: (NSData *)  data
error: (AMErrorBlock)  errorBlock 

Synchronously send a request identified by the Accela Civic Cloud API endpoint with the given data using an HTTP POST method.

Parameters
dataThe content sent with the coresponding request.
errorBlockAn AMErrorBlock object that will be called when there is an error during the method call.
Returns
The resulting object is a JSON object, may be a dictionary or an array, if succeed; otherwise, nil.
Since
1.0
- (id) initWithPath: (NSString *)  servicePath
urlParams: (NSDictionary *)  params
httpMethod: (HTTP_METHOD)  httpMethod 

init AMRequest instance

Parameters
servicePathThe path to the Accela Civic Cloud API endpoint.
paramsThe collection of parameters associated with the specific URL.
httpMethodThe HTTP data transfer method (such as GET, POST, or DELETE). It is an HTTP GET method by default.
Returns
The AMRequest object corresponding to this API call.
Since
1.0
- (BOOL) isLoading

Indicates whether the request is in-progress.

Returns
YES when this request is in-progress; otherwise, NO.
Since
1.0
- (AMRequest *) sendRequestWithData: (NSString *)  data
attachments: (NSDictionary *)  attachments
requestDelegate: (id< AMRequestDelegate >)  requestDelegate 

Makes a HTTP Form request to the Accela Civic Cloud API endpoint with the given data using an HTTP POST method as an asynchronous operation.

Parameters
dataThe content sent with the coresponding request.
requestDelegateA delegate object to inform of the results.
attachmentsto be upload in the request
See Also
AMRequestDelegate for information on the delegate protocol.
Returns
The AMRequest object corresponding to this API call.
Since
2.1.1
- (AMRequest *) sendRequestWithData: (NSData *)  data
requestDelegate: (id< AMRequestDelegate >)  requestDelegate 

Makes a request to the Accela Civic Cloud API endpoint with the given data using an HTTP POST method as an asynchronous operation.

Parameters
dataThe content sent with the coresponding request.
requestDelegateA delegate object to inform of the results.
See Also
AMRequestDelegate for information on the delegate protocol.
Returns
The AMRequest object corresponding to this API call.
Since
1.0
- (void) setProgressLabelText: (NSString *)  labelText

An optional short message to be displayed below the activity indicator. The progress is automatically resized to fit the entire text. If the text is too long it will get clipped by displaying "..." at the end. If left unchanged or set to "", then no message is displayed.

Parameters
labelTexttext message
Since
1.0
- (AMRequest *) uploadAttachment: (NSDictionary *)  fileInformation
requestDelegate: (id< AMRequestDelegate >)  requestDelegate 

Uploads a binary file represented by an AMAttachmentModel object as an asynchronous operation.

Parameters
fileInformationA dictionary instance specifies the name of the file as well as the path of it. Note that the key value of the file name should be "fileName" and the key value of the file path should be "localPath".
requestDelegateA delegate object to inform of the results.
See Also
AMRequestDelegate for information on the delegate protocol.
Returns
The AMRequest object corresponding to this API call.
Since
1.0
- (void) waitUntilFinished

TODO:

Since
2.0

Property Documentation

- (AMDataBlock) amCompletionBlock
readwritenonatomiccopy

Gets or sets the AMDataBlock object that will be called when the request has completed.

Since
1.0
- (NSString*) amDownloadDestinationPath
readwritenonatomicretain

Gets or sets the path in which the downloading binary file will reside.

Since
1.0
- (AMErrorBlock) amErrorBlock
readwritenonatomiccopy

Gets or sets the AMErrorBlock object that will be called when there is an error during the method call.

Since
1.0
- (HTTP_METHOD) amHttpMethod
readwritenonatomicassign

Gets or sets the HTTP data transfer method (such as GET, POST, or DELETE) used by this request.

Since
1.0
- (UIView*) amOwnerView
readwritenonatomicassign

Gets or sets the view object in which the login dialog will be shown.

Since
1.0
- (NSDictionary*) amParams
readwritenonatomicretain

Gets or sets the collection of parameters associated with the specific URL.

Since
1.0
- (id<AMRequestDelegate>) amRequestDelegate
readwritenonatomicretain

Gets or sets the delegate that will be called during the request lifecycle.

Since
1.0
- (NSString*) amServiceURL
readwritenonatomicretain

Gets or sets the Uniform Resource Location (URL) of the Internet resource used when sending requests.

Since
1.0
- (long) amTimeOutSeconds
readwritenonatomicassign

Gets or sets the number of milliseconds to wait before the request times out.

Since
1.0
- (NSString*) amUploadDestinationPath
readwritenonatomicretain

Gets or sets the path in which the binary file which will be uploaded reside.

Since
1.0
- (NSInteger) tag
readwritenonatomicassign

Gets or sets an integer that you can use to identity request objects.

Since
1.0
- (NSDictionary*) userProfile
readwritenonatomicassign

Gets the profile of the currently logged in user.

Since
1.0

The documentation for this class was generated from the following file: