Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 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 Licensing (v1).
  20   *
  21   * <p>
  22   * Licensing API to view and manage license for your domain.</p>
  23   *
  24   * <p>
  25   * For more information about this service, see the API
  26   * <a href="https://developers.google.com/google-apps/licensing/" target="_blank">Documentation</a>
  27   * </p>
  28   *
  29   * @author Google, Inc.
  30   */
  31  #[AllowDynamicProperties]
  32  class Google_Service_Licensing extends Google_Service
  33  {
  34    /** View and manage Google Apps licenses for your domain. */
  35    const APPS_LICENSING =
  36        "https://www.googleapis.com/auth/apps.licensing";
  37  
  38    public $licenseAssignments;
  39    
  40  
  41    /**
  42     * Constructs the internal representation of the Licensing service.
  43     *
  44     * @param Google_Client $client
  45     */
  46    public function __construct(Google_Client $client)
  47    {
  48      parent::__construct($client);
  49      $this->rootUrl = 'https://www.googleapis.com/';
  50      $this->servicePath = 'apps/licensing/v1/product/';
  51      $this->version = 'v1';
  52      $this->serviceName = 'licensing';
  53  
  54      $this->licenseAssignments = new Google_Service_Licensing_LicenseAssignments_Resource(
  55          $this,
  56          $this->serviceName,
  57          'licenseAssignments',
  58          array(
  59            'methods' => array(
  60              'delete' => array(
  61                'path' => '{productId}/sku/{skuId}/user/{userId}',
  62                'httpMethod' => 'DELETE',
  63                'parameters' => array(
  64                  'productId' => array(
  65                    'location' => 'path',
  66                    'type' => 'string',
  67                    'required' => true,
  68                  ),
  69                  'skuId' => array(
  70                    'location' => 'path',
  71                    'type' => 'string',
  72                    'required' => true,
  73                  ),
  74                  'userId' => array(
  75                    'location' => 'path',
  76                    'type' => 'string',
  77                    'required' => true,
  78                  ),
  79                ),
  80              ),'get' => array(
  81                'path' => '{productId}/sku/{skuId}/user/{userId}',
  82                'httpMethod' => 'GET',
  83                'parameters' => array(
  84                  'productId' => array(
  85                    'location' => 'path',
  86                    'type' => 'string',
  87                    'required' => true,
  88                  ),
  89                  'skuId' => array(
  90                    'location' => 'path',
  91                    'type' => 'string',
  92                    'required' => true,
  93                  ),
  94                  'userId' => array(
  95                    'location' => 'path',
  96                    'type' => 'string',
  97                    'required' => true,
  98                  ),
  99                ),
 100              ),'insert' => array(
 101                'path' => '{productId}/sku/{skuId}/user',
 102                'httpMethod' => 'POST',
 103                'parameters' => array(
 104                  'productId' => array(
 105                    'location' => 'path',
 106                    'type' => 'string',
 107                    'required' => true,
 108                  ),
 109                  'skuId' => array(
 110                    'location' => 'path',
 111                    'type' => 'string',
 112                    'required' => true,
 113                  ),
 114                ),
 115              ),'listForProduct' => array(
 116                'path' => '{productId}/users',
 117                'httpMethod' => 'GET',
 118                'parameters' => array(
 119                  'productId' => array(
 120                    'location' => 'path',
 121                    'type' => 'string',
 122                    'required' => true,
 123                  ),
 124                  'customerId' => array(
 125                    'location' => 'query',
 126                    'type' => 'string',
 127                    'required' => true,
 128                  ),
 129                  'pageToken' => array(
 130                    'location' => 'query',
 131                    'type' => 'string',
 132                  ),
 133                  'maxResults' => array(
 134                    'location' => 'query',
 135                    'type' => 'integer',
 136                  ),
 137                ),
 138              ),'listForProductAndSku' => array(
 139                'path' => '{productId}/sku/{skuId}/users',
 140                'httpMethod' => 'GET',
 141                'parameters' => array(
 142                  'productId' => array(
 143                    'location' => 'path',
 144                    'type' => 'string',
 145                    'required' => true,
 146                  ),
 147                  'skuId' => array(
 148                    'location' => 'path',
 149                    'type' => 'string',
 150                    'required' => true,
 151                  ),
 152                  'customerId' => array(
 153                    'location' => 'query',
 154                    'type' => 'string',
 155                    'required' => true,
 156                  ),
 157                  'pageToken' => array(
 158                    'location' => 'query',
 159                    'type' => 'string',
 160                  ),
 161                  'maxResults' => array(
 162                    'location' => 'query',
 163                    'type' => 'integer',
 164                  ),
 165                ),
 166              ),'patch' => array(
 167                'path' => '{productId}/sku/{skuId}/user/{userId}',
 168                'httpMethod' => 'PATCH',
 169                'parameters' => array(
 170                  'productId' => array(
 171                    'location' => 'path',
 172                    'type' => 'string',
 173                    'required' => true,
 174                  ),
 175                  'skuId' => array(
 176                    'location' => 'path',
 177                    'type' => 'string',
 178                    'required' => true,
 179                  ),
 180                  'userId' => array(
 181                    'location' => 'path',
 182                    'type' => 'string',
 183                    'required' => true,
 184                  ),
 185                ),
 186              ),'update' => array(
 187                'path' => '{productId}/sku/{skuId}/user/{userId}',
 188                'httpMethod' => 'PUT',
 189                'parameters' => array(
 190                  'productId' => array(
 191                    'location' => 'path',
 192                    'type' => 'string',
 193                    'required' => true,
 194                  ),
 195                  'skuId' => array(
 196                    'location' => 'path',
 197                    'type' => 'string',
 198                    'required' => true,
 199                  ),
 200                  'userId' => array(
 201                    'location' => 'path',
 202                    'type' => 'string',
 203                    'required' => true,
 204                  ),
 205                ),
 206              ),
 207            )
 208          )
 209      );
 210    }
 211  }
 212  
 213  
 214  /**
 215   * The "licenseAssignments" collection of methods.
 216   * Typical usage is:
 217   *  <code>
 218   *   $licensingService = new Google_Service_Licensing(...);
 219   *   $licenseAssignments = $licensingService->licenseAssignments;
 220   *  </code>
 221   */
 222  #[AllowDynamicProperties]
 223  class Google_Service_Licensing_LicenseAssignments_Resource extends Google_Service_Resource
 224  {
 225  
 226    /**
 227     * Revoke License. (licenseAssignments.delete)
 228     *
 229     * @param string $productId Name for product
 230     * @param string $skuId Name for sku
 231     * @param string $userId email id or unique Id of the user
 232     * @param array $optParams Optional parameters.
 233     */
 234    public function delete($productId, $skuId, $userId, $optParams = array())
 235    {
 236      $params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId);
 237      $params = array_merge($params, $optParams);
 238      return $this->call('delete', array($params));
 239    }
 240  
 241    /**
 242     * Get license assignment of a particular product and sku for a user
 243     * (licenseAssignments.get)
 244     *
 245     * @param string $productId Name for product
 246     * @param string $skuId Name for sku
 247     * @param string $userId email id or unique Id of the user
 248     * @param array $optParams Optional parameters.
 249     * @return Google_Service_Licensing_LicenseAssignment
 250     */
 251    public function get($productId, $skuId, $userId, $optParams = array())
 252    {
 253      $params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId);
 254      $params = array_merge($params, $optParams);
 255      return $this->call('get', array($params), "Google_Service_Licensing_LicenseAssignment");
 256    }
 257  
 258    /**
 259     * Assign License. (licenseAssignments.insert)
 260     *
 261     * @param string $productId Name for product
 262     * @param string $skuId Name for sku
 263     * @param Google_LicenseAssignmentInsert $postBody
 264     * @param array $optParams Optional parameters.
 265     * @return Google_Service_Licensing_LicenseAssignment
 266     */
 267    public function insert($productId, $skuId, Google_Service_Licensing_LicenseAssignmentInsert $postBody, $optParams = array())
 268    {
 269      $params = array('productId' => $productId, 'skuId' => $skuId, 'postBody' => $postBody);
 270      $params = array_merge($params, $optParams);
 271      return $this->call('insert', array($params), "Google_Service_Licensing_LicenseAssignment");
 272    }
 273  
 274    /**
 275     * List license assignments for given product of the customer.
 276     * (licenseAssignments.listForProduct)
 277     *
 278     * @param string $productId Name for product
 279     * @param string $customerId CustomerId represents the customer for whom
 280     * licenseassignments are queried
 281     * @param array $optParams Optional parameters.
 282     *
 283     * @opt_param string pageToken Token to fetch the next page.Optional. By default
 284     * server will return first page
 285     * @opt_param string maxResults Maximum number of campaigns to return at one
 286     * time. Must be positive. Optional. Default value is 100.
 287     * @return Google_Service_Licensing_LicenseAssignmentList
 288     */
 289    public function listForProduct($productId, $customerId, $optParams = array())
 290    {
 291      $params = array('productId' => $productId, 'customerId' => $customerId);
 292      $params = array_merge($params, $optParams);
 293      return $this->call('listForProduct', array($params), "Google_Service_Licensing_LicenseAssignmentList");
 294    }
 295  
 296    /**
 297     * List license assignments for given product and sku of the customer.
 298     * (licenseAssignments.listForProductAndSku)
 299     *
 300     * @param string $productId Name for product
 301     * @param string $skuId Name for sku
 302     * @param string $customerId CustomerId represents the customer for whom
 303     * licenseassignments are queried
 304     * @param array $optParams Optional parameters.
 305     *
 306     * @opt_param string pageToken Token to fetch the next page.Optional. By default
 307     * server will return first page
 308     * @opt_param string maxResults Maximum number of campaigns to return at one
 309     * time. Must be positive. Optional. Default value is 100.
 310     * @return Google_Service_Licensing_LicenseAssignmentList
 311     */
 312    public function listForProductAndSku($productId, $skuId, $customerId, $optParams = array())
 313    {
 314      $params = array('productId' => $productId, 'skuId' => $skuId, 'customerId' => $customerId);
 315      $params = array_merge($params, $optParams);
 316      return $this->call('listForProductAndSku', array($params), "Google_Service_Licensing_LicenseAssignmentList");
 317    }
 318  
 319    /**
 320     * Assign License. This method supports patch semantics.
 321     * (licenseAssignments.patch)
 322     *
 323     * @param string $productId Name for product
 324     * @param string $skuId Name for sku for which license would be revoked
 325     * @param string $userId email id or unique Id of the user
 326     * @param Google_LicenseAssignment $postBody
 327     * @param array $optParams Optional parameters.
 328     * @return Google_Service_Licensing_LicenseAssignment
 329     */
 330    public function patch($productId, $skuId, $userId, Google_Service_Licensing_LicenseAssignment $postBody, $optParams = array())
 331    {
 332      $params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId, 'postBody' => $postBody);
 333      $params = array_merge($params, $optParams);
 334      return $this->call('patch', array($params), "Google_Service_Licensing_LicenseAssignment");
 335    }
 336  
 337    /**
 338     * Assign License. (licenseAssignments.update)
 339     *
 340     * @param string $productId Name for product
 341     * @param string $skuId Name for sku for which license would be revoked
 342     * @param string $userId email id or unique Id of the user
 343     * @param Google_LicenseAssignment $postBody
 344     * @param array $optParams Optional parameters.
 345     * @return Google_Service_Licensing_LicenseAssignment
 346     */
 347    public function update($productId, $skuId, $userId, Google_Service_Licensing_LicenseAssignment $postBody, $optParams = array())
 348    {
 349      $params = array('productId' => $productId, 'skuId' => $skuId, 'userId' => $userId, 'postBody' => $postBody);
 350      $params = array_merge($params, $optParams);
 351      return $this->call('update', array($params), "Google_Service_Licensing_LicenseAssignment");
 352    }
 353  }
 354  
 355  
 356  
 357  
 358  #[AllowDynamicProperties]
 359  class Google_Service_Licensing_LicenseAssignment extends Google_Model
 360  {
 361    protected $internal_gapi_mappings = array(
 362    );
 363    public $etags;
 364    public $kind;
 365    public $productId;
 366    public $selfLink;
 367    public $skuId;
 368    public $userId;
 369  
 370  
 371    public function setEtags($etags)
 372    {
 373      $this->etags = $etags;
 374    }
 375    public function getEtags()
 376    {
 377      return $this->etags;
 378    }
 379    public function setKind($kind)
 380    {
 381      $this->kind = $kind;
 382    }
 383    public function getKind()
 384    {
 385      return $this->kind;
 386    }
 387    public function setProductId($productId)
 388    {
 389      $this->productId = $productId;
 390    }
 391    public function getProductId()
 392    {
 393      return $this->productId;
 394    }
 395    public function setSelfLink($selfLink)
 396    {
 397      $this->selfLink = $selfLink;
 398    }
 399    public function getSelfLink()
 400    {
 401      return $this->selfLink;
 402    }
 403    public function setSkuId($skuId)
 404    {
 405      $this->skuId = $skuId;
 406    }
 407    public function getSkuId()
 408    {
 409      return $this->skuId;
 410    }
 411    public function setUserId($userId)
 412    {
 413      $this->userId = $userId;
 414    }
 415    public function getUserId()
 416    {
 417      return $this->userId;
 418    }
 419  }
 420  
 421  #[AllowDynamicProperties]
 422  class Google_Service_Licensing_LicenseAssignmentInsert extends Google_Model
 423  {
 424    protected $internal_gapi_mappings = array(
 425    );
 426    public $userId;
 427  
 428  
 429    public function setUserId($userId)
 430    {
 431      $this->userId = $userId;
 432    }
 433    public function getUserId()
 434    {
 435      return $this->userId;
 436    }
 437  }
 438  
 439  #[AllowDynamicProperties]
 440  class Google_Service_Licensing_LicenseAssignmentList extends Google_Collection
 441  {
 442    protected $collection_key = 'items';
 443    protected $internal_gapi_mappings = array(
 444    );
 445    public $etag;
 446    protected $itemsType = 'Google_Service_Licensing_LicenseAssignment';
 447    protected $itemsDataType = 'array';
 448    public $kind;
 449    public $nextPageToken;
 450  
 451  
 452    public function setEtag($etag)
 453    {
 454      $this->etag = $etag;
 455    }
 456    public function getEtag()
 457    {
 458      return $this->etag;
 459    }
 460    public function setItems($items)
 461    {
 462      $this->items = $items;
 463    }
 464    public function getItems()
 465    {
 466      return $this->items;
 467    }
 468    public function setKind($kind)
 469    {
 470      $this->kind = $kind;
 471    }
 472    public function getKind()
 473    {
 474      return $this->kind;
 475    }
 476    public function setNextPageToken($nextPageToken)
 477    {
 478      $this->nextPageToken = $nextPageToken;
 479    }
 480    public function getNextPageToken()
 481    {
 482      return $this->nextPageToken;
 483    }
 484  }