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\UnsampledReport;
21use Google\Service\Analytics\UnsampledReports;
22
23/**
24 * The "unsampledReports" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $analyticsService = new Google\Service\Analytics(...);
28 *   $unsampledReports = $analyticsService->unsampledReports;
29 *  </code>
30 */
31class ManagementUnsampledReports extends \Google\Service\Resource
32{
33  /**
34   * Deletes an unsampled report. (unsampledReports.delete)
35   *
36   * @param string $accountId Account ID to delete the unsampled report for.
37   * @param string $webPropertyId Web property ID to delete the unsampled reports
38   * for.
39   * @param string $profileId View (Profile) ID to delete the unsampled report
40   * for.
41   * @param string $unsampledReportId ID of the unsampled report to be deleted.
42   * @param array $optParams Optional parameters.
43   */
44  public function delete($accountId, $webPropertyId, $profileId, $unsampledReportId, $optParams = [])
45  {
46    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'unsampledReportId' => $unsampledReportId];
47    $params = array_merge($params, $optParams);
48    return $this->call('delete', [$params]);
49  }
50  /**
51   * Returns a single unsampled report. (unsampledReports.get)
52   *
53   * @param string $accountId Account ID to retrieve unsampled report for.
54   * @param string $webPropertyId Web property ID to retrieve unsampled reports
55   * for.
56   * @param string $profileId View (Profile) ID to retrieve unsampled report for.
57   * @param string $unsampledReportId ID of the unsampled report to retrieve.
58   * @param array $optParams Optional parameters.
59   * @return UnsampledReport
60   */
61  public function get($accountId, $webPropertyId, $profileId, $unsampledReportId, $optParams = [])
62  {
63    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'unsampledReportId' => $unsampledReportId];
64    $params = array_merge($params, $optParams);
65    return $this->call('get', [$params], UnsampledReport::class);
66  }
67  /**
68   * Create a new unsampled report. (unsampledReports.insert)
69   *
70   * @param string $accountId Account ID to create the unsampled report for.
71   * @param string $webPropertyId Web property ID to create the unsampled report
72   * for.
73   * @param string $profileId View (Profile) ID to create the unsampled report
74   * for.
75   * @param UnsampledReport $postBody
76   * @param array $optParams Optional parameters.
77   * @return UnsampledReport
78   */
79  public function insert($accountId, $webPropertyId, $profileId, UnsampledReport $postBody, $optParams = [])
80  {
81    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId, 'postBody' => $postBody];
82    $params = array_merge($params, $optParams);
83    return $this->call('insert', [$params], UnsampledReport::class);
84  }
85  /**
86   * Lists unsampled reports to which the user has access.
87   * (unsampledReports.listManagementUnsampledReports)
88   *
89   * @param string $accountId Account ID to retrieve unsampled reports for. Must
90   * be a specific account ID, ~all is not supported.
91   * @param string $webPropertyId Web property ID to retrieve unsampled reports
92   * for. Must be a specific web property ID, ~all is not supported.
93   * @param string $profileId View (Profile) ID to retrieve unsampled reports for.
94   * Must be a specific view (profile) ID, ~all is not supported.
95   * @param array $optParams Optional parameters.
96   *
97   * @opt_param int max-results The maximum number of unsampled reports to include
98   * in this response.
99   * @opt_param int start-index An index of the first unsampled report to
100   * retrieve. Use this parameter as a pagination mechanism along with the max-
101   * results parameter.
102   * @return UnsampledReports
103   */
104  public function listManagementUnsampledReports($accountId, $webPropertyId, $profileId, $optParams = [])
105  {
106    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'profileId' => $profileId];
107    $params = array_merge($params, $optParams);
108    return $this->call('list', [$params], UnsampledReports::class);
109  }
110}
111
112// Adding a class alias for backwards compatibility with the previous class name.
113class_alias(ManagementUnsampledReports::class, 'Google_Service_Analytics_Resource_ManagementUnsampledReports');
114