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\Reports\Resource;
19
20use Google\Service\Reports\UsageReports;
21
22/**
23 * The "entityUsageReports" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $adminService = new Google\Service\Reports(...);
27 *   $entityUsageReports = $adminService->entityUsageReports;
28 *  </code>
29 */
30class EntityUsageReports extends \Google\Service\Resource
31{
32  /**
33   * Retrieves a report which is a collection of properties and statistics for
34   * entities used by users within the account. For more information, see the
35   * Entities Usage Report guide. For more information about the entities report's
36   * parameters, see the Entities Usage parameters reference guides.
37   * (entityUsageReports.get)
38   *
39   * @param string $entityType Represents the type of entity for the report.
40   * @param string $entityKey Represents the key of the object to filter the data
41   * with. It is a string which can take the value `all` to get activity events
42   * for all users, or any other value for an app-specific entity. For details on
43   * how to obtain the `entityKey` for a particular `entityType`, see the Entities
44   * Usage parameters reference guides.
45   * @param string $date Represents the date the usage occurred. The timestamp is
46   * in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time
47   * zone for this.
48   * @param array $optParams Optional parameters.
49   *
50   * @opt_param string customerId The unique ID of the customer to retrieve data
51   * for.
52   * @opt_param string filters The `filters` query string is a comma-separated
53   * list of an application's event parameters where the parameter's value is
54   * manipulated by a relational operator. The `filters` query string includes the
55   * name of the application whose usage is returned in the report. The
56   * application values for the Entities usage report include `accounts`, `docs`,
57   * and `gmail`. Filters are in the form `[application name]:parameter
58   * name[parameter value],...`. In this example, the `<>` 'not equal to' operator
59   * is URL-encoded in the request's query string (%3C%3E): GET https://www.google
60   * apis.com/admin/reports/v1/usage/gplus_communities/all/dates/2017-12-01
61   * ?parameters=gplus:community_name,gplus:num_total_members
62   * =gplus:num_total_members%3C%3E0 The relational operators include: - `==` -
63   * 'equal to'. - `<>` - 'not equal to'. It is URL-encoded (%3C%3E). - `<` -
64   * 'less than'. It is URL-encoded (%3C). - `<=` - 'less than or equal to'. It is
65   * URL-encoded (%3C=). - `>` - 'greater than'. It is URL-encoded (%3E). - `>=` -
66   * 'greater than or equal to'. It is URL-encoded (%3E=). Filters can only be
67   * applied to numeric parameters.
68   * @opt_param string maxResults Determines how many activity records are shown
69   * on each response page. For example, if the request sets `maxResults=1` and
70   * the report has two activities, the report has two pages. The response's
71   * `nextPageToken` property has the token to the second page.
72   * @opt_param string pageToken Token to specify next page. A report with
73   * multiple pages has a `nextPageToken` property in the response. In your
74   * follow-on request getting the next page of the report, enter the
75   * `nextPageToken` value in the `pageToken` query string.
76   * @opt_param string parameters The `parameters` query string is a comma-
77   * separated list of event parameters that refine a report's results. The
78   * parameter is associated with a specific application. The application values
79   * for the Entities usage report are only `gplus`. A `parameter` query string is
80   * in the CSV form of `[app_name1:param_name1], [app_name2:param_name2]...`.
81   * *Note:* The API doesn't accept multiple values of a parameter. If a
82   * particular parameter is supplied more than once in the API request, the API
83   * only accepts the last value of that request parameter. In addition, if an
84   * invalid request parameter is supplied in the API request, the API ignores
85   * that request parameter and returns the response corresponding to the
86   * remaining valid request parameters. An example of an invalid request
87   * parameter is one that does not belong to the application. If no parameters
88   * are requested, all parameters are returned.
89   * @return UsageReports
90   */
91  public function get($entityType, $entityKey, $date, $optParams = [])
92  {
93    $params = ['entityType' => $entityType, 'entityKey' => $entityKey, 'date' => $date];
94    $params = array_merge($params, $optParams);
95    return $this->call('get', [$params], UsageReports::class);
96  }
97}
98
99// Adding a class alias for backwards compatibility with the previous class name.
100class_alias(EntityUsageReports::class, 'Google_Service_Reports_Resource_EntityUsageReports');
101