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\CloudSearch\Resource;
19
20use Google\Service\CloudSearch\GetCustomerIndexStatsResponse;
21use Google\Service\CloudSearch\GetCustomerQueryStatsResponse;
22use Google\Service\CloudSearch\GetCustomerSearchApplicationStatsResponse;
23use Google\Service\CloudSearch\GetCustomerSessionStatsResponse;
24use Google\Service\CloudSearch\GetCustomerUserStatsResponse;
25
26/**
27 * The "stats" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $cloudsearchService = new Google\Service\CloudSearch(...);
31 *   $stats = $cloudsearchService->stats;
32 *  </code>
33 */
34class Stats extends \Google\Service\Resource
35{
36  /**
37   * Gets indexed item statistics aggreggated across all data sources. This API
38   * only returns statistics for previous dates; it doesn't return statistics for
39   * the current day. **Note:** This API requires a standard end user account to
40   * execute. (stats.getIndex)
41   *
42   * @param array $optParams Optional parameters.
43   *
44   * @opt_param int fromDate.day Day of month. Must be from 1 to 31 and valid for
45   * the year and month.
46   * @opt_param int fromDate.month Month of date. Must be from 1 to 12.
47   * @opt_param int fromDate.year Year of date. Must be from 1 to 9999.
48   * @opt_param int toDate.day Day of month. Must be from 1 to 31 and valid for
49   * the year and month.
50   * @opt_param int toDate.month Month of date. Must be from 1 to 12.
51   * @opt_param int toDate.year Year of date. Must be from 1 to 9999.
52   * @return GetCustomerIndexStatsResponse
53   */
54  public function getIndex($optParams = [])
55  {
56    $params = [];
57    $params = array_merge($params, $optParams);
58    return $this->call('getIndex', [$params], GetCustomerIndexStatsResponse::class);
59  }
60  /**
61   * Get the query statistics for customer. **Note:** This API requires a standard
62   * end user account to execute. (stats.getQuery)
63   *
64   * @param array $optParams Optional parameters.
65   *
66   * @opt_param int fromDate.day Day of month. Must be from 1 to 31 and valid for
67   * the year and month.
68   * @opt_param int fromDate.month Month of date. Must be from 1 to 12.
69   * @opt_param int fromDate.year Year of date. Must be from 1 to 9999.
70   * @opt_param int toDate.day Day of month. Must be from 1 to 31 and valid for
71   * the year and month.
72   * @opt_param int toDate.month Month of date. Must be from 1 to 12.
73   * @opt_param int toDate.year Year of date. Must be from 1 to 9999.
74   * @return GetCustomerQueryStatsResponse
75   */
76  public function getQuery($optParams = [])
77  {
78    $params = [];
79    $params = array_merge($params, $optParams);
80    return $this->call('getQuery', [$params], GetCustomerQueryStatsResponse::class);
81  }
82  /**
83   * Get search application stats for customer. **Note:** This API requires a
84   * standard end user account to execute. (stats.getSearchapplication)
85   *
86   * @param array $optParams Optional parameters.
87   *
88   * @opt_param int endDate.day Day of month. Must be from 1 to 31 and valid for
89   * the year and month.
90   * @opt_param int endDate.month Month of date. Must be from 1 to 12.
91   * @opt_param int endDate.year Year of date. Must be from 1 to 9999.
92   * @opt_param int startDate.day Day of month. Must be from 1 to 31 and valid for
93   * the year and month.
94   * @opt_param int startDate.month Month of date. Must be from 1 to 12.
95   * @opt_param int startDate.year Year of date. Must be from 1 to 9999.
96   * @return GetCustomerSearchApplicationStatsResponse
97   */
98  public function getSearchapplication($optParams = [])
99  {
100    $params = [];
101    $params = array_merge($params, $optParams);
102    return $this->call('getSearchapplication', [$params], GetCustomerSearchApplicationStatsResponse::class);
103  }
104  /**
105   * Get the # of search sessions, % of successful sessions with a click query
106   * statistics for customer. **Note:** This API requires a standard end user
107   * account to execute. (stats.getSession)
108   *
109   * @param array $optParams Optional parameters.
110   *
111   * @opt_param int fromDate.day Day of month. Must be from 1 to 31 and valid for
112   * the year and month.
113   * @opt_param int fromDate.month Month of date. Must be from 1 to 12.
114   * @opt_param int fromDate.year Year of date. Must be from 1 to 9999.
115   * @opt_param int toDate.day Day of month. Must be from 1 to 31 and valid for
116   * the year and month.
117   * @opt_param int toDate.month Month of date. Must be from 1 to 12.
118   * @opt_param int toDate.year Year of date. Must be from 1 to 9999.
119   * @return GetCustomerSessionStatsResponse
120   */
121  public function getSession($optParams = [])
122  {
123    $params = [];
124    $params = array_merge($params, $optParams);
125    return $this->call('getSession', [$params], GetCustomerSessionStatsResponse::class);
126  }
127  /**
128   * Get the users statistics for customer. **Note:** This API requires a standard
129   * end user account to execute. (stats.getUser)
130   *
131   * @param array $optParams Optional parameters.
132   *
133   * @opt_param int fromDate.day Day of month. Must be from 1 to 31 and valid for
134   * the year and month.
135   * @opt_param int fromDate.month Month of date. Must be from 1 to 12.
136   * @opt_param int fromDate.year Year of date. Must be from 1 to 9999.
137   * @opt_param int toDate.day Day of month. Must be from 1 to 31 and valid for
138   * the year and month.
139   * @opt_param int toDate.month Month of date. Must be from 1 to 12.
140   * @opt_param int toDate.year Year of date. Must be from 1 to 9999.
141   * @return GetCustomerUserStatsResponse
142   */
143  public function getUser($optParams = [])
144  {
145    $params = [];
146    $params = array_merge($params, $optParams);
147    return $this->call('getUser', [$params], GetCustomerUserStatsResponse::class);
148  }
149}
150
151// Adding a class alias for backwards compatibility with the previous class name.
152class_alias(Stats::class, 'Google_Service_CloudSearch_Resource_Stats');
153