[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/lib/google/Google/Service/ -> YouTubeAnalytics.php (source)

   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 YouTubeAnalytics (v1).
  20   *
  21   * <p>
  22   * Retrieve your YouTube Analytics reports.
  23   * </p>
  24   *
  25   * <p>
  26   * For more information about this service, see the API
  27   * <a href="http://developers.google.com/youtube/analytics/" target="_blank">Documentation</a>
  28   * </p>
  29   *
  30   * @author Google, Inc.
  31   */
  32  class Google_Service_YouTubeAnalytics extends Google_Service
  33  {
  34    /** View YouTube Analytics monetary reports for your YouTube content. */
  35    const YT_ANALYTICS_MONETARY_READONLY = "https://www.googleapis.com/auth/yt-analytics-monetary.readonly";
  36    /** View YouTube Analytics reports for your YouTube content. */
  37    const YT_ANALYTICS_READONLY = "https://www.googleapis.com/auth/yt-analytics.readonly";
  38  
  39    public $batchReportDefinitions;
  40    public $batchReports;
  41    public $reports;
  42    
  43  
  44    /**
  45     * Constructs the internal representation of the YouTubeAnalytics service.
  46     *
  47     * @param Google_Client $client
  48     */
  49    public function __construct(Google_Client $client)
  50    {
  51      parent::__construct($client);
  52      $this->servicePath = 'youtube/analytics/v1/';
  53      $this->version = 'v1';
  54      $this->serviceName = 'youtubeAnalytics';
  55  
  56      $this->batchReportDefinitions = new Google_Service_YouTubeAnalytics_BatchReportDefinitions_Resource(
  57          $this,
  58          $this->serviceName,
  59          'batchReportDefinitions',
  60          array(
  61            'methods' => array(
  62              'list' => array(
  63                'path' => 'batchReportDefinitions',
  64                'httpMethod' => 'GET',
  65                'parameters' => array(
  66                  'onBehalfOfContentOwner' => array(
  67                    'location' => 'query',
  68                    'type' => 'string',
  69                    'required' => true,
  70                  ),
  71                ),
  72              ),
  73            )
  74          )
  75      );
  76      $this->batchReports = new Google_Service_YouTubeAnalytics_BatchReports_Resource(
  77          $this,
  78          $this->serviceName,
  79          'batchReports',
  80          array(
  81            'methods' => array(
  82              'list' => array(
  83                'path' => 'batchReports',
  84                'httpMethod' => 'GET',
  85                'parameters' => array(
  86                  'batchReportDefinitionId' => array(
  87                    'location' => 'query',
  88                    'type' => 'string',
  89                    'required' => true,
  90                  ),
  91                  'onBehalfOfContentOwner' => array(
  92                    'location' => 'query',
  93                    'type' => 'string',
  94                    'required' => true,
  95                  ),
  96                ),
  97              ),
  98            )
  99          )
 100      );
 101      $this->reports = new Google_Service_YouTubeAnalytics_Reports_Resource(
 102          $this,
 103          $this->serviceName,
 104          'reports',
 105          array(
 106            'methods' => array(
 107              'query' => array(
 108                'path' => 'reports',
 109                'httpMethod' => 'GET',
 110                'parameters' => array(
 111                  'ids' => array(
 112                    'location' => 'query',
 113                    'type' => 'string',
 114                    'required' => true,
 115                  ),
 116                  'start-date' => array(
 117                    'location' => 'query',
 118                    'type' => 'string',
 119                    'required' => true,
 120                  ),
 121                  'end-date' => array(
 122                    'location' => 'query',
 123                    'type' => 'string',
 124                    'required' => true,
 125                  ),
 126                  'metrics' => array(
 127                    'location' => 'query',
 128                    'type' => 'string',
 129                    'required' => true,
 130                  ),
 131                  'max-results' => array(
 132                    'location' => 'query',
 133                    'type' => 'integer',
 134                  ),
 135                  'sort' => array(
 136                    'location' => 'query',
 137                    'type' => 'string',
 138                  ),
 139                  'dimensions' => array(
 140                    'location' => 'query',
 141                    'type' => 'string',
 142                  ),
 143                  'start-index' => array(
 144                    'location' => 'query',
 145                    'type' => 'integer',
 146                  ),
 147                  'filters' => array(
 148                    'location' => 'query',
 149                    'type' => 'string',
 150                  ),
 151                ),
 152              ),
 153            )
 154          )
 155      );
 156    }
 157  }
 158  
 159  
 160  /**
 161   * The "batchReportDefinitions" collection of methods.
 162   * Typical usage is:
 163   *  <code>
 164   *   $youtubeAnalyticsService = new Google_Service_YouTubeAnalytics(...);
 165   *   $batchReportDefinitions = $youtubeAnalyticsService->batchReportDefinitions;
 166   *  </code>
 167   */
 168  class Google_Service_YouTubeAnalytics_BatchReportDefinitions_Resource extends Google_Service_Resource
 169  {
 170  
 171    /**
 172     * Retrieves a list of available batch report definitions.
 173     * (batchReportDefinitions.listBatchReportDefinitions)
 174     *
 175     * @param string $onBehalfOfContentOwner
 176     * The onBehalfOfContentOwner parameter identifies the content owner that the user is acting on
 177      * behalf of.
 178     * @param array $optParams Optional parameters.
 179     * @return Google_Service_YouTubeAnalytics_BatchReportDefinitionList
 180     */
 181    public function listBatchReportDefinitions($onBehalfOfContentOwner, $optParams = array())
 182    {
 183      $params = array('onBehalfOfContentOwner' => $onBehalfOfContentOwner);
 184      $params = array_merge($params, $optParams);
 185      return $this->call('list', array($params), "Google_Service_YouTubeAnalytics_BatchReportDefinitionList");
 186    }
 187  }
 188  
 189  /**
 190   * The "batchReports" collection of methods.
 191   * Typical usage is:
 192   *  <code>
 193   *   $youtubeAnalyticsService = new Google_Service_YouTubeAnalytics(...);
 194   *   $batchReports = $youtubeAnalyticsService->batchReports;
 195   *  </code>
 196   */
 197  class Google_Service_YouTubeAnalytics_BatchReports_Resource extends Google_Service_Resource
 198  {
 199  
 200    /**
 201     * Retrieves a list of processed batch reports. (batchReports.listBatchReports)
 202     *
 203     * @param string $batchReportDefinitionId
 204     * The batchReportDefinitionId parameter specifies the ID of the batch reportort definition for
 205      * which you are retrieving reports.
 206     * @param string $onBehalfOfContentOwner
 207     * The onBehalfOfContentOwner parameter identifies the content owner that the user is acting on
 208      * behalf of.
 209     * @param array $optParams Optional parameters.
 210     * @return Google_Service_YouTubeAnalytics_BatchReportList
 211     */
 212    public function listBatchReports($batchReportDefinitionId, $onBehalfOfContentOwner, $optParams = array())
 213    {
 214      $params = array('batchReportDefinitionId' => $batchReportDefinitionId, 'onBehalfOfContentOwner' => $onBehalfOfContentOwner);
 215      $params = array_merge($params, $optParams);
 216      return $this->call('list', array($params), "Google_Service_YouTubeAnalytics_BatchReportList");
 217    }
 218  }
 219  
 220  /**
 221   * The "reports" collection of methods.
 222   * Typical usage is:
 223   *  <code>
 224   *   $youtubeAnalyticsService = new Google_Service_YouTubeAnalytics(...);
 225   *   $reports = $youtubeAnalyticsService->reports;
 226   *  </code>
 227   */
 228  class Google_Service_YouTubeAnalytics_Reports_Resource extends Google_Service_Resource
 229  {
 230  
 231    /**
 232     * Retrieve your YouTube Analytics reports. (reports.query)
 233     *
 234     * @param string $ids
 235     * Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics
 236      * data.
 237    - To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID,
 238      * where CHANNEL_ID specifies the unique YouTube channel ID.
 239    - To request data for a YouTube CMS
 240      * content owner, set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the
 241      * CMS name of the content owner.
 242     * @param string $startDate
 243     * The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.
 244     * @param string $endDate
 245     * The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.
 246     * @param string $metrics
 247     * A comma-separated list of YouTube Analytics metrics, such as views or likes,dislikes. See the
 248      * Available Reports document for a list of the reports that you can retrieve and the metrics
 249      * available in each report, and see the Metrics document for definitions of those metrics.
 250     * @param array $optParams Optional parameters.
 251     *
 252     * @opt_param int max-results
 253     * The maximum number of rows to include in the response.
 254     * @opt_param string sort
 255     * A comma-separated list of dimensions or metrics that determine the sort order for YouTube
 256      * Analytics data. By default the sort order is ascending. The '-' prefix causes descending sort
 257      * order.
 258     * @opt_param string dimensions
 259     * A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See
 260      * the Available Reports document for a list of the reports that you can retrieve and the
 261      * dimensions used for those reports. Also see the Dimensions document for definitions of those
 262      * dimensions.
 263     * @opt_param int start-index
 264     * An index of the first entity to retrieve. Use this parameter as a pagination mechanism along
 265      * with the max-results parameter (one-based, inclusive).
 266     * @opt_param string filters
 267     * A list of filters that should be applied when retrieving YouTube Analytics data. The Available
 268      * Reports document identifies the dimensions that can be used to filter each report, and the
 269      * Dimensions document defines those dimensions. If a request uses multiple filters, join them
 270      * together with a semicolon (;), and the returned result table will satisfy both filters. For
 271      * example, a filters parameter value of video==dMH0bHeiRNg;country==IT restricts the result set to
 272      * include data for the given video in Italy.
 273     * @return Google_Service_YouTubeAnalytics_ResultTable
 274     */
 275    public function query($ids, $startDate, $endDate, $metrics, $optParams = array())
 276    {
 277      $params = array('ids' => $ids, 'start-date' => $startDate, 'end-date' => $endDate, 'metrics' => $metrics);
 278      $params = array_merge($params, $optParams);
 279      return $this->call('query', array($params), "Google_Service_YouTubeAnalytics_ResultTable");
 280    }
 281  }
 282  
 283  
 284  
 285  
 286  class Google_Service_YouTubeAnalytics_BatchReportDefinitionList extends Google_Collection
 287  {
 288    protected $collection_key = 'items';
 289    protected $itemsType = 'Google_Service_YouTubeAnalytics_BatchReportDefinitionTemplate';
 290    protected $itemsDataType = 'array';
 291    public $kind;
 292  
 293    public function setItems($items)
 294    {
 295      $this->items = $items;
 296    }
 297  
 298    public function getItems()
 299    {
 300      return $this->items;
 301    }
 302  
 303    public function setKind($kind)
 304    {
 305      $this->kind = $kind;
 306    }
 307  
 308    public function getKind()
 309    {
 310      return $this->kind;
 311    }
 312  }
 313  
 314  class Google_Service_YouTubeAnalytics_BatchReportDefinitionTemplate extends Google_Collection
 315  {
 316    protected $collection_key = 'defaultOutput';
 317    protected $defaultOutputType = 'Google_Service_YouTubeAnalytics_BatchReportDefinitionTemplateDefaultOutput';
 318    protected $defaultOutputDataType = 'array';
 319    public $id;
 320    public $name;
 321    public $status;
 322    public $type;
 323  
 324    public function setDefaultOutput($defaultOutput)
 325    {
 326      $this->defaultOutput = $defaultOutput;
 327    }
 328  
 329    public function getDefaultOutput()
 330    {
 331      return $this->defaultOutput;
 332    }
 333  
 334    public function setId($id)
 335    {
 336      $this->id = $id;
 337    }
 338  
 339    public function getId()
 340    {
 341      return $this->id;
 342    }
 343  
 344    public function setName($name)
 345    {
 346      $this->name = $name;
 347    }
 348  
 349    public function getName()
 350    {
 351      return $this->name;
 352    }
 353  
 354    public function setStatus($status)
 355    {
 356      $this->status = $status;
 357    }
 358  
 359    public function getStatus()
 360    {
 361      return $this->status;
 362    }
 363  
 364    public function setType($type)
 365    {
 366      $this->type = $type;
 367    }
 368  
 369    public function getType()
 370    {
 371      return $this->type;
 372    }
 373  }
 374  
 375  class Google_Service_YouTubeAnalytics_BatchReportDefinitionTemplateDefaultOutput extends Google_Model
 376  {
 377    public $format;
 378    public $type;
 379  
 380    public function setFormat($format)
 381    {
 382      $this->format = $format;
 383    }
 384  
 385    public function getFormat()
 386    {
 387      return $this->format;
 388    }
 389  
 390    public function setType($type)
 391    {
 392      $this->type = $type;
 393    }
 394  
 395    public function getType()
 396    {
 397      return $this->type;
 398    }
 399  }
 400  
 401  class Google_Service_YouTubeAnalytics_BatchReportList extends Google_Collection
 402  {
 403    protected $collection_key = 'items';
 404    protected $itemsType = 'Google_Service_YouTubeAnalytics_BatchReportTemplate';
 405    protected $itemsDataType = 'array';
 406    public $kind;
 407  
 408    public function setItems($items)
 409    {
 410      $this->items = $items;
 411    }
 412  
 413    public function getItems()
 414    {
 415      return $this->items;
 416    }
 417  
 418    public function setKind($kind)
 419    {
 420      $this->kind = $kind;
 421    }
 422  
 423    public function getKind()
 424    {
 425      return $this->kind;
 426    }
 427  }
 428  
 429  class Google_Service_YouTubeAnalytics_BatchReportTemplate extends Google_Collection
 430  {
 431    protected $collection_key = 'outputs';
 432    public $id;
 433    protected $outputsType = 'Google_Service_YouTubeAnalytics_BatchReportTemplateOutputs';
 434    protected $outputsDataType = 'array';
 435    public $reportId;
 436    protected $timeSpanType = 'Google_Service_YouTubeAnalytics_BatchReportTemplateTimeSpan';
 437    protected $timeSpanDataType = '';
 438    public $timeUpdated;
 439  
 440    public function setId($id)
 441    {
 442      $this->id = $id;
 443    }
 444  
 445    public function getId()
 446    {
 447      return $this->id;
 448    }
 449  
 450    public function setOutputs($outputs)
 451    {
 452      $this->outputs = $outputs;
 453    }
 454  
 455    public function getOutputs()
 456    {
 457      return $this->outputs;
 458    }
 459  
 460    public function setReportId($reportId)
 461    {
 462      $this->reportId = $reportId;
 463    }
 464  
 465    public function getReportId()
 466    {
 467      return $this->reportId;
 468    }
 469  
 470    public function setTimeSpan(Google_Service_YouTubeAnalytics_BatchReportTemplateTimeSpan $timeSpan)
 471    {
 472      $this->timeSpan = $timeSpan;
 473    }
 474  
 475    public function getTimeSpan()
 476    {
 477      return $this->timeSpan;
 478    }
 479  
 480    public function setTimeUpdated($timeUpdated)
 481    {
 482      $this->timeUpdated = $timeUpdated;
 483    }
 484  
 485    public function getTimeUpdated()
 486    {
 487      return $this->timeUpdated;
 488    }
 489  }
 490  
 491  class Google_Service_YouTubeAnalytics_BatchReportTemplateOutputs extends Google_Model
 492  {
 493    public $downloadUrl;
 494    public $format;
 495    public $type;
 496  
 497    public function setDownloadUrl($downloadUrl)
 498    {
 499      $this->downloadUrl = $downloadUrl;
 500    }
 501  
 502    public function getDownloadUrl()
 503    {
 504      return $this->downloadUrl;
 505    }
 506  
 507    public function setFormat($format)
 508    {
 509      $this->format = $format;
 510    }
 511  
 512    public function getFormat()
 513    {
 514      return $this->format;
 515    }
 516  
 517    public function setType($type)
 518    {
 519      $this->type = $type;
 520    }
 521  
 522    public function getType()
 523    {
 524      return $this->type;
 525    }
 526  }
 527  
 528  class Google_Service_YouTubeAnalytics_BatchReportTemplateTimeSpan extends Google_Model
 529  {
 530    public $endTime;
 531    public $startTime;
 532  
 533    public function setEndTime($endTime)
 534    {
 535      $this->endTime = $endTime;
 536    }
 537  
 538    public function getEndTime()
 539    {
 540      return $this->endTime;
 541    }
 542  
 543    public function setStartTime($startTime)
 544    {
 545      $this->startTime = $startTime;
 546    }
 547  
 548    public function getStartTime()
 549    {
 550      return $this->startTime;
 551    }
 552  }
 553  
 554  class Google_Service_YouTubeAnalytics_ResultTable extends Google_Collection
 555  {
 556    protected $collection_key = 'rows';
 557    protected $columnHeadersType = 'Google_Service_YouTubeAnalytics_ResultTableColumnHeaders';
 558    protected $columnHeadersDataType = 'array';
 559    public $kind;
 560    public $rows;
 561  
 562    public function setColumnHeaders($columnHeaders)
 563    {
 564      $this->columnHeaders = $columnHeaders;
 565    }
 566  
 567    public function getColumnHeaders()
 568    {
 569      return $this->columnHeaders;
 570    }
 571  
 572    public function setKind($kind)
 573    {
 574      $this->kind = $kind;
 575    }
 576  
 577    public function getKind()
 578    {
 579      return $this->kind;
 580    }
 581  
 582    public function setRows($rows)
 583    {
 584      $this->rows = $rows;
 585    }
 586  
 587    public function getRows()
 588    {
 589      return $this->rows;
 590    }
 591  }
 592  
 593  class Google_Service_YouTubeAnalytics_ResultTableColumnHeaders extends Google_Model
 594  {
 595    public $columnType;
 596    public $dataType;
 597    public $name;
 598  
 599    public function setColumnType($columnType)
 600    {
 601      $this->columnType = $columnType;
 602    }
 603  
 604    public function getColumnType()
 605    {
 606      return $this->columnType;
 607    }
 608  
 609    public function setDataType($dataType)
 610    {
 611      $this->dataType = $dataType;
 612    }
 613  
 614    public function getDataType()
 615    {
 616      return $this->dataType;
 617    }
 618  
 619    public function setName($name)
 620    {
 621      $this->name = $name;
 622    }
 623  
 624    public function getName()
 625    {
 626      return $this->name;
 627    }
 628  }


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1