You are here

public function AcquiaLiftAPI::resetAgentData in Acquia Lift Connector 7

Resets the data for an agent.

Parameters

$agent_name:

File

includes/acquia_lift.classes.inc, line 606
Provides an agent type for Acquia Lift

Class

AcquiaLiftAPI
@file Provides an agent type for Acquia Lift

Code

public function resetAgentData($agent_name) {
  $url = $this
    ->generateEndpoint("/{$agent_name}/data");
  $response = $this
    ->httpClient()
    ->delete($url);
  $vars = array(
    'agent' => $agent_name,
  );
  $success_msg = 'The data for Acquia Lift campaign {agent} was reset';
  $fail_msg = 'Could not reset data for Acquia Lift campaign {agent}';
  if ($response->code == 200) {
    $this
      ->logger()
      ->log(PersonalizeLogLevel::INFO, $success_msg, $vars);
  }
  else {
    $this
      ->handleBadResponse($response->code, $fail_msg, $vars);
  }
}