| 1 |
<?php |
| 2 |
/* |
| 3 |
* Copyright 2010 Google Inc. |
| 4 |
* |
| 5 |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 6 |
* use this file except in compliance with the License. You may obtain a copy of |
| 7 |
* the License at |
| 8 |
* |
| 9 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 10 |
* |
| 11 |
* Unless required by applicable law or agreed to in writing, software |
| 12 |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 |
* License for the specific language governing permissions and limitations under |
| 15 |
* the License. |
| 16 |
*/ |
| 17 |
|
| 18 |
/** |
| 19 |
* Service definition for Urlshortener (v1). |
| 20 |
* |
| 21 |
* <p> |
| 22 |
* Lets you create, inspect, and manage goo.gl short URLs |
| 23 |
* </p> |
| 24 |
* |
| 25 |
* <p> |
| 26 |
* For more information about this service, see the API |
| 27 |
* <a href="http://code.google.com/apis/urlshortener/v1/getting_started.html" target="_blank">Documentation</a> |
| 28 |
* </p> |
| 29 |
* |
| 30 |
* @author Google, Inc. |
| 31 |
*/ |
| 32 |
class Analytify_Google_Service_Urlshortener extends Analytify_Google_Service |
| 33 |
{ |
| 34 |
/** Manage your goo.gl short URLs. */ |
| 35 |
const URLSHORTENER = "https://www.googleapis.com/auth/urlshortener"; |
| 36 |
|
| 37 |
public $url; |
| 38 |
|
| 39 |
|
| 40 |
/** |
| 41 |
* Constructs the internal representation of the Urlshortener service. |
| 42 |
* |
| 43 |
* @param Analytify_Google_Client $client |
| 44 |
*/ |
| 45 |
public function __construct(Analytify_Google_Client $client) |
| 46 |
{ |
| 47 |
parent::__construct($client); |
| 48 |
$this->servicePath = 'urlshortener/v1/'; |
| 49 |
$this->version = 'v1'; |
| 50 |
$this->serviceName = 'urlshortener'; |
| 51 |
|
| 52 |
$this->url = new Analytify_Google_Service_Urlshortener_Url_Resource( |
| 53 |
$this, |
| 54 |
$this->serviceName, |
| 55 |
'url', |
| 56 |
array( |
| 57 |
'methods' => array( |
| 58 |
'get' => array( |
| 59 |
'path' => 'url', |
| 60 |
'httpMethod' => 'GET', |
| 61 |
'parameters' => array( |
| 62 |
'shortUrl' => array( |
| 63 |
'location' => 'query', |
| 64 |
'type' => 'string', |
| 65 |
'required' => true, |
| 66 |
), |
| 67 |
'projection' => array( |
| 68 |
'location' => 'query', |
| 69 |
'type' => 'string', |
| 70 |
), |
| 71 |
), |
| 72 |
),'insert' => array( |
| 73 |
'path' => 'url', |
| 74 |
'httpMethod' => 'POST', |
| 75 |
'parameters' => array(), |
| 76 |
),'list' => array( |
| 77 |
'path' => 'url/history', |
| 78 |
'httpMethod' => 'GET', |
| 79 |
'parameters' => array( |
| 80 |
'start-token' => array( |
| 81 |
'location' => 'query', |
| 82 |
'type' => 'string', |
| 83 |
), |
| 84 |
'projection' => array( |
| 85 |
'location' => 'query', |
| 86 |
'type' => 'string', |
| 87 |
), |
| 88 |
), |
| 89 |
), |
| 90 |
) |
| 91 |
) |
| 92 |
); |
| 93 |
} |
| 94 |
} |
| 95 |
|
| 96 |
|
| 97 |
/** |
| 98 |
* The "url" collection of methods. |
| 99 |
* Typical usage is: |
| 100 |
* <code> |
| 101 |
* $urlshortenerService = new Analytify_Google_Service_Urlshortener(...); |
| 102 |
* $url = $urlshortenerService->url; |
| 103 |
* </code> |
| 104 |
*/ |
| 105 |
class Analytify_Google_Service_Urlshortener_Url_Resource extends Analytify_Google_Service_Resource |
| 106 |
{ |
| 107 |
|
| 108 |
/** |
| 109 |
* Expands a short URL or gets creation time and analytics. (url.get) |
| 110 |
* |
| 111 |
* @param string $shortUrl |
| 112 |
* The short URL, including the protocol. |
| 113 |
* @param array $optParams Optional parameters. |
| 114 |
* |
| 115 |
* @opt_param string projection |
| 116 |
* Additional information to return. |
| 117 |
* @return Analytify_Google_Service_Urlshortener_Url |
| 118 |
*/ |
| 119 |
public function get($shortUrl, $optParams = array()) |
| 120 |
{ |
| 121 |
$params = array('shortUrl' => $shortUrl); |
| 122 |
$params = array_merge($params, $optParams); |
| 123 |
return $this->call('get', array($params), "Analytify_Google_Service_Urlshortener_Url"); |
| 124 |
} |
| 125 |
/** |
| 126 |
* Creates a new short URL. (url.insert) |
| 127 |
* |
| 128 |
* @param Analytify_Google_Url $postBody |
| 129 |
* @param array $optParams Optional parameters. |
| 130 |
* @return Analytify_Google_Service_Urlshortener_Url |
| 131 |
*/ |
| 132 |
public function insert(Analytify_Google_Service_Urlshortener_Url $postBody, $optParams = array()) |
| 133 |
{ |
| 134 |
$params = array('postBody' => $postBody); |
| 135 |
$params = array_merge($params, $optParams); |
| 136 |
return $this->call('insert', array($params), "Analytify_Google_Service_Urlshortener_Url"); |
| 137 |
} |
| 138 |
/** |
| 139 |
* Retrieves a list of URLs shortened by a user. (url.listUrl) |
| 140 |
* |
| 141 |
* @param array $optParams Optional parameters. |
| 142 |
* |
| 143 |
* @opt_param string start-token |
| 144 |
* Token for requesting successive pages of results. |
| 145 |
* @opt_param string projection |
| 146 |
* Additional information to return. |
| 147 |
* @return Analytify_Google_Service_Urlshortener_UrlHistory |
| 148 |
*/ |
| 149 |
public function listUrl($optParams = array()) |
| 150 |
{ |
| 151 |
$params = array(); |
| 152 |
$params = array_merge($params, $optParams); |
| 153 |
return $this->call('list', array($params), "Analytify_Google_Service_Urlshortener_UrlHistory"); |
| 154 |
} |
| 155 |
} |
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
class Analytify_Google_Service_Urlshortener_AnalyticsSnapshot extends Analytify_Google_Collection |
| 161 |
{ |
| 162 |
protected $browsersType = 'Analytify_Google_Service_Urlshortener_StringCount'; |
| 163 |
protected $browsersDataType = 'array'; |
| 164 |
protected $countriesType = 'Analytify_Google_Service_Urlshortener_StringCount'; |
| 165 |
protected $countriesDataType = 'array'; |
| 166 |
public $longUrlClicks; |
| 167 |
protected $platformsType = 'Analytify_Google_Service_Urlshortener_StringCount'; |
| 168 |
protected $platformsDataType = 'array'; |
| 169 |
protected $referrersType = 'Analytify_Google_Service_Urlshortener_StringCount'; |
| 170 |
protected $referrersDataType = 'array'; |
| 171 |
public $shortUrlClicks; |
| 172 |
|
| 173 |
public function setBrowsers($browsers) |
| 174 |
{ |
| 175 |
$this->browsers = $browsers; |
| 176 |
} |
| 177 |
|
| 178 |
public function getBrowsers() |
| 179 |
{ |
| 180 |
return $this->browsers; |
| 181 |
} |
| 182 |
|
| 183 |
public function setCountries($countries) |
| 184 |
{ |
| 185 |
$this->countries = $countries; |
| 186 |
} |
| 187 |
|
| 188 |
public function getCountries() |
| 189 |
{ |
| 190 |
return $this->countries; |
| 191 |
} |
| 192 |
|
| 193 |
public function setLongUrlClicks($longUrlClicks) |
| 194 |
{ |
| 195 |
$this->longUrlClicks = $longUrlClicks; |
| 196 |
} |
| 197 |
|
| 198 |
public function getLongUrlClicks() |
| 199 |
{ |
| 200 |
return $this->longUrlClicks; |
| 201 |
} |
| 202 |
|
| 203 |
public function setPlatforms($platforms) |
| 204 |
{ |
| 205 |
$this->platforms = $platforms; |
| 206 |
} |
| 207 |
|
| 208 |
public function getPlatforms() |
| 209 |
{ |
| 210 |
return $this->platforms; |
| 211 |
} |
| 212 |
|
| 213 |
public function setReferrers($referrers) |
| 214 |
{ |
| 215 |
$this->referrers = $referrers; |
| 216 |
} |
| 217 |
|
| 218 |
public function getReferrers() |
| 219 |
{ |
| 220 |
return $this->referrers; |
| 221 |
} |
| 222 |
|
| 223 |
public function setShortUrlClicks($shortUrlClicks) |
| 224 |
{ |
| 225 |
$this->shortUrlClicks = $shortUrlClicks; |
| 226 |
} |
| 227 |
|
| 228 |
public function getShortUrlClicks() |
| 229 |
{ |
| 230 |
return $this->shortUrlClicks; |
| 231 |
} |
| 232 |
} |
| 233 |
|
| 234 |
class Analytify_Google_Service_Urlshortener_AnalyticsSummary extends Analytify_Google_Model |
| 235 |
{ |
| 236 |
protected $allTimeType = 'Analytify_Google_Service_Urlshortener_AnalyticsSnapshot'; |
| 237 |
protected $allTimeDataType = ''; |
| 238 |
protected $dayType = 'Analytify_Google_Service_Urlshortener_AnalyticsSnapshot'; |
| 239 |
protected $dayDataType = ''; |
| 240 |
protected $monthType = 'Analytify_Google_Service_Urlshortener_AnalyticsSnapshot'; |
| 241 |
protected $monthDataType = ''; |
| 242 |
protected $twoHoursType = 'Analytify_Google_Service_Urlshortener_AnalyticsSnapshot'; |
| 243 |
protected $twoHoursDataType = ''; |
| 244 |
protected $weekType = 'Analytify_Google_Service_Urlshortener_AnalyticsSnapshot'; |
| 245 |
protected $weekDataType = ''; |
| 246 |
|
| 247 |
public function setAllTime(Analytify_Google_Service_Urlshortener_AnalyticsSnapshot $allTime) |
| 248 |
{ |
| 249 |
$this->allTime = $allTime; |
| 250 |
} |
| 251 |
|
| 252 |
public function getAllTime() |
| 253 |
{ |
| 254 |
return $this->allTime; |
| 255 |
} |
| 256 |
|
| 257 |
public function setDay(Analytify_Google_Service_Urlshortener_AnalyticsSnapshot $day) |
| 258 |
{ |
| 259 |
$this->day = $day; |
| 260 |
} |
| 261 |
|
| 262 |
public function getDay() |
| 263 |
{ |
| 264 |
return $this->day; |
| 265 |
} |
| 266 |
|
| 267 |
public function setMonth(Analytify_Google_Service_Urlshortener_AnalyticsSnapshot $month) |
| 268 |
{ |
| 269 |
$this->month = $month; |
| 270 |
} |
| 271 |
|
| 272 |
public function getMonth() |
| 273 |
{ |
| 274 |
return $this->month; |
| 275 |
} |
| 276 |
|
| 277 |
public function setTwoHours(Analytify_Google_Service_Urlshortener_AnalyticsSnapshot $twoHours) |
| 278 |
{ |
| 279 |
$this->twoHours = $twoHours; |
| 280 |
} |
| 281 |
|
| 282 |
public function getTwoHours() |
| 283 |
{ |
| 284 |
return $this->twoHours; |
| 285 |
} |
| 286 |
|
| 287 |
public function setWeek(Analytify_Google_Service_Urlshortener_AnalyticsSnapshot $week) |
| 288 |
{ |
| 289 |
$this->week = $week; |
| 290 |
} |
| 291 |
|
| 292 |
public function getWeek() |
| 293 |
{ |
| 294 |
return $this->week; |
| 295 |
} |
| 296 |
} |
| 297 |
|
| 298 |
class Analytify_Google_Service_Urlshortener_StringCount extends Analytify_Google_Model |
| 299 |
{ |
| 300 |
public $count; |
| 301 |
public $id; |
| 302 |
|
| 303 |
public function setCount($count) |
| 304 |
{ |
| 305 |
$this->count = $count; |
| 306 |
} |
| 307 |
|
| 308 |
public function getCount() |
| 309 |
{ |
| 310 |
return $this->count; |
| 311 |
} |
| 312 |
|
| 313 |
public function setId($id) |
| 314 |
{ |
| 315 |
$this->id = $id; |
| 316 |
} |
| 317 |
|
| 318 |
public function getId() |
| 319 |
{ |
| 320 |
return $this->id; |
| 321 |
} |
| 322 |
} |
| 323 |
|
| 324 |
class Analytify_Google_Service_Urlshortener_Url extends Analytify_Google_Model |
| 325 |
{ |
| 326 |
protected $analyticsType = 'Analytify_Google_Service_Urlshortener_AnalyticsSummary'; |
| 327 |
protected $analyticsDataType = ''; |
| 328 |
public $created; |
| 329 |
public $id; |
| 330 |
public $kind; |
| 331 |
public $longUrl; |
| 332 |
public $status; |
| 333 |
|
| 334 |
public function setAnalytics(Analytify_Google_Service_Urlshortener_AnalyticsSummary $analytics) |
| 335 |
{ |
| 336 |
$this->analytics = $analytics; |
| 337 |
} |
| 338 |
|
| 339 |
public function getAnalytics() |
| 340 |
{ |
| 341 |
return $this->analytics; |
| 342 |
} |
| 343 |
|
| 344 |
public function setCreated($created) |
| 345 |
{ |
| 346 |
$this->created = $created; |
| 347 |
} |
| 348 |
|
| 349 |
public function getCreated() |
| 350 |
{ |
| 351 |
return $this->created; |
| 352 |
} |
| 353 |
|
| 354 |
public function setId($id) |
| 355 |
{ |
| 356 |
$this->id = $id; |
| 357 |
} |
| 358 |
|
| 359 |
public function getId() |
| 360 |
{ |
| 361 |
return $this->id; |
| 362 |
} |
| 363 |
|
| 364 |
public function setKind($kind) |
| 365 |
{ |
| 366 |
$this->kind = $kind; |
| 367 |
} |
| 368 |
|
| 369 |
public function getKind() |
| 370 |
{ |
| 371 |
return $this->kind; |
| 372 |
} |
| 373 |
|
| 374 |
public function setLongUrl($longUrl) |
| 375 |
{ |
| 376 |
$this->longUrl = $longUrl; |
| 377 |
} |
| 378 |
|
| 379 |
public function getLongUrl() |
| 380 |
{ |
| 381 |
return $this->longUrl; |
| 382 |
} |
| 383 |
|
| 384 |
public function setStatus($status) |
| 385 |
{ |
| 386 |
$this->status = $status; |
| 387 |
} |
| 388 |
|
| 389 |
public function getStatus() |
| 390 |
{ |
| 391 |
return $this->status; |
| 392 |
} |
| 393 |
} |
| 394 |
|
| 395 |
class Analytify_Google_Service_Urlshortener_UrlHistory extends Analytify_Google_Collection |
| 396 |
{ |
| 397 |
protected $itemsType = 'Analytify_Google_Service_Urlshortener_Url'; |
| 398 |
protected $itemsDataType = 'array'; |
| 399 |
public $itemsPerPage; |
| 400 |
public $kind; |
| 401 |
public $nextPageToken; |
| 402 |
public $totalItems; |
| 403 |
|
| 404 |
public function setItems($items) |
| 405 |
{ |
| 406 |
$this->items = $items; |
| 407 |
} |
| 408 |
|
| 409 |
public function getItems() |
| 410 |
{ |
| 411 |
return $this->items; |
| 412 |
} |
| 413 |
|
| 414 |
public function setItemsPerPage($itemsPerPage) |
| 415 |
{ |
| 416 |
$this->itemsPerPage = $itemsPerPage; |
| 417 |
} |
| 418 |
|
| 419 |
public function getItemsPerPage() |
| 420 |
{ |
| 421 |
return $this->itemsPerPage; |
| 422 |
} |
| 423 |
|
| 424 |
public function setKind($kind) |
| 425 |
{ |
| 426 |
$this->kind = $kind; |
| 427 |
} |
| 428 |
|
| 429 |
public function getKind() |
| 430 |
{ |
| 431 |
return $this->kind; |
| 432 |
} |
| 433 |
|
| 434 |
public function setNextPageToken($nextPageToken) |
| 435 |
{ |
| 436 |
$this->nextPageToken = $nextPageToken; |
| 437 |
} |
| 438 |
|
| 439 |
public function getNextPageToken() |
| 440 |
{ |
| 441 |
return $this->nextPageToken; |
| 442 |
} |
| 443 |
|
| 444 |
public function setTotalItems($totalItems) |
| 445 |
{ |
| 446 |
$this->totalItems = $totalItems; |
| 447 |
} |
| 448 |
|
| 449 |
public function getTotalItems() |
| 450 |
{ |
| 451 |
return $this->totalItems; |
| 452 |
} |
| 453 |
} |
| 454 |
|