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 YouTubeReporting (v1).
  20   *
  21   * <p>
  22   * An API to schedule reporting jobs and download the resulting bulk data
  23   * reports about YouTube channels, videos etc. in the form of CSV files.</p>
  24   *
  25   * <p>
  26   * For more information about this service, see the API
  27   * <a href="https://developers.google.com/youtube/reporting/v1/reports/" target="_blank">Documentation</a>
  28   * </p>
  29   *
  30   * @author Google, Inc.
  31   */
  32  #[AllowDynamicProperties]
  33  class Google_Service_YouTubeReporting extends Google_Service
  34  {
  35    /** View monetary and non-monetary YouTube Analytics reports for your YouTube content. */
  36    const YT_ANALYTICS_MONETARY_READONLY =
  37        "https://www.googleapis.com/auth/yt-analytics-monetary.readonly";
  38    /** View YouTube Analytics reports for your YouTube content. */
  39    const YT_ANALYTICS_READONLY =
  40        "https://www.googleapis.com/auth/yt-analytics.readonly";
  41  
  42    public $jobs;
  43    public $jobs_reports;
  44    public $media;
  45    public $reportTypes;
  46    
  47  
  48    /**
  49     * Constructs the internal representation of the YouTubeReporting service.
  50     *
  51     * @param Google_Client $client
  52     */
  53    public function __construct(Google_Client $client)
  54    {
  55      parent::__construct($client);
  56      $this->rootUrl = 'https://youtubereporting.googleapis.com/';
  57      $this->servicePath = '';
  58      $this->version = 'v1';
  59      $this->serviceName = 'youtubereporting';
  60  
  61      $this->jobs = new Google_Service_YouTubeReporting_Jobs_Resource(
  62          $this,
  63          $this->serviceName,
  64          'jobs',
  65          array(
  66            'methods' => array(
  67              'create' => array(
  68                'path' => 'v1/jobs',
  69                'httpMethod' => 'POST',
  70                'parameters' => array(
  71                  'onBehalfOfContentOwner' => array(
  72                    'location' => 'query',
  73                    'type' => 'string',
  74                  ),
  75                ),
  76              ),'delete' => array(
  77                'path' => 'v1/jobs/{jobId}',
  78                'httpMethod' => 'DELETE',
  79                'parameters' => array(
  80                  'jobId' => array(
  81                    'location' => 'path',
  82                    'type' => 'string',
  83                    'required' => true,
  84                  ),
  85                  'onBehalfOfContentOwner' => array(
  86                    'location' => 'query',
  87                    'type' => 'string',
  88                  ),
  89                ),
  90              ),'get' => array(
  91                'path' => 'v1/jobs/{jobId}',
  92                'httpMethod' => 'GET',
  93                'parameters' => array(
  94                  'jobId' => array(
  95                    'location' => 'path',
  96                    'type' => 'string',
  97                    'required' => true,
  98                  ),
  99                  'onBehalfOfContentOwner' => array(
 100                    'location' => 'query',
 101                    'type' => 'string',
 102                  ),
 103                ),
 104              ),'list' => array(
 105                'path' => 'v1/jobs',
 106                'httpMethod' => 'GET',
 107                'parameters' => array(
 108                  'pageToken' => array(
 109                    'location' => 'query',
 110                    'type' => 'string',
 111                  ),
 112                  'onBehalfOfContentOwner' => array(
 113                    'location' => 'query',
 114                    'type' => 'string',
 115                  ),
 116                  'pageSize' => array(
 117                    'location' => 'query',
 118                    'type' => 'integer',
 119                  ),
 120                ),
 121              ),
 122            )
 123          )
 124      );
 125      $this->jobs_reports = new Google_Service_YouTubeReporting_JobsReports_Resource(
 126          $this,
 127          $this->serviceName,
 128          'reports',
 129          array(
 130            'methods' => array(
 131              'get' => array(
 132                'path' => 'v1/jobs/{jobId}/reports/{reportId}',
 133                'httpMethod' => 'GET',
 134                'parameters' => array(
 135                  'jobId' => array(
 136                    'location' => 'path',
 137                    'type' => 'string',
 138                    'required' => true,
 139                  ),
 140                  'reportId' => array(
 141                    'location' => 'path',
 142                    'type' => 'string',
 143                    'required' => true,
 144                  ),
 145                  'onBehalfOfContentOwner' => array(
 146                    'location' => 'query',
 147                    'type' => 'string',
 148                  ),
 149                ),
 150              ),'list' => array(
 151                'path' => 'v1/jobs/{jobId}/reports',
 152                'httpMethod' => 'GET',
 153                'parameters' => array(
 154                  'jobId' => array(
 155                    'location' => 'path',
 156                    'type' => 'string',
 157                    'required' => true,
 158                  ),
 159                  'pageToken' => array(
 160                    'location' => 'query',
 161                    'type' => 'string',
 162                  ),
 163                  'onBehalfOfContentOwner' => array(
 164                    'location' => 'query',
 165                    'type' => 'string',
 166                  ),
 167                  'pageSize' => array(
 168                    'location' => 'query',
 169                    'type' => 'integer',
 170                  ),
 171                ),
 172              ),
 173            )
 174          )
 175      );
 176      $this->media = new Google_Service_YouTubeReporting_Media_Resource(
 177          $this,
 178          $this->serviceName,
 179          'media',
 180          array(
 181            'methods' => array(
 182              'download' => array(
 183                'path' => 'v1/media/{+resourceName}',
 184                'httpMethod' => 'GET',
 185                'parameters' => array(
 186                  'resourceName' => array(
 187                    'location' => 'path',
 188                    'type' => 'string',
 189                    'required' => true,
 190                  ),
 191                ),
 192              ),
 193            )
 194          )
 195      );
 196      $this->reportTypes = new Google_Service_YouTubeReporting_ReportTypes_Resource(
 197          $this,
 198          $this->serviceName,
 199          'reportTypes',
 200          array(
 201            'methods' => array(
 202              'list' => array(
 203                'path' => 'v1/reportTypes',
 204                'httpMethod' => 'GET',
 205                'parameters' => array(
 206                  'pageToken' => array(
 207                    'location' => 'query',
 208                    'type' => 'string',
 209                  ),
 210                  'onBehalfOfContentOwner' => array(
 211                    'location' => 'query',
 212                    'type' => 'string',
 213                  ),
 214                  'pageSize' => array(
 215                    'location' => 'query',
 216                    'type' => 'integer',
 217                  ),
 218                ),
 219              ),
 220            )
 221          )
 222      );
 223    }
 224  }
 225  
 226  
 227  /**
 228   * The "jobs" collection of methods.
 229   * Typical usage is:
 230   *  <code>
 231   *   $youtubereportingService = new Google_Service_YouTubeReporting(...);
 232   *   $jobs = $youtubereportingService->jobs;
 233   *  </code>
 234   */
 235  #[AllowDynamicProperties]
 236  class Google_Service_YouTubeReporting_Jobs_Resource extends Google_Service_Resource
 237  {
 238  
 239    /**
 240     * Creates a job and returns it. (jobs.create)
 241     *
 242     * @param Google_Job $postBody
 243     * @param array $optParams Optional parameters.
 244     *
 245     * @opt_param string onBehalfOfContentOwner The content owner's external ID on
 246     * which behalf the user is acting on. If not set, the user is acting for
 247     * himself (his own channel).
 248     * @return Google_Service_YouTubeReporting_Job
 249     */
 250    public function create(Google_Service_YouTubeReporting_Job $postBody, $optParams = array())
 251    {
 252      $params = array('postBody' => $postBody);
 253      $params = array_merge($params, $optParams);
 254      return $this->call('create', array($params), "Google_Service_YouTubeReporting_Job");
 255    }
 256  
 257    /**
 258     * Deletes a job. (jobs.delete)
 259     *
 260     * @param string $jobId The ID of the job to delete.
 261     * @param array $optParams Optional parameters.
 262     *
 263     * @opt_param string onBehalfOfContentOwner The content owner's external ID on
 264     * which behalf the user is acting on. If not set, the user is acting for
 265     * himself (his own channel).
 266     * @return Google_Service_YouTubeReporting_Empty
 267     */
 268    public function delete($jobId, $optParams = array())
 269    {
 270      $params = array('jobId' => $jobId);
 271      $params = array_merge($params, $optParams);
 272      return $this->call('delete', array($params), "Google_Service_YouTubeReporting_Empty");
 273    }
 274  
 275    /**
 276     * Gets a job. (jobs.get)
 277     *
 278     * @param string $jobId The ID of the job to retrieve.
 279     * @param array $optParams Optional parameters.
 280     *
 281     * @opt_param string onBehalfOfContentOwner The content owner's external ID on
 282     * which behalf the user is acting on. If not set, the user is acting for
 283     * himself (his own channel).
 284     * @return Google_Service_YouTubeReporting_Job
 285     */
 286    public function get($jobId, $optParams = array())
 287    {
 288      $params = array('jobId' => $jobId);
 289      $params = array_merge($params, $optParams);
 290      return $this->call('get', array($params), "Google_Service_YouTubeReporting_Job");
 291    }
 292  
 293    /**
 294     * Lists jobs. (jobs.listJobs)
 295     *
 296     * @param array $optParams Optional parameters.
 297     *
 298     * @opt_param string pageToken A token identifying a page of results the server
 299     * should return. Typically, this is the value of
 300     * ListReportTypesResponse.next_page_token returned in response to the previous
 301     * call to the `ListJobs` method.
 302     * @opt_param string onBehalfOfContentOwner The content owner's external ID on
 303     * which behalf the user is acting on. If not set, the user is acting for
 304     * himself (his own channel).
 305     * @opt_param int pageSize Requested page size. Server may return fewer jobs
 306     * than requested. If unspecified, server will pick an appropriate default.
 307     * @return Google_Service_YouTubeReporting_ListJobsResponse
 308     */
 309    public function listJobs($optParams = array())
 310    {
 311      $params = array();
 312      $params = array_merge($params, $optParams);
 313      return $this->call('list', array($params), "Google_Service_YouTubeReporting_ListJobsResponse");
 314    }
 315  }
 316  
 317  /**
 318   * The "reports" collection of methods.
 319   * Typical usage is:
 320   *  <code>
 321   *   $youtubereportingService = new Google_Service_YouTubeReporting(...);
 322   *   $reports = $youtubereportingService->reports;
 323   *  </code>
 324   */
 325  #[AllowDynamicProperties]
 326  class Google_Service_YouTubeReporting_JobsReports_Resource extends Google_Service_Resource
 327  {
 328  
 329    /**
 330     * Gets the metadata of a specific report. (reports.get)
 331     *
 332     * @param string $jobId The ID of the job.
 333     * @param string $reportId The ID of the report to retrieve.
 334     * @param array $optParams Optional parameters.
 335     *
 336     * @opt_param string onBehalfOfContentOwner The content owner's external ID on
 337     * which behalf the user is acting on. If not set, the user is acting for
 338     * himself (his own channel).
 339     * @return Google_Service_YouTubeReporting_Report
 340     */
 341    public function get($jobId, $reportId, $optParams = array())
 342    {
 343      $params = array('jobId' => $jobId, 'reportId' => $reportId);
 344      $params = array_merge($params, $optParams);
 345      return $this->call('get', array($params), "Google_Service_YouTubeReporting_Report");
 346    }
 347  
 348    /**
 349     * Lists reports created by a specific job. Returns NOT_FOUND if the job does
 350     * not exist. (reports.listJobsReports)
 351     *
 352     * @param string $jobId The ID of the job.
 353     * @param array $optParams Optional parameters.
 354     *
 355     * @opt_param string pageToken A token identifying a page of results the server
 356     * should return. Typically, this is the value of
 357     * ListReportsResponse.next_page_token returned in response to the previous call
 358     * to the `ListReports` method.
 359     * @opt_param string onBehalfOfContentOwner The content owner's external ID on
 360     * which behalf the user is acting on. If not set, the user is acting for
 361     * himself (his own channel).
 362     * @opt_param int pageSize Requested page size. Server may return fewer report
 363     * types than requested. If unspecified, server will pick an appropriate
 364     * default.
 365     * @return Google_Service_YouTubeReporting_ListReportsResponse
 366     */
 367    public function listJobsReports($jobId, $optParams = array())
 368    {
 369      $params = array('jobId' => $jobId);
 370      $params = array_merge($params, $optParams);
 371      return $this->call('list', array($params), "Google_Service_YouTubeReporting_ListReportsResponse");
 372    }
 373  }
 374  
 375  /**
 376   * The "media" collection of methods.
 377   * Typical usage is:
 378   *  <code>
 379   *   $youtubereportingService = new Google_Service_YouTubeReporting(...);
 380   *   $media = $youtubereportingService->media;
 381   *  </code>
 382   */
 383  #[AllowDynamicProperties]
 384  class Google_Service_YouTubeReporting_Media_Resource extends Google_Service_Resource
 385  {
 386  
 387    /**
 388     * Method for media download. Download is supported on the URI
 389     * `/v1/media/{+name}?alt=media`. (media.download)
 390     *
 391     * @param string $resourceName Name of the media that is being downloaded. See
 392     * [][ByteStream.ReadRequest.resource_name].
 393     * @param array $optParams Optional parameters.
 394     * @return Google_Service_YouTubeReporting_Media
 395     */
 396    public function download($resourceName, $optParams = array())
 397    {
 398      $params = array('resourceName' => $resourceName);
 399      $params = array_merge($params, $optParams);
 400      return $this->call('download', array($params), "Google_Service_YouTubeReporting_Media");
 401    }
 402  }
 403  
 404  /**
 405   * The "reportTypes" collection of methods.
 406   * Typical usage is:
 407   *  <code>
 408   *   $youtubereportingService = new Google_Service_YouTubeReporting(...);
 409   *   $reportTypes = $youtubereportingService->reportTypes;
 410   *  </code>
 411   */
 412  #[AllowDynamicProperties]
 413  class Google_Service_YouTubeReporting_ReportTypes_Resource extends Google_Service_Resource
 414  {
 415  
 416    /**
 417     * Lists report types. (reportTypes.listReportTypes)
 418     *
 419     * @param array $optParams Optional parameters.
 420     *
 421     * @opt_param string pageToken A token identifying a page of results the server
 422     * should return. Typically, this is the value of
 423     * ListReportTypesResponse.next_page_token returned in response to the previous
 424     * call to the `ListReportTypes` method.
 425     * @opt_param string onBehalfOfContentOwner The content owner's external ID on
 426     * which behalf the user is acting on. If not set, the user is acting for
 427     * himself (his own channel).
 428     * @opt_param int pageSize Requested page size. Server may return fewer report
 429     * types than requested. If unspecified, server will pick an appropriate
 430     * default.
 431     * @return Google_Service_YouTubeReporting_ListReportTypesResponse
 432     */
 433    public function listReportTypes($optParams = array())
 434    {
 435      $params = array();
 436      $params = array_merge($params, $optParams);
 437      return $this->call('list', array($params), "Google_Service_YouTubeReporting_ListReportTypesResponse");
 438    }
 439  }
 440  
 441  
 442  
 443  
 444  #[AllowDynamicProperties]
 445  class Google_Service_YouTubeReporting_Empty extends Google_Model
 446  {
 447  }
 448  
 449  #[AllowDynamicProperties]
 450  class Google_Service_YouTubeReporting_Job extends Google_Model
 451  {
 452    protected $internal_gapi_mappings = array(
 453    );
 454    public $createTime;
 455    public $id;
 456    public $name;
 457    public $reportTypeId;
 458  
 459  
 460    public function setCreateTime($createTime)
 461    {
 462      $this->createTime = $createTime;
 463    }
 464    public function getCreateTime()
 465    {
 466      return $this->createTime;
 467    }
 468    public function setId($id)
 469    {
 470      $this->id = $id;
 471    }
 472    public function getId()
 473    {
 474      return $this->id;
 475    }
 476    public function setName($name)
 477    {
 478      $this->name = $name;
 479    }
 480    public function getName()
 481    {
 482      return $this->name;
 483    }
 484    public function setReportTypeId($reportTypeId)
 485    {
 486      $this->reportTypeId = $reportTypeId;
 487    }
 488    public function getReportTypeId()
 489    {
 490      return $this->reportTypeId;
 491    }
 492  }
 493  
 494  #[AllowDynamicProperties]
 495  class Google_Service_YouTubeReporting_ListJobsResponse extends Google_Collection
 496  {
 497    protected $collection_key = 'jobs';
 498    protected $internal_gapi_mappings = array(
 499    );
 500    protected $jobsType = 'Google_Service_YouTubeReporting_Job';
 501    protected $jobsDataType = 'array';
 502    public $nextPageToken;
 503  
 504  
 505    public function setJobs($jobs)
 506    {
 507      $this->jobs = $jobs;
 508    }
 509    public function getJobs()
 510    {
 511      return $this->jobs;
 512    }
 513    public function setNextPageToken($nextPageToken)
 514    {
 515      $this->nextPageToken = $nextPageToken;
 516    }
 517    public function getNextPageToken()
 518    {
 519      return $this->nextPageToken;
 520    }
 521  }
 522  
 523  #[AllowDynamicProperties]
 524  class Google_Service_YouTubeReporting_ListReportTypesResponse extends Google_Collection
 525  {
 526    protected $collection_key = 'reportTypes';
 527    protected $internal_gapi_mappings = array(
 528    );
 529    public $nextPageToken;
 530    protected $reportTypesType = 'Google_Service_YouTubeReporting_ReportType';
 531    protected $reportTypesDataType = 'array';
 532  
 533  
 534    public function setNextPageToken($nextPageToken)
 535    {
 536      $this->nextPageToken = $nextPageToken;
 537    }
 538    public function getNextPageToken()
 539    {
 540      return $this->nextPageToken;
 541    }
 542    public function setReportTypes($reportTypes)
 543    {
 544      $this->reportTypes = $reportTypes;
 545    }
 546    public function getReportTypes()
 547    {
 548      return $this->reportTypes;
 549    }
 550  }
 551  
 552  #[AllowDynamicProperties]
 553  class Google_Service_YouTubeReporting_ListReportsResponse extends Google_Collection
 554  {
 555    protected $collection_key = 'reports';
 556    protected $internal_gapi_mappings = array(
 557    );
 558    public $nextPageToken;
 559    protected $reportsType = 'Google_Service_YouTubeReporting_Report';
 560    protected $reportsDataType = 'array';
 561  
 562  
 563    public function setNextPageToken($nextPageToken)
 564    {
 565      $this->nextPageToken = $nextPageToken;
 566    }
 567    public function getNextPageToken()
 568    {
 569      return $this->nextPageToken;
 570    }
 571    public function setReports($reports)
 572    {
 573      $this->reports = $reports;
 574    }
 575    public function getReports()
 576    {
 577      return $this->reports;
 578    }
 579  }
 580  
 581  #[AllowDynamicProperties]
 582  class Google_Service_YouTubeReporting_Media extends Google_Model
 583  {
 584    protected $internal_gapi_mappings = array(
 585    );
 586    public $resourceName;
 587  
 588  
 589    public function setResourceName($resourceName)
 590    {
 591      $this->resourceName = $resourceName;
 592    }
 593    public function getResourceName()
 594    {
 595      return $this->resourceName;
 596    }
 597  }
 598  
 599  #[AllowDynamicProperties]
 600  class Google_Service_YouTubeReporting_Report extends Google_Model
 601  {
 602    protected $internal_gapi_mappings = array(
 603    );
 604    public $createTime;
 605    public $downloadUrl;
 606    public $endTime;
 607    public $id;
 608    public $jobId;
 609    public $startTime;
 610  
 611  
 612    public function setCreateTime($createTime)
 613    {
 614      $this->createTime = $createTime;
 615    }
 616    public function getCreateTime()
 617    {
 618      return $this->createTime;
 619    }
 620    public function setDownloadUrl($downloadUrl)
 621    {
 622      $this->downloadUrl = $downloadUrl;
 623    }
 624    public function getDownloadUrl()
 625    {
 626      return $this->downloadUrl;
 627    }
 628    public function setEndTime($endTime)
 629    {
 630      $this->endTime = $endTime;
 631    }
 632    public function getEndTime()
 633    {
 634      return $this->endTime;
 635    }
 636    public function setId($id)
 637    {
 638      $this->id = $id;
 639    }
 640    public function getId()
 641    {
 642      return $this->id;
 643    }
 644    public function setJobId($jobId)
 645    {
 646      $this->jobId = $jobId;
 647    }
 648    public function getJobId()
 649    {
 650      return $this->jobId;
 651    }
 652    public function setStartTime($startTime)
 653    {
 654      $this->startTime = $startTime;
 655    }
 656    public function getStartTime()
 657    {
 658      return $this->startTime;
 659    }
 660  }
 661  
 662  #[AllowDynamicProperties]
 663  class Google_Service_YouTubeReporting_ReportType extends Google_Model
 664  {
 665    protected $internal_gapi_mappings = array(
 666    );
 667    public $id;
 668    public $name;
 669  
 670  
 671    public function setId($id)
 672    {
 673      $this->id = $id;
 674    }
 675    public function getId()
 676    {
 677      return $this->id;
 678    }
 679    public function setName($name)
 680    {
 681      $this->name = $name;
 682    }
 683    public function getName()
 684    {
 685      return $this->name;
 686    }
 687  }