Property | Type | Description | |
---|---|---|---|
$_api_client | The class to use as the API client. | ||
$_api_key | The DataSift API Key. | ||
$_api_url | The api url of the user. | ||
$_api_version | |||
$_debug | Boolean to represent whether this class is being used in debug mode or not | ||
$_ingest_url | The ingestion url of the user. | ||
$_last_response | The full response of the last API call, only set in debug mode. | ||
$_rate_limit | Stores the X-RateLimit-Limit value from the last API call. | ||
$_rate_limit_remaining | Stores the X-RateLimit-Remaining value from the last API call. | ||
$_stream_url | The apu url of the user. | ||
$_use_ssl | Set to true to enable SSL. | ||
$_username | The DataSift username. |
Method | Description | |
---|---|---|
__construct ( string $username, string $api_key, boolean $use_ssl = true, $debug_mode = false, $api_url = false, $api_version = false, $stream_url = false, $ingest_url = false ) | Constructor. A username and API key are required when constructing an instance of this class. | |
createDefinition ( string $definition = '' ) : DataSift_Definition | Creates and returns an empty Definition object. | |
createHistoric ( string $hash, integer $start, integer $end, array $sources, string $name, float $sample = DataSift_Historic::DEFAULT_SAMPLE ) : DataSift_Historic | Create a historic query based on a stream hash. | |
createPushDefinition ( ) : DataSift_Push_Definition | Creates and returns a new Push_Definition object. | |
delete ( string $endpoint, array $params = [], $headers = [] ) : array | Make a Delete call to a DataSift API endpoint. | |
enableSSL ( boolean $use_ssl = true ) : void | Set whether stream connections should use SSL. | |
get ( string $endpoint, array $params = [], $headers = [] ) : array | Make a GET call to a DataSift API endpoint. | |
getAPIKey ( ) : string | Returns the API key. | |
getApiUrl ( ) : string | Returns API URL. | |
getApiVersion ( ) : string | getApiVersion | |
getConsumer ( string $type = DataSift_StreamConsumer::TYPE_HTTP, string $hash, DataSift_IStreamConsumerEventHandler $eventHandler ) : DataSift_StreamConsumer | Returns a DataSift_StreamConsumer-derived object for the given hash, for the given type. | |
getDebug ( ) : boolean | getDebug | |
getHistoric ( string $playback_id ) : DataSift_Historic | Get an existing historic from the API. | |
getIngestUrl ( ) : string | Returns stream URL. | |
getLastResponse ( ) : array | getLastResponse | |
getMultiConsumer ( string $type = DataSift_StreamConsumer::TYPE_HTTP, string $hashes, DataSift_IStreamConsumerEventHandler $eventHandler ) : DataSift_StreamConsumer | Returns a DataSift_StreamConsumer-derived object for the given hashes, for the given type. | |
getPushSubscription ( string $id ) : DataSift_Push_Subscription | Get a single push subscription. | |
getPushSubscriptionLogs ( $page = 1, $per_page = 100, $order_by = DataSift_Push_Subscription::ORDERBY_REQUEST_TIME, $order_dir = DataSift_Push_Subscription::ORDERDIR_DESC ) : ArrayList |
Page through recent push subscription log entries, specifying the sort order. | |
getRateLimit ( ) : integer | Returns the rate limit returned by the last API call. | |
getRateLimitRemaining ( ) : integer | Returns the rate limit remaining returned by the last API call. | |
getStreamUrl ( ) : string | Returns stream URL. | |
getUsage ( string $period = 'hour' ) : array | Returns the usage data for this user. | |
getUserAgent ( ) : string | Returns the user agent this library should use for all API calls. | |
getUsername ( ) : string | Returns the username. | |
listHistorics ( integer $page = 1, integer $per_page = 20 ) : array | Get a list of Historics queries in your account. | |
listPushSubscriptions ( integer $page = 1, integer $per_page = 100, $order_by = DataSift_Push_Subscription::ORDERBY_CREATED_AT, $order_dir = DataSift_Push_Subscription::ORDERDIR_ASC, boolean $include_finished = false ) : array | Get a list of push subscriptions in your account. | |
post ( string $endpoint, array $params = [], $headers = [], $ingest = false ) : array | Make a call to a DataSift API endpoint. | |
put ( string $endpoint, array $params = [], $headers = [] ) : array | Make a PUT call to a DataSift API endpoint. | |
setApiClient ( string $api_client ) : void | Set the class to use when calling the API | |
setApiVersion ( string $version ) : string | setApiVersion | |
setLastResponse ( array $last_response ) | setLastResponse | |
useSSL ( ) : boolean | Returns whether SSL should be used where supported. |
Method | Description | |
---|---|---|
handleResponse ( $res ) |
public __construct ( string $username, string $api_key, boolean $use_ssl = true, $debug_mode = false, $api_url = false, $api_version = false, $stream_url = false, $ingest_url = false ) | ||
$username | string | The user's username. |
$api_key | string | The user's API key. |
$use_ssl | boolean | Set to true to enable SSL. |
public createDefinition ( string $definition = '' ) : DataSift_Definition | ||
$definition | string | Optional definition with which to prime the object. |
return | DataSift_Definition | A definition object tied to this user. |
public createHistoric ( string $hash, integer $start, integer $end, array $sources, string $name, float $sample = DataSift_Historic::DEFAULT_SAMPLE ) : DataSift_Historic | ||
$hash | string | The stream hash. |
$start | integer | The timestamp from which to start the query. |
$end | integer | The timestamp at which to end the query. |
$sources | array | An array of sources required. |
$name | string | A friendly name for this query. |
$sample | float | An optional sample rate for this query. |
return | DataSift_Historic |
public createPushDefinition ( ) : DataSift_Push_Definition | ||
return | DataSift_Push_Definition |
public getConsumer ( string $type = DataSift_StreamConsumer::TYPE_HTTP, string $hash, DataSift_IStreamConsumerEventHandler $eventHandler ) : DataSift_StreamConsumer | ||
$type | string | The consumer type for which to construct a consumer. |
$hash | string | The hash to be consumed. |
$eventHandler | DataSift_IStreamConsumerEventHandler | The object that will receive events. |
return | DataSift_StreamConsumer | The consumer object. |
public getHistoric ( string $playback_id ) : DataSift_Historic | ||
$playback_id | string | The historic playback ID. |
return | DataSift_Historic |
public getMultiConsumer ( string $type = DataSift_StreamConsumer::TYPE_HTTP, string $hashes, DataSift_IStreamConsumerEventHandler $eventHandler ) : DataSift_StreamConsumer | ||
$type | string | The consumer type for which to construct a consumer. |
$hashes | string | An array containing hashes and/or Definition objects to be consumed. |
$eventHandler | DataSift_IStreamConsumerEventHandler | The object that will receive events. |
return | DataSift_StreamConsumer | The consumer object. |
public getPushSubscription ( string $id ) : DataSift_Push_Subscription | ||
$id | string | The ID of the subscription to fetch. |
return | DataSift_Push_Subscription |
public getPushSubscriptionLogs ( $page = 1, $per_page = 100, $order_by = DataSift_Push_Subscription::ORDERBY_REQUEST_TIME, $order_dir = DataSift_Push_Subscription::ORDERDIR_DESC ) : ArrayList |
||
return | ArrayList |
public getRateLimit ( ) : integer | ||
return | integer | The rate limit. |
public getRateLimitRemaining ( ) : integer | ||
return | integer | The rate limit remaining. |
public getUserAgent ( ) : string | ||
return | string |
public getUsername ( ) : string | ||
return | string | The username. |
public listPushSubscriptions ( integer $page = 1, integer $per_page = 100, $order_by = DataSift_Push_Subscription::ORDERBY_CREATED_AT, $order_dir = DataSift_Push_Subscription::ORDERDIR_ASC, boolean $include_finished = false ) : array | ||
$page | integer | The page number to get. |
$per_page | integer | The number of items per page. |
$include_finished | boolean | Set to true when you want to include finished subscription in the results. |
return | array | Of DataSift_Push_Subscription objects. |
public setApiClient ( string $api_client ) : void | ||
$api_client | string | The class to use. |
return | void |
public setApiVersion ( string $version ) : string | ||
$version | string | |
return | string |
public setLastResponse ( array $last_response ) | ||
$last_response | array |
protected $_debug |
protected $_last_response |
protected $_rate_limit |
protected $_rate_limit_remaining |