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\AnalyticsDataimportDeleteUploadDataRequest;
21use Google\Service\Analytics\Upload;
22use Google\Service\Analytics\Uploads;
23
24/**
25 * The "uploads" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $analyticsService = new Google\Service\Analytics(...);
29 *   $uploads = $analyticsService->uploads;
30 *  </code>
31 */
32class ManagementUploads extends \Google\Service\Resource
33{
34  /**
35   * Delete data associated with a previous upload. (uploads.deleteUploadData)
36   *
37   * @param string $accountId Account Id for the uploads to be deleted.
38   * @param string $webPropertyId Web property Id for the uploads to be deleted.
39   * @param string $customDataSourceId Custom data source Id for the uploads to be
40   * deleted.
41   * @param AnalyticsDataimportDeleteUploadDataRequest $postBody
42   * @param array $optParams Optional parameters.
43   */
44  public function deleteUploadData($accountId, $webPropertyId, $customDataSourceId, AnalyticsDataimportDeleteUploadDataRequest $postBody, $optParams = [])
45  {
46    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'postBody' => $postBody];
47    $params = array_merge($params, $optParams);
48    return $this->call('deleteUploadData', [$params]);
49  }
50  /**
51   * List uploads to which the user has access. (uploads.get)
52   *
53   * @param string $accountId Account Id for the upload to retrieve.
54   * @param string $webPropertyId Web property Id for the upload to retrieve.
55   * @param string $customDataSourceId Custom data source Id for upload to
56   * retrieve.
57   * @param string $uploadId Upload Id to retrieve.
58   * @param array $optParams Optional parameters.
59   * @return Upload
60   */
61  public function get($accountId, $webPropertyId, $customDataSourceId, $uploadId, $optParams = [])
62  {
63    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId, 'uploadId' => $uploadId];
64    $params = array_merge($params, $optParams);
65    return $this->call('get', [$params], Upload::class);
66  }
67  /**
68   * List uploads to which the user has access. (uploads.listManagementUploads)
69   *
70   * @param string $accountId Account Id for the uploads to retrieve.
71   * @param string $webPropertyId Web property Id for the uploads to retrieve.
72   * @param string $customDataSourceId Custom data source Id for uploads to
73   * retrieve.
74   * @param array $optParams Optional parameters.
75   *
76   * @opt_param int max-results The maximum number of uploads to include in this
77   * response.
78   * @opt_param int start-index A 1-based index of the first upload to retrieve.
79   * Use this parameter as a pagination mechanism along with the max-results
80   * parameter.
81   * @return Uploads
82   */
83  public function listManagementUploads($accountId, $webPropertyId, $customDataSourceId, $optParams = [])
84  {
85    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId];
86    $params = array_merge($params, $optParams);
87    return $this->call('list', [$params], Uploads::class);
88  }
89  /**
90   * Upload data for a custom data source. (uploads.uploadData)
91   *
92   * @param string $accountId Account Id associated with the upload.
93   * @param string $webPropertyId Web property UA-string associated with the
94   * upload.
95   * @param string $customDataSourceId Custom data source Id to which the data
96   * being uploaded belongs.
97   * @param array $optParams Optional parameters.
98   * @return Upload
99   */
100  public function uploadData($accountId, $webPropertyId, $customDataSourceId, $optParams = [])
101  {
102    $params = ['accountId' => $accountId, 'webPropertyId' => $webPropertyId, 'customDataSourceId' => $customDataSourceId];
103    $params = array_merge($params, $optParams);
104    return $this->call('uploadData', [$params], Upload::class);
105  }
106}
107
108// Adding a class alias for backwards compatibility with the previous class name.
109class_alias(ManagementUploads::class, 'Google_Service_Analytics_Resource_ManagementUploads');
110