1<?php
2/*
3 * Copyright 2014 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
18namespace Google\Service\Analytics\Resource;
19
20use Google\Service\Analytics\RealtimeData;
21
22/**
23 * The "realtime" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $analyticsService = new Google\Service\Analytics(...);
27 *   $realtime = $analyticsService->realtime;
28 *  </code>
29 */
30class DataRealtime extends \Google\Service\Resource
31{
32  /**
33   * Returns real time data for a view (profile). (realtime.get)
34   *
35   * @param string $ids Unique table ID for retrieving real time data. Table ID is
36   * of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.
37   * @param string $metrics A comma-separated list of real time metrics. E.g.,
38   * 'rt:activeUsers'. At least one metric must be specified.
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param string dimensions A comma-separated list of real time dimensions.
42   * E.g., 'rt:medium,rt:city'.
43   * @opt_param string filters A comma-separated list of dimension or metric
44   * filters to be applied to real time data.
45   * @opt_param int max-results The maximum number of entries to include in this
46   * feed.
47   * @opt_param string sort A comma-separated list of dimensions or metrics that
48   * determine the sort order for real time data.
49   * @return RealtimeData
50   */
51  public function get($ids, $metrics, $optParams = [])
52  {
53    $params = ['ids' => $ids, 'metrics' => $metrics];
54    $params = array_merge($params, $optParams);
55    return $this->call('get', [$params], RealtimeData::class);
56  }
57}
58
59// Adding a class alias for backwards compatibility with the previous class name.
60class_alias(DataRealtime::class, 'Google_Service_Analytics_Resource_DataRealtime');
61