Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

   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 SiteVerification (v1).
  20   *
  21   * <p>
  22   * Lets you programatically verify ownership of websites or domains with Google.</p>
  23   *
  24   * <p>
  25   * For more information about this service, see the API
  26   * <a href="https://developers.google.com/site-verification/" target="_blank">Documentation</a>
  27   * </p>
  28   *
  29   * @author Google, Inc.
  30   */
  31  class Google_Service_SiteVerification extends Google_Service
  32  {
  33    /** Manage the list of sites and domains you control. */
  34    const SITEVERIFICATION =
  35        "https://www.googleapis.com/auth/siteverification";
  36    /** Manage your new site verifications with Google. */
  37    const SITEVERIFICATION_VERIFY_ONLY =
  38        "https://www.googleapis.com/auth/siteverification.verify_only";
  39  
  40    public $webResource;
  41    
  42  
  43    /**
  44     * Constructs the internal representation of the SiteVerification service.
  45     *
  46     * @param Google_Client $client
  47     */
  48    public function __construct(Google_Client $client)
  49    {
  50      parent::__construct($client);
  51      $this->rootUrl = 'https://www.googleapis.com/';
  52      $this->servicePath = 'siteVerification/v1/';
  53      $this->version = 'v1';
  54      $this->serviceName = 'siteVerification';
  55  
  56      $this->webResource = new Google_Service_SiteVerification_WebResource_Resource(
  57          $this,
  58          $this->serviceName,
  59          'webResource',
  60          array(
  61            'methods' => array(
  62              'delete' => array(
  63                'path' => 'webResource/{id}',
  64                'httpMethod' => 'DELETE',
  65                'parameters' => array(
  66                  'id' => array(
  67                    'location' => 'path',
  68                    'type' => 'string',
  69                    'required' => true,
  70                  ),
  71                ),
  72              ),'get' => array(
  73                'path' => 'webResource/{id}',
  74                'httpMethod' => 'GET',
  75                'parameters' => array(
  76                  'id' => array(
  77                    'location' => 'path',
  78                    'type' => 'string',
  79                    'required' => true,
  80                  ),
  81                ),
  82              ),'getToken' => array(
  83                'path' => 'token',
  84                'httpMethod' => 'POST',
  85                'parameters' => array(),
  86              ),'insert' => array(
  87                'path' => 'webResource',
  88                'httpMethod' => 'POST',
  89                'parameters' => array(
  90                  'verificationMethod' => array(
  91                    'location' => 'query',
  92                    'type' => 'string',
  93                    'required' => true,
  94                  ),
  95                ),
  96              ),'list' => array(
  97                'path' => 'webResource',
  98                'httpMethod' => 'GET',
  99                'parameters' => array(),
 100              ),'patch' => array(
 101                'path' => 'webResource/{id}',
 102                'httpMethod' => 'PATCH',
 103                'parameters' => array(
 104                  'id' => array(
 105                    'location' => 'path',
 106                    'type' => 'string',
 107                    'required' => true,
 108                  ),
 109                ),
 110              ),'update' => array(
 111                'path' => 'webResource/{id}',
 112                'httpMethod' => 'PUT',
 113                'parameters' => array(
 114                  'id' => array(
 115                    'location' => 'path',
 116                    'type' => 'string',
 117                    'required' => true,
 118                  ),
 119                ),
 120              ),
 121            )
 122          )
 123      );
 124    }
 125  }
 126  
 127  
 128  /**
 129   * The "webResource" collection of methods.
 130   * Typical usage is:
 131   *  <code>
 132   *   $siteVerificationService = new Google_Service_SiteVerification(...);
 133   *   $webResource = $siteVerificationService->webResource;
 134   *  </code>
 135   */
 136  class Google_Service_SiteVerification_WebResource_Resource extends Google_Service_Resource
 137  {
 138  
 139    /**
 140     * Relinquish ownership of a website or domain. (webResource.delete)
 141     *
 142     * @param string $id The id of a verified site or domain.
 143     * @param array $optParams Optional parameters.
 144     */
 145    public function delete($id, $optParams = array())
 146    {
 147      $params = array('id' => $id);
 148      $params = array_merge($params, $optParams);
 149      return $this->call('delete', array($params));
 150    }
 151  
 152    /**
 153     * Get the most current data for a website or domain. (webResource.get)
 154     *
 155     * @param string $id The id of a verified site or domain.
 156     * @param array $optParams Optional parameters.
 157     * @return Google_Service_SiteVerification_SiteVerificationWebResourceResource
 158     */
 159    public function get($id, $optParams = array())
 160    {
 161      $params = array('id' => $id);
 162      $params = array_merge($params, $optParams);
 163      return $this->call('get', array($params), "Google_Service_SiteVerification_SiteVerificationWebResourceResource");
 164    }
 165  
 166    /**
 167     * Get a verification token for placing on a website or domain.
 168     * (webResource.getToken)
 169     *
 170     * @param Google_SiteVerificationWebResourceGettokenRequest $postBody
 171     * @param array $optParams Optional parameters.
 172     * @return Google_Service_SiteVerification_SiteVerificationWebResourceGettokenResponse
 173     */
 174    public function getToken(Google_Service_SiteVerification_SiteVerificationWebResourceGettokenRequest $postBody, $optParams = array())
 175    {
 176      $params = array('postBody' => $postBody);
 177      $params = array_merge($params, $optParams);
 178      return $this->call('getToken', array($params), "Google_Service_SiteVerification_SiteVerificationWebResourceGettokenResponse");
 179    }
 180  
 181    /**
 182     * Attempt verification of a website or domain. (webResource.insert)
 183     *
 184     * @param string $verificationMethod The method to use for verifying a site or
 185     * domain.
 186     * @param Google_SiteVerificationWebResourceResource $postBody
 187     * @param array $optParams Optional parameters.
 188     * @return Google_Service_SiteVerification_SiteVerificationWebResourceResource
 189     */
 190    public function insert($verificationMethod, Google_Service_SiteVerification_SiteVerificationWebResourceResource $postBody, $optParams = array())
 191    {
 192      $params = array('verificationMethod' => $verificationMethod, 'postBody' => $postBody);
 193      $params = array_merge($params, $optParams);
 194      return $this->call('insert', array($params), "Google_Service_SiteVerification_SiteVerificationWebResourceResource");
 195    }
 196  
 197    /**
 198     * Get the list of your verified websites and domains.
 199     * (webResource.listWebResource)
 200     *
 201     * @param array $optParams Optional parameters.
 202     * @return Google_Service_SiteVerification_SiteVerificationWebResourceListResponse
 203     */
 204    public function listWebResource($optParams = array())
 205    {
 206      $params = array();
 207      $params = array_merge($params, $optParams);
 208      return $this->call('list', array($params), "Google_Service_SiteVerification_SiteVerificationWebResourceListResponse");
 209    }
 210  
 211    /**
 212     * Modify the list of owners for your website or domain. This method supports
 213     * patch semantics. (webResource.patch)
 214     *
 215     * @param string $id The id of a verified site or domain.
 216     * @param Google_SiteVerificationWebResourceResource $postBody
 217     * @param array $optParams Optional parameters.
 218     * @return Google_Service_SiteVerification_SiteVerificationWebResourceResource
 219     */
 220    public function patch($id, Google_Service_SiteVerification_SiteVerificationWebResourceResource $postBody, $optParams = array())
 221    {
 222      $params = array('id' => $id, 'postBody' => $postBody);
 223      $params = array_merge($params, $optParams);
 224      return $this->call('patch', array($params), "Google_Service_SiteVerification_SiteVerificationWebResourceResource");
 225    }
 226  
 227    /**
 228     * Modify the list of owners for your website or domain. (webResource.update)
 229     *
 230     * @param string $id The id of a verified site or domain.
 231     * @param Google_SiteVerificationWebResourceResource $postBody
 232     * @param array $optParams Optional parameters.
 233     * @return Google_Service_SiteVerification_SiteVerificationWebResourceResource
 234     */
 235    public function update($id, Google_Service_SiteVerification_SiteVerificationWebResourceResource $postBody, $optParams = array())
 236    {
 237      $params = array('id' => $id, 'postBody' => $postBody);
 238      $params = array_merge($params, $optParams);
 239      return $this->call('update', array($params), "Google_Service_SiteVerification_SiteVerificationWebResourceResource");
 240    }
 241  }
 242  
 243  
 244  
 245  
 246  class Google_Service_SiteVerification_SiteVerificationWebResourceGettokenRequest extends Google_Model
 247  {
 248    protected $internal_gapi_mappings = array(
 249    );
 250    protected $siteType = 'Google_Service_SiteVerification_SiteVerificationWebResourceGettokenRequestSite';
 251    protected $siteDataType = '';
 252    public $verificationMethod;
 253  
 254  
 255    public function setSite(Google_Service_SiteVerification_SiteVerificationWebResourceGettokenRequestSite $site)
 256    {
 257      $this->site = $site;
 258    }
 259    public function getSite()
 260    {
 261      return $this->site;
 262    }
 263    public function setVerificationMethod($verificationMethod)
 264    {
 265      $this->verificationMethod = $verificationMethod;
 266    }
 267    public function getVerificationMethod()
 268    {
 269      return $this->verificationMethod;
 270    }
 271  }
 272  
 273  class Google_Service_SiteVerification_SiteVerificationWebResourceGettokenRequestSite extends Google_Model
 274  {
 275    protected $internal_gapi_mappings = array(
 276    );
 277    public $identifier;
 278    public $type;
 279  
 280  
 281    public function setIdentifier($identifier)
 282    {
 283      $this->identifier = $identifier;
 284    }
 285    public function getIdentifier()
 286    {
 287      return $this->identifier;
 288    }
 289    public function setType($type)
 290    {
 291      $this->type = $type;
 292    }
 293    public function getType()
 294    {
 295      return $this->type;
 296    }
 297  }
 298  
 299  class Google_Service_SiteVerification_SiteVerificationWebResourceGettokenResponse extends Google_Model
 300  {
 301    protected $internal_gapi_mappings = array(
 302    );
 303    public $method;
 304    public $token;
 305  
 306  
 307    public function setMethod($method)
 308    {
 309      $this->method = $method;
 310    }
 311    public function getMethod()
 312    {
 313      return $this->method;
 314    }
 315    public function setToken($token)
 316    {
 317      $this->token = $token;
 318    }
 319    public function getToken()
 320    {
 321      return $this->token;
 322    }
 323  }
 324  
 325  class Google_Service_SiteVerification_SiteVerificationWebResourceListResponse extends Google_Collection
 326  {
 327    protected $collection_key = 'items';
 328    protected $internal_gapi_mappings = array(
 329    );
 330    protected $itemsType = 'Google_Service_SiteVerification_SiteVerificationWebResourceResource';
 331    protected $itemsDataType = 'array';
 332  
 333  
 334    public function setItems($items)
 335    {
 336      $this->items = $items;
 337    }
 338    public function getItems()
 339    {
 340      return $this->items;
 341    }
 342  }
 343  
 344  class Google_Service_SiteVerification_SiteVerificationWebResourceResource extends Google_Collection
 345  {
 346    protected $collection_key = 'owners';
 347    protected $internal_gapi_mappings = array(
 348    );
 349    public $id;
 350    public $owners;
 351    protected $siteType = 'Google_Service_SiteVerification_SiteVerificationWebResourceResourceSite';
 352    protected $siteDataType = '';
 353  
 354  
 355    public function setId($id)
 356    {
 357      $this->id = $id;
 358    }
 359    public function getId()
 360    {
 361      return $this->id;
 362    }
 363    public function setOwners($owners)
 364    {
 365      $this->owners = $owners;
 366    }
 367    public function getOwners()
 368    {
 369      return $this->owners;
 370    }
 371    public function setSite(Google_Service_SiteVerification_SiteVerificationWebResourceResourceSite $site)
 372    {
 373      $this->site = $site;
 374    }
 375    public function getSite()
 376    {
 377      return $this->site;
 378    }
 379  }
 380  
 381  class Google_Service_SiteVerification_SiteVerificationWebResourceResourceSite extends Google_Model
 382  {
 383    protected $internal_gapi_mappings = array(
 384    );
 385    public $identifier;
 386    public $type;
 387  
 388  
 389    public function setIdentifier($identifier)
 390    {
 391      $this->identifier = $identifier;
 392    }
 393    public function getIdentifier()
 394    {
 395      return $this->identifier;
 396    }
 397    public function setType($type)
 398    {
 399      $this->type = $type;
 400    }
 401    public function getType()
 402    {
 403      return $this->type;
 404    }
 405  }