Google_UrlServiceResource

The "url" collection of methods.

Defined (1)

The class is defined in the following location(s).

/inc/google-api-php-client/src/contrib/Google_UrlshortenerService.php  
  1. class Google_UrlServiceResource extends Google_ServiceResource { 
  2.  
  3.  
  4. /** 
  5. * Creates a new short URL. (url.insert) 
  6. * @param Google_Url $postBody 
  7. * @param array $optParams Optional parameters. 
  8. * @return Google_Url 
  9. */ 
  10. public function insert(Google_Url $postBody, $optParams = array()) { 
  11. $params = array('postBody' => $postBody); 
  12. $params = array_merge($params, $optParams); 
  13. $data = $this->__call('insert', array($params)); 
  14. if ($this->useObjects()) { 
  15. return new Google_Url($data); 
  16. } else { 
  17. return $data; 
  18. /** 
  19. * Retrieves a list of URLs shortened by a user. (url.list) 
  20. * @param array $optParams Optional parameters. 
  21. * @opt_param string start-token Token for requesting successive pages of results. 
  22. * @opt_param string projection Additional information to return. 
  23. * @return Google_UrlHistory 
  24. */ 
  25. public function listUrl($optParams = array()) { 
  26. $params = array(); 
  27. $params = array_merge($params, $optParams); 
  28. $data = $this->__call('list', array($params)); 
  29. if ($this->useObjects()) { 
  30. return new Google_UrlHistory($data); 
  31. } else { 
  32. return $data; 
  33. /** 
  34. * Expands a short URL or gets creation time and analytics. (url.get) 
  35. * @param string $shortUrl The short URL, including the protocol. 
  36. * @param array $optParams Optional parameters. 
  37. * @opt_param string projection Additional information to return. 
  38. * @return Google_Url 
  39. */ 
  40. public function get($shortUrl, $optParams = array()) { 
  41. $params = array('shortUrl' => $shortUrl); 
  42. $params = array_merge($params, $optParams); 
  43. $data = $this->__call('get', array($params)); 
  44. if ($this->useObjects()) { 
  45. return new Google_Url($data); 
  46. } else { 
  47. return $data;