/** * @param array $fields * @param array $params * @return Cursor */ public function getAdPreviews(array $fields = array(), array $params = array()) { return $this->getManyByConnection(AdPreview::className(), $fields, $params, 'previews'); }
public function getGeneratePreviews(array $fields = array(), array $params = array(), $pending = false) { $this->assureId(); $param_types = array('ad_format' => 'ad_format_enum', 'creative' => 'AdCreative', 'dynamic_creative_spec' => 'Object', 'height' => 'unsigned int', 'interactive' => 'bool', 'locale' => 'string', 'post' => 'Object', 'product_item_ids' => 'list<string>', 'width' => 'unsigned int'); $enums = array('ad_format_enum' => AdPreviewAdFormatValues::getInstance()->getValues()); $request = new ApiRequest($this->api, $this->data['id'], RequestInterface::METHOD_GET, '/generatepreviews', new AdPreview(), 'EDGE', AdPreview::getFieldsEnum()->getValues(), new TypeChecker($param_types, $enums)); $request->addParams($params); $request->addFields($fields); return $pending ? $request : $request->execute(); }