PageRenderTime 41ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/htdocs/xampp/src/contrib/Google_SiteVerificationService.php

https://bitbucket.org/adarshj/convenient_website
PHP | 287 lines | 183 code | 13 blank | 91 comment | 12 complexity | 9792e2bbe628fdae91dbfae35c00df14 MD5 | raw file
Possible License(s): Apache-2.0, MPL-2.0-no-copyleft-exception, LGPL-2.1, BSD-2-Clause, GPL-2.0, LGPL-3.0
  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. * The "webResource" collection of methods.
  17. * Typical usage is:
  18. * <code>
  19. * $siteVerificationService = new Google_SiteVerificationService(...);
  20. * $webResource = $siteVerificationService->webResource;
  21. * </code>
  22. */
  23. class Google_WebResourceServiceResource extends Google_ServiceResource {
  24. /**
  25. * Attempt verification of a website or domain. (webResource.insert)
  26. *
  27. * @param string $verificationMethod The method to use for verifying a site or domain.
  28. * @param Google_SiteVerificationWebResourceResource $postBody
  29. * @param array $optParams Optional parameters.
  30. * @return Google_SiteVerificationWebResourceResource
  31. */
  32. public function insert($verificationMethod, Google_SiteVerificationWebResourceResource $postBody, $optParams = array()) {
  33. $params = array('verificationMethod' => $verificationMethod, 'postBody' => $postBody);
  34. $params = array_merge($params, $optParams);
  35. $data = $this->__call('insert', array($params));
  36. if ($this->useObjects()) {
  37. return new Google_SiteVerificationWebResourceResource($data);
  38. } else {
  39. return $data;
  40. }
  41. }
  42. /**
  43. * Get the most current data for a website or domain. (webResource.get)
  44. *
  45. * @param string $id The id of a verified site or domain.
  46. * @param array $optParams Optional parameters.
  47. * @return Google_SiteVerificationWebResourceResource
  48. */
  49. public function get($id, $optParams = array()) {
  50. $params = array('id' => $id);
  51. $params = array_merge($params, $optParams);
  52. $data = $this->__call('get', array($params));
  53. if ($this->useObjects()) {
  54. return new Google_SiteVerificationWebResourceResource($data);
  55. } else {
  56. return $data;
  57. }
  58. }
  59. /**
  60. * Get the list of your verified websites and domains. (webResource.list)
  61. *
  62. * @param array $optParams Optional parameters.
  63. * @return Google_SiteVerificationWebResourceListResponse
  64. */
  65. public function listWebResource($optParams = array()) {
  66. $params = array();
  67. $params = array_merge($params, $optParams);
  68. $data = $this->__call('list', array($params));
  69. if ($this->useObjects()) {
  70. return new Google_SiteVerificationWebResourceListResponse($data);
  71. } else {
  72. return $data;
  73. }
  74. }
  75. /**
  76. * Modify the list of owners for your website or domain. (webResource.update)
  77. *
  78. * @param string $id The id of a verified site or domain.
  79. * @param Google_SiteVerificationWebResourceResource $postBody
  80. * @param array $optParams Optional parameters.
  81. * @return Google_SiteVerificationWebResourceResource
  82. */
  83. public function update($id, Google_SiteVerificationWebResourceResource $postBody, $optParams = array()) {
  84. $params = array('id' => $id, 'postBody' => $postBody);
  85. $params = array_merge($params, $optParams);
  86. $data = $this->__call('update', array($params));
  87. if ($this->useObjects()) {
  88. return new Google_SiteVerificationWebResourceResource($data);
  89. } else {
  90. return $data;
  91. }
  92. }
  93. /**
  94. * Modify the list of owners for your website or domain. This method supports patch semantics.
  95. * (webResource.patch)
  96. *
  97. * @param string $id The id of a verified site or domain.
  98. * @param Google_SiteVerificationWebResourceResource $postBody
  99. * @param array $optParams Optional parameters.
  100. * @return Google_SiteVerificationWebResourceResource
  101. */
  102. public function patch($id, Google_SiteVerificationWebResourceResource $postBody, $optParams = array()) {
  103. $params = array('id' => $id, 'postBody' => $postBody);
  104. $params = array_merge($params, $optParams);
  105. $data = $this->__call('patch', array($params));
  106. if ($this->useObjects()) {
  107. return new Google_SiteVerificationWebResourceResource($data);
  108. } else {
  109. return $data;
  110. }
  111. }
  112. /**
  113. * Get a verification token for placing on a website or domain. (webResource.getToken)
  114. *
  115. * @param Google_SiteVerificationWebResourceGettokenRequest $postBody
  116. * @param array $optParams Optional parameters.
  117. * @return Google_SiteVerificationWebResourceGettokenResponse
  118. */
  119. public function getToken(Google_SiteVerificationWebResourceGettokenRequest $postBody, $optParams = array()) {
  120. $params = array('postBody' => $postBody);
  121. $params = array_merge($params, $optParams);
  122. $data = $this->__call('getToken', array($params));
  123. if ($this->useObjects()) {
  124. return new Google_SiteVerificationWebResourceGettokenResponse($data);
  125. } else {
  126. return $data;
  127. }
  128. }
  129. /**
  130. * Relinquish ownership of a website or domain. (webResource.delete)
  131. *
  132. * @param string $id The id of a verified site or domain.
  133. * @param array $optParams Optional parameters.
  134. */
  135. public function delete($id, $optParams = array()) {
  136. $params = array('id' => $id);
  137. $params = array_merge($params, $optParams);
  138. $data = $this->__call('delete', array($params));
  139. return $data;
  140. }
  141. }
  142. /**
  143. * Service definition for Google_SiteVerification (v1).
  144. *
  145. * <p>
  146. * Lets you programatically verify ownership of websites or domains with Google.
  147. * </p>
  148. *
  149. * <p>
  150. * For more information about this service, see the
  151. * <a href="http://code.google.com/apis/siteverification/" target="_blank">API Documentation</a>
  152. * </p>
  153. *
  154. * @author Google, Inc.
  155. */
  156. class Google_SiteVerificationService extends Google_Service {
  157. public $webResource;
  158. /**
  159. * Constructs the internal representation of the SiteVerification service.
  160. *
  161. * @param Google_Client $client
  162. */
  163. public function __construct(Google_Client $client) {
  164. $this->servicePath = 'siteVerification/v1/';
  165. $this->version = 'v1';
  166. $this->serviceName = 'siteVerification';
  167. $client->addService($this->serviceName, $this->version);
  168. $this->webResource = new Google_WebResourceServiceResource($this, $this->serviceName, 'webResource', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/siteverification", "https://www.googleapis.com/auth/siteverification.verify_only"], "parameters": {"verificationMethod": {"required": true, "type": "string", "location": "query"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "POST", "path": "webResource", "id": "siteVerification.webResource.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "id": "siteVerification.webResource.get", "httpMethod": "GET", "path": "webResource/{id}", "response": {"$ref": "SiteVerificationWebResourceResource"}}, "list": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "path": "webResource", "response": {"$ref": "SiteVerificationWebResourceListResponse"}, "id": "siteVerification.webResource.list", "httpMethod": "GET"}, "update": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "PUT", "path": "webResource/{id}", "id": "siteVerification.webResource.update"}, "patch": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "SiteVerificationWebResourceResource"}, "response": {"$ref": "SiteVerificationWebResourceResource"}, "httpMethod": "PATCH", "path": "webResource/{id}", "id": "siteVerification.webResource.patch"}, "getToken": {"scopes": ["https://www.googleapis.com/auth/siteverification", "https://www.googleapis.com/auth/siteverification.verify_only"], "request": {"$ref": "SiteVerificationWebResourceGettokenRequest"}, "response": {"$ref": "SiteVerificationWebResourceGettokenResponse"}, "httpMethod": "POST", "path": "token", "id": "siteVerification.webResource.getToken"}, "delete": {"scopes": ["https://www.googleapis.com/auth/siteverification"], "path": "webResource/{id}", "id": "siteVerification.webResource.delete", "parameters": {"id": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
  169. }
  170. }
  171. class Google_SiteVerificationWebResourceGettokenRequest extends Google_Model {
  172. public $verificationMethod;
  173. protected $__siteType = 'Google_SiteVerificationWebResourceGettokenRequestSite';
  174. protected $__siteDataType = '';
  175. public $site;
  176. public function setVerificationMethod($verificationMethod) {
  177. $this->verificationMethod = $verificationMethod;
  178. }
  179. public function getVerificationMethod() {
  180. return $this->verificationMethod;
  181. }
  182. public function setSite(Google_SiteVerificationWebResourceGettokenRequestSite $site) {
  183. $this->site = $site;
  184. }
  185. public function getSite() {
  186. return $this->site;
  187. }
  188. }
  189. class Google_SiteVerificationWebResourceGettokenRequestSite extends Google_Model {
  190. public $identifier;
  191. public $type;
  192. public function setIdentifier($identifier) {
  193. $this->identifier = $identifier;
  194. }
  195. public function getIdentifier() {
  196. return $this->identifier;
  197. }
  198. public function setType($type) {
  199. $this->type = $type;
  200. }
  201. public function getType() {
  202. return $this->type;
  203. }
  204. }
  205. class Google_SiteVerificationWebResourceGettokenResponse extends Google_Model {
  206. public $token;
  207. public $method;
  208. public function setToken($token) {
  209. $this->token = $token;
  210. }
  211. public function getToken() {
  212. return $this->token;
  213. }
  214. public function setMethod($method) {
  215. $this->method = $method;
  216. }
  217. public function getMethod() {
  218. return $this->method;
  219. }
  220. }
  221. class Google_SiteVerificationWebResourceListResponse extends Google_Model {
  222. protected $__itemsType = 'Google_SiteVerificationWebResourceResource';
  223. protected $__itemsDataType = 'array';
  224. public $items;
  225. public function setItems(/* array(Google_SiteVerificationWebResourceResource) */ $items) {
  226. $this->assertIsArray($items, 'Google_SiteVerificationWebResourceResource', __METHOD__);
  227. $this->items = $items;
  228. }
  229. public function getItems() {
  230. return $this->items;
  231. }
  232. }
  233. class Google_SiteVerificationWebResourceResource extends Google_Model {
  234. public $owners;
  235. public $id;
  236. protected $__siteType = 'Google_SiteVerificationWebResourceResourceSite';
  237. protected $__siteDataType = '';
  238. public $site;
  239. public function setOwners(/* array(Google_string) */ $owners) {
  240. $this->assertIsArray($owners, 'Google_string', __METHOD__);
  241. $this->owners = $owners;
  242. }
  243. public function getOwners() {
  244. return $this->owners;
  245. }
  246. public function setId($id) {
  247. $this->id = $id;
  248. }
  249. public function getId() {
  250. return $this->id;
  251. }
  252. public function setSite(Google_SiteVerificationWebResourceResourceSite $site) {
  253. $this->site = $site;
  254. }
  255. public function getSite() {
  256. return $this->site;
  257. }
  258. }
  259. class Google_SiteVerificationWebResourceResourceSite extends Google_Model {
  260. public $identifier;
  261. public $type;
  262. public function setIdentifier($identifier) {
  263. $this->identifier = $identifier;
  264. }
  265. public function getIdentifier() {
  266. return $this->identifier;
  267. }
  268. public function setType($type) {
  269. $this->type = $type;
  270. }
  271. public function getType() {
  272. return $this->type;
  273. }
  274. }