/usr/share/php/google-api-php-client/src/contrib/Google_UrlshortenerService.php is in php-google-api-php-client 0.6.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | <?php
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "url" collection of methods.
* Typical usage is:
* <code>
* $urlshortenerService = new Google_UrlshortenerService(...);
* $url = $urlshortenerService->url;
* </code>
*/
class Google_UrlServiceResource extends Google_ServiceResource {
/**
* Creates a new short URL. (url.insert)
*
* @param Google_Url $postBody
* @param array $optParams Optional parameters.
* @return Google_Url
*/
public function insert(Google_Url $postBody, $optParams = array()) {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('insert', array($params));
if ($this->useObjects()) {
return new Google_Url($data);
} else {
return $data;
}
}
/**
* Retrieves a list of URLs shortened by a user. (url.list)
*
* @param array $optParams Optional parameters.
*
* @opt_param string start-token Token for requesting successive pages of results.
* @opt_param string projection Additional information to return.
* @return Google_UrlHistory
*/
public function listUrl($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('list', array($params));
if ($this->useObjects()) {
return new Google_UrlHistory($data);
} else {
return $data;
}
}
/**
* Expands a short URL or gets creation time and analytics. (url.get)
*
* @param string $shortUrl The short URL, including the protocol.
* @param array $optParams Optional parameters.
*
* @opt_param string projection Additional information to return.
* @return Google_Url
*/
public function get($shortUrl, $optParams = array()) {
$params = array('shortUrl' => $shortUrl);
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Url($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Urlshortener (v1).
*
* <p>
* Lets you create, inspect, and manage goo.gl short URLs
* </p>
*
* <p>
* For more information about this service, see the
* <a href="http://code.google.com/apis/urlshortener/v1/getting_started.html" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_UrlshortenerService extends Google_Service {
public $url;
/**
* Constructs the internal representation of the Urlshortener service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = 'urlshortener/v1/';
$this->version = 'v1';
$this->serviceName = 'urlshortener';
$client->addService($this->serviceName, $this->version);
$this->url = new Google_UrlServiceResource($this, $this->serviceName, 'url', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/urlshortener"], "request": {"$ref": "Url"}, "response": {"$ref": "Url"}, "httpMethod": "POST", "path": "url", "id": "urlshortener.url.insert"}, "list": {"scopes": ["https://www.googleapis.com/auth/urlshortener"], "parameters": {"start-token": {"type": "string", "location": "query"}, "projection": {"enum": ["ANALYTICS_CLICKS", "FULL"], "type": "string", "location": "query"}}, "response": {"$ref": "UrlHistory"}, "httpMethod": "GET", "path": "url/history", "id": "urlshortener.url.list"}, "get": {"httpMethod": "GET", "response": {"$ref": "Url"}, "id": "urlshortener.url.get", "parameters": {"shortUrl": {"required": true, "type": "string", "location": "query"}, "projection": {"enum": ["ANALYTICS_CLICKS", "ANALYTICS_TOP_STRINGS", "FULL"], "type": "string", "location": "query"}}, "path": "url"}}}', true));
}
}
class Google_AnalyticsSnapshot extends Google_Model {
public $shortUrlClicks;
protected $__countriesType = 'Google_StringCount';
protected $__countriesDataType = 'array';
public $countries;
protected $__platformsType = 'Google_StringCount';
protected $__platformsDataType = 'array';
public $platforms;
protected $__browsersType = 'Google_StringCount';
protected $__browsersDataType = 'array';
public $browsers;
protected $__referrersType = 'Google_StringCount';
protected $__referrersDataType = 'array';
public $referrers;
public $longUrlClicks;
public function setShortUrlClicks($shortUrlClicks) {
$this->shortUrlClicks = $shortUrlClicks;
}
public function getShortUrlClicks() {
return $this->shortUrlClicks;
}
public function setCountries(/* array(Google_StringCount) */ $countries) {
$this->assertIsArray($countries, 'Google_StringCount', __METHOD__);
$this->countries = $countries;
}
public function getCountries() {
return $this->countries;
}
public function setPlatforms(/* array(Google_StringCount) */ $platforms) {
$this->assertIsArray($platforms, 'Google_StringCount', __METHOD__);
$this->platforms = $platforms;
}
public function getPlatforms() {
return $this->platforms;
}
public function setBrowsers(/* array(Google_StringCount) */ $browsers) {
$this->assertIsArray($browsers, 'Google_StringCount', __METHOD__);
$this->browsers = $browsers;
}
public function getBrowsers() {
return $this->browsers;
}
public function setReferrers(/* array(Google_StringCount) */ $referrers) {
$this->assertIsArray($referrers, 'Google_StringCount', __METHOD__);
$this->referrers = $referrers;
}
public function getReferrers() {
return $this->referrers;
}
public function setLongUrlClicks($longUrlClicks) {
$this->longUrlClicks = $longUrlClicks;
}
public function getLongUrlClicks() {
return $this->longUrlClicks;
}
}
class Google_AnalyticsSummary extends Google_Model {
protected $__weekType = 'Google_AnalyticsSnapshot';
protected $__weekDataType = '';
public $week;
protected $__allTimeType = 'Google_AnalyticsSnapshot';
protected $__allTimeDataType = '';
public $allTime;
protected $__twoHoursType = 'Google_AnalyticsSnapshot';
protected $__twoHoursDataType = '';
public $twoHours;
protected $__dayType = 'Google_AnalyticsSnapshot';
protected $__dayDataType = '';
public $day;
protected $__monthType = 'Google_AnalyticsSnapshot';
protected $__monthDataType = '';
public $month;
public function setWeek(Google_AnalyticsSnapshot $week) {
$this->week = $week;
}
public function getWeek() {
return $this->week;
}
public function setAllTime(Google_AnalyticsSnapshot $allTime) {
$this->allTime = $allTime;
}
public function getAllTime() {
return $this->allTime;
}
public function setTwoHours(Google_AnalyticsSnapshot $twoHours) {
$this->twoHours = $twoHours;
}
public function getTwoHours() {
return $this->twoHours;
}
public function setDay(Google_AnalyticsSnapshot $day) {
$this->day = $day;
}
public function getDay() {
return $this->day;
}
public function setMonth(Google_AnalyticsSnapshot $month) {
$this->month = $month;
}
public function getMonth() {
return $this->month;
}
}
class Google_StringCount extends Google_Model {
public $count;
public $id;
public function setCount($count) {
$this->count = $count;
}
public function getCount() {
return $this->count;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_Url extends Google_Model {
public $status;
public $kind;
public $created;
protected $__analyticsType = 'Google_AnalyticsSummary';
protected $__analyticsDataType = '';
public $analytics;
public $longUrl;
public $id;
public function setStatus($status) {
$this->status = $status;
}
public function getStatus() {
return $this->status;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setCreated($created) {
$this->created = $created;
}
public function getCreated() {
return $this->created;
}
public function setAnalytics(Google_AnalyticsSummary $analytics) {
$this->analytics = $analytics;
}
public function getAnalytics() {
return $this->analytics;
}
public function setLongUrl($longUrl) {
$this->longUrl = $longUrl;
}
public function getLongUrl() {
return $this->longUrl;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
}
class Google_UrlHistory extends Google_Model {
public $nextPageToken;
protected $__itemsType = 'Google_Url';
protected $__itemsDataType = 'array';
public $items;
public $kind;
public $itemsPerPage;
public $totalItems;
public function setNextPageToken($nextPageToken) {
$this->nextPageToken = $nextPageToken;
}
public function getNextPageToken() {
return $this->nextPageToken;
}
public function setItems(/* array(Google_Url) */ $items) {
$this->assertIsArray($items, 'Google_Url', __METHOD__);
$this->items = $items;
}
public function getItems() {
return $this->items;
}
public function setKind($kind) {
$this->kind = $kind;
}
public function getKind() {
return $this->kind;
}
public function setItemsPerPage($itemsPerPage) {
$this->itemsPerPage = $itemsPerPage;
}
public function getItemsPerPage() {
return $this->itemsPerPage;
}
public function setTotalItems($totalItems) {
$this->totalItems = $totalItems;
}
public function getTotalItems() {
return $this->totalItems;
}
}
|