DataSift_Account_Identity_Limit::update PHP Method

update() public method

Update the limit for an service
public update ( string $identity, string $service, integer $total_allowance = false, integer $analyze_queries = false ) : mixed
$identity string
$service string
$total_allowance integer
$analyze_queries integer
return mixed
    public function update($identity, $service, $total_allowance = false, $analyze_queries = false)
    {
        $params = array();
        if ($total_allowance) {
            $params['total_allowance'] = $total_allowance;
        }
        if ($analyze_queries) {
            $params['analyze_queries'] = $analyze_queries;
        }
        return $response = $this->_user->put('account/identity/' . $identity . '/limit/' . $service, $params);
    }

Usage Example

Example #1
0
 /**
  * @dataProvider updateLimitProvider
  * @covers Datasift_Account_Identity_Limit::update
  */
 public function testUpdateLimit($identityId, $service, $limit, $analyze_queries, $apiResult, $expectedResult)
 {
     $identityLimit = new DataSift_Account_Identity_Limit($this->_user);
     DataSift_MockApiClient::setResponse($apiResult);
     if (isset($expectedResult['error'])) {
         $this->setExpectedException('DataSift_Exception_APIError');
     }
     $result = $identityLimit->update($identityId, $service, $limit, $analyze_queries);
     $this->assertEquals($expectedResult, $result);
 }
All Usage Examples Of DataSift_Account_Identity_Limit::update
DataSift_Account_Identity_Limit