Packagecom.distriqt.extension.facebook.graphapi.builders
Classpublic class GraphRequestBuilder
InheritanceGraphRequestBuilder Inheritance Object

This class is a helper class to construct GraphRequest instances.

View the examples



Public Methods
 MethodDefined By
  
Constructor
GraphRequestBuilder
  
Add a field to be requested with the graph request
GraphRequestBuilder
  
Add an array of fields to the request.
GraphRequestBuilder
  
addParameter(name:String, value:Object):GraphRequestBuilder
Add a parameter to the request
GraphRequestBuilder
  
Builds the request object
GraphRequestBuilder
  
[static]
GraphRequestBuilder
  
[static]
GraphRequestBuilder
  
[static]
GraphRequestBuilder
  
[static]
GraphRequestBuilder
  
postImageToDefaultAlbumRequest(image:BitmapData, message:String):GraphRequest
[static]
GraphRequestBuilder
  
postLinkToWallRequest(linkUrl:String, caption:String, message:String, description:String):GraphRequest
[static]
GraphRequestBuilder
  
[static]
GraphRequestBuilder
  
Sets the callback function for successful completion of this request.
GraphRequestBuilder
  
Sets the callback for an error on this request
GraphRequestBuilder
  
setImage(image:BitmapData):GraphRequestBuilder
Add custom image data to be sent with a graph request.
GraphRequestBuilder
  
Sets the HTTP method to use for this request
GraphRequestBuilder
  
The graph API endpoint for the request
GraphRequestBuilder
Public Constants
 ConstantDefined By
  METHOD_DELETE : String = DELETE
[static]
GraphRequestBuilder
  METHOD_GET : String = GET
[static]
GraphRequestBuilder
  METHOD_POST : String = POST
[static]
GraphRequestBuilder
Constructor Detail
GraphRequestBuilder()Constructor
public function GraphRequestBuilder()

Constructor

Method Detail
addField()method
public function addField(field:String):GraphRequestBuilder

Add a field to be requested with the graph request

Parameters

field:String — String name of the field to be added to the request

Returns
GraphRequestBuilderGraphRequestBuilder instance for chaining calls
addFields()method 
public function addFields(fields:Array):GraphRequestBuilder

Add an array of fields to the request. This must be an array of String values each representing a different field to add to the request.

Parameters

fields:Array — Must be an Array of String fields

Returns
GraphRequestBuilderGraphRequestBuilder instance for chaining calls

Example
         new GraphRequestBuilder()
                 .setPath( "/me" )
                 .addFields( [ "email", "name" ] )
                 .build();
         
addParameter()method 
public function addParameter(name:String, value:Object):GraphRequestBuilder

Add a parameter to the request

Parameters

name:String — String name of the parameter
 
value:Object — The value of the parameter

Returns
GraphRequestBuilderGraphRequestBuilder instance for chaining calls
build()method 
public function build():GraphRequest

Builds the request object

Returns
GraphRequest — A valid GraphRequest instance for making a Graph API request
getCurrentPermissionsRequest()method 
public static function getCurrentPermissionsRequest():GraphRequest

Returns
GraphRequest
getCurrentUserInfoRequest()method 
public static function getCurrentUserInfoRequest():GraphRequest

Returns
GraphRequest
getUserFriendsRequest()method 
public static function getUserFriendsRequest():GraphRequest

Returns
GraphRequest
getUserFriendsWithInstalledRequest()method 
public static function getUserFriendsWithInstalledRequest():GraphRequest

Returns
GraphRequest
postImageToDefaultAlbumRequest()method 
public static function postImageToDefaultAlbumRequest(image:BitmapData, message:String):GraphRequest

Parameters

image:BitmapData
 
message:String

Returns
GraphRequest
postLinkToWallRequest()method 
public static function postLinkToWallRequest(linkUrl:String, caption:String, message:String, description:String):GraphRequest

Parameters

linkUrl:String
 
caption:String
 
message:String
 
description:String

Returns
GraphRequest
postStatusUpdateRequest()method 
public static function postStatusUpdateRequest(message:String):GraphRequest

Parameters

message:String

Returns
GraphRequest
setCompleteCallback()method 
public function setCompleteCallback(callback:Function):GraphRequestBuilder

Sets the callback function for successful completion of this request.

Parameters

callback:Function — A function that takes an Object parameter. This will be the same as the GraphRequestEvent.COMPLETE event data property.

Returns
GraphRequestBuilderGraphRequestBuilder instance for chaining calls
setErrorCallback()method 
public function setErrorCallback(callback:Function):GraphRequestBuilder

Sets the callback for an error on this request

Parameters

callback:Function — A function that takes a int and String parameters representing the error code and message.

Returns
GraphRequestBuilderGraphRequestBuilder instance for chaining calls
setImage()method 
public function setImage(image:BitmapData):GraphRequestBuilder

Add custom image data to be sent with a graph request. Most commonly used for uploading photos, etc.

Parameters

image:BitmapDataBitmapData representation of the image to be attached

Returns
GraphRequestBuilderGraphRequestBuilder instance for chaining calls
setMethod()method 
public function setMethod(method:String):GraphRequestBuilder

Sets the HTTP method to use for this request

Parameters

method:String — The HTTP method, may be "GET", "DELETE" or "POST"

Returns
GraphRequestBuilderGraphRequestBuilder instance for chaining calls
setPath()method 
public function setPath(apiPath:String):GraphRequestBuilder

The graph API endpoint for the request

Parameters

apiPath:String — The graph API endpoint for the request

Returns
GraphRequestBuilderGraphRequestBuilder instance for chaining calls
Constant Detail
METHOD_DELETEConstant
public static const METHOD_DELETE:String = DELETE

METHOD_GETConstant 
public static const METHOD_GET:String = GET

METHOD_POSTConstant 
public static const METHOD_POST:String = POST

Examples
     var request:GraphRequest = new GraphRequestBuilder()
         .setPath( "/me" )
         .addField( "email" )
         .addField( "name" )
         .build();