Google_Oauth2Service.php
6.86 KB
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
<?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 "userinfo" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $userinfo = $oauth2Service->userinfo;
* </code>
*/
class Google_UserinfoServiceResource extends Google_ServiceResource {
/**
* (userinfo.get)
*
* @param array $optParams Optional parameters.
* @return Google_Userinfo
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Userinfo($data);
} else {
return $data;
}
}
}
/**
* The "v2" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $v2 = $oauth2Service->v2;
* </code>
*/
class Google_UserinfoV2ServiceResource extends Google_ServiceResource {
}
/**
* The "me" collection of methods.
* Typical usage is:
* <code>
* $oauth2Service = new Google_Oauth2Service(...);
* $me = $oauth2Service->me;
* </code>
*/
class Google_UserinfoV2MeServiceResource extends Google_ServiceResource {
/**
* (me.get)
*
* @param array $optParams Optional parameters.
* @return Google_Userinfo
*/
public function get($optParams = array()) {
$params = array();
$params = array_merge($params, $optParams);
$data = $this->__call('get', array($params));
if ($this->useObjects()) {
return new Google_Userinfo($data);
} else {
return $data;
}
}
}
/**
* Service definition for Google_Oauth2 (v2).
*
* <p>
* OAuth2 API
* </p>
*
* <p>
* For more information about this service, see the
* <a href="" target="_blank">API Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_Oauth2Service extends Google_Service {
public $userinfo;
public $userinfo_v2_me;
/**
* Constructs the internal representation of the Oauth2 service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client) {
$this->servicePath = '';
$this->version = 'v2';
$this->serviceName = 'oauth2';
$client->addService($this->serviceName, $this->version);
$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));
$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));
}
}
class Google_Tokeninfo extends Google_Model {
public $issued_to;
public $user_id;
public $expires_in;
public $access_type;
public $audience;
public $scope;
public $email;
public $verified_email;
public function setIssued_to($issued_to) {
$this->issued_to = $issued_to;
}
public function getIssued_to() {
return $this->issued_to;
}
public function setUser_id($user_id) {
$this->user_id = $user_id;
}
public function getUser_id() {
return $this->user_id;
}
public function setExpires_in($expires_in) {
$this->expires_in = $expires_in;
}
public function getExpires_in() {
return $this->expires_in;
}
public function setAccess_type($access_type) {
$this->access_type = $access_type;
}
public function getAccess_type() {
return $this->access_type;
}
public function setAudience($audience) {
$this->audience = $audience;
}
public function getAudience() {
return $this->audience;
}
public function setScope($scope) {
$this->scope = $scope;
}
public function getScope() {
return $this->scope;
}
public function setEmail($email) {
$this->email = $email;
}
public function getEmail() {
return $this->email;
}
public function setVerified_email($verified_email) {
$this->verified_email = $verified_email;
}
public function getVerified_email() {
return $this->verified_email;
}
}
class Google_Userinfo extends Google_Model {
public $family_name;
public $name;
public $picture;
public $locale;
public $gender;
public $email;
public $birthday;
public $link;
public $given_name;
public $timezone;
public $id;
public $verified_email;
public function setFamily_name($family_name) {
$this->family_name = $family_name;
}
public function getFamily_name() {
return $this->family_name;
}
public function setName($name) {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function setPicture($picture) {
$this->picture = $picture;
}
public function getPicture() {
return $this->picture;
}
public function setLocale($locale) {
$this->locale = $locale;
}
public function getLocale() {
return $this->locale;
}
public function setGender($gender) {
$this->gender = $gender;
}
public function getGender() {
return $this->gender;
}
public function setEmail($email) {
$this->email = $email;
}
public function getEmail() {
return $this->email;
}
public function setBirthday($birthday) {
$this->birthday = $birthday;
}
public function getBirthday() {
return $this->birthday;
}
public function setLink($link) {
$this->link = $link;
}
public function getLink() {
return $this->link;
}
public function setGiven_name($given_name) {
$this->given_name = $given_name;
}
public function getGiven_name() {
return $this->given_name;
}
public function setTimezone($timezone) {
$this->timezone = $timezone;
}
public function getTimezone() {
return $this->timezone;
}
public function setId($id) {
$this->id = $id;
}
public function getId() {
return $this->id;
}
public function setVerified_email($verified_email) {
$this->verified_email = $verified_email;
}
public function getVerified_email() {
return $this->verified_email;
}
}