You are here

public function AcquiaLiftAPI::getTransformOptions in Acquia Lift Connector 7

Retrieves the list of available source data options from Acquia Lift.

Return value

mixed

Throws

AcquiaLiftException

File

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

Class

AcquiaLiftAPI
@file Provides an agent type for Acquia Lift

Code

public function getTransformOptions() {
  $url = $this
    ->generateEndpoint("/transforms-options");

  // Use a timeout of 8 seconds for retrieving the transform options.
  $response = $this
    ->httpClient()
    ->get($url, array(
    'Accept' => 'application/json',
  ));
  if ($response->code == 200) {
    $response = json_decode($response->data, TRUE);
    return $response['data']['options'];
  }
  else {
    $this
      ->handleBadResponse($response->code, 'Error retrieving list of transforms options');
  }
  return FALSE;
}