public static function create($params = null, $apiKey = null)
    {
        if (!isset($params['report']) || !is_array($params['report'])) {
            $clone = $params;
            unset($params);
            $params['report'] = $clone;
        }

        if (!isset($params['report']['type'])) {
            throw new Error('Undetermined Report Type');
        } else {
            $type = $params['report']['type'];

            self::_validate('create', $params, $apiKey);
            $requestor = new Requestor($apiKey);

            $url = self::reportUrl($type);

            list($response, $apiKey) = $requestor->request('post', $url, $params, true);
            return Util::convertToEasyPostObject($response, $apiKey);
        }
    }
public static function create($params = null, $apiKey = null)
    {
        if (!isset($params['report']) || !is_array($params['report'])) {
            $clone = $params;
            unset($params);
            $params['report'] = $clone;
        }

        if (!isset($params['report']['type'])) {
            throw new Error('Undetermined Report Type');
        } else {
            $type = $params['report']['type'];

            self::_validate('create', $params, $apiKey);
            $requestor = new Requestor($apiKey);

            $url = self::reportUrl($type);

            list($response, $apiKey) = $requestor->request('post', $url, $params, true);
            return Util::convertToEasyPostObject($response, $apiKey);
        }
    }
public static function create ( $ params = null , $ apiKey = null ) { if ( ! isset ( $ params [ 'report' ] ) || ! is_array ( $ params [ 'report' ] ) ) { $ clone = $ params ; unset ( $ params ) ; $ params [ 'report' ] = $ clone ; } if ( ! isset ( $ params [ 'report' ] [ 'type' ] ) ) { throw new Error ( 'Undetermined Report Type' ) ; } else { $ type = $ params [ 'report' ] [ 'type' ] ; self :: _validate ( 'create' , $ params , $ apiKey ) ; $ requestor = new Requestor ( $ apiKey ) ; $ url = self :: reportUrl ( $ type ) ; list ( $ response , $ apiKey ) = $ requestor -> request ( 'post' , $ url , $ params , true ) ; return Util :: convertToEasyPostObject ( $ response , $ apiKey ) ; } }
create a report

@param mixed  $params
@param string $apiKey
@return mixed
create a report