[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
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 Google_Service_Urlshortener extends 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 Google_Client $client 44 */ 45 public function __construct(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 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 Google_Service_Urlshortener(...); 102 * $url = $urlshortenerService->url; 103 * </code> 104 */ 105 class Google_Service_Urlshortener_Url_Resource extends 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 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), "Google_Service_Urlshortener_Url"); 124 } 125 /** 126 * Creates a new short URL. (url.insert) 127 * 128 * @param Google_Url $postBody 129 * @param array $optParams Optional parameters. 130 * @return Google_Service_Urlshortener_Url 131 */ 132 public function insert(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), "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 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), "Google_Service_Urlshortener_UrlHistory"); 154 } 155 } 156 157 158 159 160 class Google_Service_Urlshortener_AnalyticsSnapshot extends Google_Collection 161 { 162 protected $collection_key = 'referrers'; 163 protected $browsersType = 'Google_Service_Urlshortener_StringCount'; 164 protected $browsersDataType = 'array'; 165 protected $countriesType = 'Google_Service_Urlshortener_StringCount'; 166 protected $countriesDataType = 'array'; 167 public $longUrlClicks; 168 protected $platformsType = 'Google_Service_Urlshortener_StringCount'; 169 protected $platformsDataType = 'array'; 170 protected $referrersType = 'Google_Service_Urlshortener_StringCount'; 171 protected $referrersDataType = 'array'; 172 public $shortUrlClicks; 173 174 public function setBrowsers($browsers) 175 { 176 $this->browsers = $browsers; 177 } 178 179 public function getBrowsers() 180 { 181 return $this->browsers; 182 } 183 184 public function setCountries($countries) 185 { 186 $this->countries = $countries; 187 } 188 189 public function getCountries() 190 { 191 return $this->countries; 192 } 193 194 public function setLongUrlClicks($longUrlClicks) 195 { 196 $this->longUrlClicks = $longUrlClicks; 197 } 198 199 public function getLongUrlClicks() 200 { 201 return $this->longUrlClicks; 202 } 203 204 public function setPlatforms($platforms) 205 { 206 $this->platforms = $platforms; 207 } 208 209 public function getPlatforms() 210 { 211 return $this->platforms; 212 } 213 214 public function setReferrers($referrers) 215 { 216 $this->referrers = $referrers; 217 } 218 219 public function getReferrers() 220 { 221 return $this->referrers; 222 } 223 224 public function setShortUrlClicks($shortUrlClicks) 225 { 226 $this->shortUrlClicks = $shortUrlClicks; 227 } 228 229 public function getShortUrlClicks() 230 { 231 return $this->shortUrlClicks; 232 } 233 } 234 235 class Google_Service_Urlshortener_AnalyticsSummary extends Google_Model 236 { 237 protected $allTimeType = 'Google_Service_Urlshortener_AnalyticsSnapshot'; 238 protected $allTimeDataType = ''; 239 protected $dayType = 'Google_Service_Urlshortener_AnalyticsSnapshot'; 240 protected $dayDataType = ''; 241 protected $monthType = 'Google_Service_Urlshortener_AnalyticsSnapshot'; 242 protected $monthDataType = ''; 243 protected $twoHoursType = 'Google_Service_Urlshortener_AnalyticsSnapshot'; 244 protected $twoHoursDataType = ''; 245 protected $weekType = 'Google_Service_Urlshortener_AnalyticsSnapshot'; 246 protected $weekDataType = ''; 247 248 public function setAllTime(Google_Service_Urlshortener_AnalyticsSnapshot $allTime) 249 { 250 $this->allTime = $allTime; 251 } 252 253 public function getAllTime() 254 { 255 return $this->allTime; 256 } 257 258 public function setDay(Google_Service_Urlshortener_AnalyticsSnapshot $day) 259 { 260 $this->day = $day; 261 } 262 263 public function getDay() 264 { 265 return $this->day; 266 } 267 268 public function setMonth(Google_Service_Urlshortener_AnalyticsSnapshot $month) 269 { 270 $this->month = $month; 271 } 272 273 public function getMonth() 274 { 275 return $this->month; 276 } 277 278 public function setTwoHours(Google_Service_Urlshortener_AnalyticsSnapshot $twoHours) 279 { 280 $this->twoHours = $twoHours; 281 } 282 283 public function getTwoHours() 284 { 285 return $this->twoHours; 286 } 287 288 public function setWeek(Google_Service_Urlshortener_AnalyticsSnapshot $week) 289 { 290 $this->week = $week; 291 } 292 293 public function getWeek() 294 { 295 return $this->week; 296 } 297 } 298 299 class Google_Service_Urlshortener_StringCount extends Google_Model 300 { 301 public $count; 302 public $id; 303 304 public function setCount($count) 305 { 306 $this->count = $count; 307 } 308 309 public function getCount() 310 { 311 return $this->count; 312 } 313 314 public function setId($id) 315 { 316 $this->id = $id; 317 } 318 319 public function getId() 320 { 321 return $this->id; 322 } 323 } 324 325 class Google_Service_Urlshortener_Url extends Google_Model 326 { 327 protected $analyticsType = 'Google_Service_Urlshortener_AnalyticsSummary'; 328 protected $analyticsDataType = ''; 329 public $created; 330 public $id; 331 public $kind; 332 public $longUrl; 333 public $status; 334 335 public function setAnalytics(Google_Service_Urlshortener_AnalyticsSummary $analytics) 336 { 337 $this->analytics = $analytics; 338 } 339 340 public function getAnalytics() 341 { 342 return $this->analytics; 343 } 344 345 public function setCreated($created) 346 { 347 $this->created = $created; 348 } 349 350 public function getCreated() 351 { 352 return $this->created; 353 } 354 355 public function setId($id) 356 { 357 $this->id = $id; 358 } 359 360 public function getId() 361 { 362 return $this->id; 363 } 364 365 public function setKind($kind) 366 { 367 $this->kind = $kind; 368 } 369 370 public function getKind() 371 { 372 return $this->kind; 373 } 374 375 public function setLongUrl($longUrl) 376 { 377 $this->longUrl = $longUrl; 378 } 379 380 public function getLongUrl() 381 { 382 return $this->longUrl; 383 } 384 385 public function setStatus($status) 386 { 387 $this->status = $status; 388 } 389 390 public function getStatus() 391 { 392 return $this->status; 393 } 394 } 395 396 class Google_Service_Urlshortener_UrlHistory extends Google_Collection 397 { 398 protected $collection_key = 'items'; 399 protected $itemsType = 'Google_Service_Urlshortener_Url'; 400 protected $itemsDataType = 'array'; 401 public $itemsPerPage; 402 public $kind; 403 public $nextPageToken; 404 public $totalItems; 405 406 public function setItems($items) 407 { 408 $this->items = $items; 409 } 410 411 public function getItems() 412 { 413 return $this->items; 414 } 415 416 public function setItemsPerPage($itemsPerPage) 417 { 418 $this->itemsPerPage = $itemsPerPage; 419 } 420 421 public function getItemsPerPage() 422 { 423 return $this->itemsPerPage; 424 } 425 426 public function setKind($kind) 427 { 428 $this->kind = $kind; 429 } 430 431 public function getKind() 432 { 433 return $this->kind; 434 } 435 436 public function setNextPageToken($nextPageToken) 437 { 438 $this->nextPageToken = $nextPageToken; 439 } 440 441 public function getNextPageToken() 442 { 443 return $this->nextPageToken; 444 } 445 446 public function setTotalItems($totalItems) 447 { 448 $this->totalItems = $totalItems; 449 } 450 451 public function getTotalItems() 452 { 453 return $this->totalItems; 454 } 455 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |