| 1 |
<?php |
| 2 |
/* |
| 3 |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 |
* use this file except in compliance with the License. You may obtain a copy of |
| 5 |
* the License at |
| 6 |
* |
| 7 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
* |
| 9 |
* Unless required by applicable law or agreed to in writing, software |
| 10 |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 |
* License for the specific language governing permissions and limitations under |
| 13 |
* the License. |
| 14 |
*/ |
| 15 |
|
| 16 |
|
| 17 |
/** |
| 18 |
* The "userinfo" collection of methods. |
| 19 |
* Typical usage is: |
| 20 |
* <code> |
| 21 |
* $oauth2Service = new Google_Oauth2Service(...); |
| 22 |
* $userinfo = $oauth2Service->userinfo; |
| 23 |
* </code> |
| 24 |
*/ |
| 25 |
class Google_UserinfoServiceResource extends Google_ServiceResource { |
| 26 |
|
| 27 |
|
| 28 |
/** |
| 29 |
* (userinfo.get) |
| 30 |
* |
| 31 |
* @param array $optParams Optional parameters. |
| 32 |
* @return Google_Userinfo |
| 33 |
*/ |
| 34 |
public function get($optParams = array()) { |
| 35 |
$params = array(); |
| 36 |
$params = array_merge($params, $optParams); |
| 37 |
$data = $this->__call('get', array($params)); |
| 38 |
if ($this->useObjects()) { |
| 39 |
return new Google_Userinfo($data); |
| 40 |
} else { |
| 41 |
return $data; |
| 42 |
} |
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
/** |
| 47 |
* The "v2" collection of methods. |
| 48 |
* Typical usage is: |
| 49 |
* <code> |
| 50 |
* $oauth2Service = new Google_Oauth2Service(...); |
| 51 |
* $v2 = $oauth2Service->v2; |
| 52 |
* </code> |
| 53 |
*/ |
| 54 |
class Google_UserinfoV2ServiceResource extends Google_ServiceResource { |
| 55 |
|
| 56 |
|
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* The "me" collection of methods. |
| 61 |
* Typical usage is: |
| 62 |
* <code> |
| 63 |
* $oauth2Service = new Google_Oauth2Service(...); |
| 64 |
* $me = $oauth2Service->me; |
| 65 |
* </code> |
| 66 |
*/ |
| 67 |
class Google_UserinfoV2MeServiceResource extends Google_ServiceResource { |
| 68 |
|
| 69 |
|
| 70 |
/** |
| 71 |
* (me.get) |
| 72 |
* |
| 73 |
* @param array $optParams Optional parameters. |
| 74 |
* @return Google_Userinfo |
| 75 |
*/ |
| 76 |
public function get($optParams = array()) { |
| 77 |
$params = array(); |
| 78 |
$params = array_merge($params, $optParams); |
| 79 |
$data = $this->__call('get', array($params)); |
| 80 |
if ($this->useObjects()) { |
| 81 |
return new Google_Userinfo($data); |
| 82 |
} else { |
| 83 |
return $data; |
| 84 |
} |
| 85 |
} |
| 86 |
} |
| 87 |
|
| 88 |
/** |
| 89 |
* Service definition for Google_Oauth2 (v2). |
| 90 |
* |
| 91 |
* <p> |
| 92 |
* OAuth2 API |
| 93 |
* </p> |
| 94 |
* |
| 95 |
* <p> |
| 96 |
* For more information about this service, see the |
| 97 |
* <a href="" target="_blank">API Documentation</a> |
| 98 |
* </p> |
| 99 |
* |
| 100 |
* @author Google, Inc. |
| 101 |
*/ |
| 102 |
class Google_Oauth2Service extends Google_Service { |
| 103 |
public $userinfo; |
| 104 |
public $userinfo_v2_me; |
| 105 |
/** |
| 106 |
* Constructs the internal representation of the Oauth2 service. |
| 107 |
* |
| 108 |
* @param Google_Client $client |
| 109 |
*/ |
| 110 |
public function __construct(Google_Client $client) { |
| 111 |
$this->servicePath = ''; |
| 112 |
$this->version = 'v2'; |
| 113 |
$this->serviceName = 'oauth2'; |
| 114 |
|
| 115 |
$client->addService($this->serviceName, $this->version); |
| 116 |
$this->userinfo = new Google_UserinfoServiceResource($this, $this->serviceName, 'userinfo', json_decode('{"methods": {"get": {"path": "oauth2/v2/userinfo", "scopes": ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"], "id": "oauth2.userinfo.get", "httpMethod": "GET", "response": {"$ref": "Userinfo"}}}}', true)); |
| 117 |
$this->userinfo_v2_me = new Google_UserinfoV2MeServiceResource($this, $this->serviceName, 'me', json_decode('{"methods": {"get": {"path": "userinfo/v2/me", "scopes": ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"], "id": "oauth2.userinfo.v2.me.get", "httpMethod": "GET", "response": {"$ref": "Userinfo"}}}}', true)); |
| 118 |
} |
| 119 |
} |
| 120 |
|
| 121 |
class Google_Tokeninfo extends Google_Model { |
| 122 |
public $issued_to; |
| 123 |
public $user_id; |
| 124 |
public $expires_in; |
| 125 |
public $access_type; |
| 126 |
public $audience; |
| 127 |
public $scope; |
| 128 |
public $email; |
| 129 |
public $verified_email; |
| 130 |
public function setIssued_to($issued_to) { |
| 131 |
$this->issued_to = $issued_to; |
| 132 |
} |
| 133 |
public function getIssued_to() { |
| 134 |
return $this->issued_to; |
| 135 |
} |
| 136 |
public function setUser_id($user_id) { |
| 137 |
$this->user_id = $user_id; |
| 138 |
} |
| 139 |
public function getUser_id() { |
| 140 |
return $this->user_id; |
| 141 |
} |
| 142 |
public function setExpires_in($expires_in) { |
| 143 |
$this->expires_in = $expires_in; |
| 144 |
} |
| 145 |
public function getExpires_in() { |
| 146 |
return $this->expires_in; |
| 147 |
} |
| 148 |
public function setAccess_type($access_type) { |
| 149 |
$this->access_type = $access_type; |
| 150 |
} |
| 151 |
public function getAccess_type() { |
| 152 |
return $this->access_type; |
| 153 |
} |
| 154 |
public function setAudience($audience) { |
| 155 |
$this->audience = $audience; |
| 156 |
} |
| 157 |
public function getAudience() { |
| 158 |
return $this->audience; |
| 159 |
} |
| 160 |
public function setScope($scope) { |
| 161 |
$this->scope = $scope; |
| 162 |
} |
| 163 |
public function getScope() { |
| 164 |
return $this->scope; |
| 165 |
} |
| 166 |
public function setEmail($email) { |
| 167 |
$this->email = $email; |
| 168 |
} |
| 169 |
public function getEmail() { |
| 170 |
return $this->email; |
| 171 |
} |
| 172 |
public function setVerified_email($verified_email) { |
| 173 |
$this->verified_email = $verified_email; |
| 174 |
} |
| 175 |
public function getVerified_email() { |
| 176 |
return $this->verified_email; |
| 177 |
} |
| 178 |
} |
| 179 |
|
| 180 |
class Google_Userinfo extends Google_Model { |
| 181 |
public $family_name; |
| 182 |
public $name; |
| 183 |
public $picture; |
| 184 |
public $locale; |
| 185 |
public $gender; |
| 186 |
public $email; |
| 187 |
public $birthday; |
| 188 |
public $link; |
| 189 |
public $given_name; |
| 190 |
public $timezone; |
| 191 |
public $id; |
| 192 |
public $verified_email; |
| 193 |
public function setFamily_name($family_name) { |
| 194 |
$this->family_name = $family_name; |
| 195 |
} |
| 196 |
public function getFamily_name() { |
| 197 |
return $this->family_name; |
| 198 |
} |
| 199 |
public function setName($name) { |
| 200 |
$this->name = $name; |
| 201 |
} |
| 202 |
public function getName() { |
| 203 |
return $this->name; |
| 204 |
} |
| 205 |
public function setPicture($picture) { |
| 206 |
$this->picture = $picture; |
| 207 |
} |
| 208 |
public function getPicture() { |
| 209 |
return $this->picture; |
| 210 |
} |
| 211 |
public function setLocale($locale) { |
| 212 |
$this->locale = $locale; |
| 213 |
} |
| 214 |
public function getLocale() { |
| 215 |
return $this->locale; |
| 216 |
} |
| 217 |
public function setGender($gender) { |
| 218 |
$this->gender = $gender; |
| 219 |
} |
| 220 |
public function getGender() { |
| 221 |
return $this->gender; |
| 222 |
} |
| 223 |
public function setEmail($email) { |
| 224 |
$this->email = $email; |
| 225 |
} |
| 226 |
public function getEmail() { |
| 227 |
return $this->email; |
| 228 |
} |
| 229 |
public function setBirthday($birthday) { |
| 230 |
$this->birthday = $birthday; |
| 231 |
} |
| 232 |
public function getBirthday() { |
| 233 |
return $this->birthday; |
| 234 |
} |
| 235 |
public function setLink($link) { |
| 236 |
$this->link = $link; |
| 237 |
} |
| 238 |
public function getLink() { |
| 239 |
return $this->link; |
| 240 |
} |
| 241 |
public function setGiven_name($given_name) { |
| 242 |
$this->given_name = $given_name; |
| 243 |
} |
| 244 |
public function getGiven_name() { |
| 245 |
return $this->given_name; |
| 246 |
} |
| 247 |
public function setTimezone($timezone) { |
| 248 |
$this->timezone = $timezone; |
| 249 |
} |
| 250 |
public function getTimezone() { |
| 251 |
return $this->timezone; |
| 252 |
} |
| 253 |
public function setId($id) { |
| 254 |
$this->id = $id; |
| 255 |
} |
| 256 |
public function getId() { |
| 257 |
return $this->id; |
| 258 |
} |
| 259 |
public function setVerified_email($verified_email) { |
| 260 |
$this->verified_email = $verified_email; |
| 261 |
} |
| 262 |
public function getVerified_email() { |
| 263 |
return $this->verified_email; |
| 264 |
} |
| 265 |
} |
| 266 |
|