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
18/**
19 * The "reports" collection of methods.
20 * Typical usage is:
21 *  <code>
22 *   $dfareportingService = new Google_Service_Dfareporting(...);
23 *   $reports = $dfareportingService->reports;
24 *  </code>
25 */
26class Google_Service_Dfareporting_Resource_Reports extends Google_Service_Resource
27{
28  /**
29   * Deletes a report by its ID. (reports.delete)
30   *
31   * @param string $profileId The DFA user profile ID.
32   * @param string $reportId The ID of the report.
33   * @param array $optParams Optional parameters.
34   */
35  public function delete($profileId, $reportId, $optParams = array())
36  {
37    $params = array('profileId' => $profileId, 'reportId' => $reportId);
38    $params = array_merge($params, $optParams);
39    return $this->call('delete', array($params));
40  }
41  /**
42   * Retrieves a report by its ID. (reports.get)
43   *
44   * @param string $profileId The DFA user profile ID.
45   * @param string $reportId The ID of the report.
46   * @param array $optParams Optional parameters.
47   * @return Google_Service_Dfareporting_Report
48   */
49  public function get($profileId, $reportId, $optParams = array())
50  {
51    $params = array('profileId' => $profileId, 'reportId' => $reportId);
52    $params = array_merge($params, $optParams);
53    return $this->call('get', array($params), "Google_Service_Dfareporting_Report");
54  }
55  /**
56   * Creates a report. (reports.insert)
57   *
58   * @param string $profileId The DFA user profile ID.
59   * @param Google_Service_Dfareporting_Report $postBody
60   * @param array $optParams Optional parameters.
61   * @return Google_Service_Dfareporting_Report
62   */
63  public function insert($profileId, Google_Service_Dfareporting_Report $postBody, $optParams = array())
64  {
65    $params = array('profileId' => $profileId, 'postBody' => $postBody);
66    $params = array_merge($params, $optParams);
67    return $this->call('insert', array($params), "Google_Service_Dfareporting_Report");
68  }
69  /**
70   * Retrieves list of reports. (reports.listReports)
71   *
72   * @param string $profileId The DFA user profile ID.
73   * @param array $optParams Optional parameters.
74   *
75   * @opt_param int maxResults Maximum number of results to return.
76   * @opt_param string pageToken The value of the nextToken from the previous
77   * result page.
78   * @opt_param string scope The scope that defines which results are returned.
79   * @opt_param string sortField The field by which to sort the list.
80   * @opt_param string sortOrder Order of sorted results.
81   * @return Google_Service_Dfareporting_ReportList
82   */
83  public function listReports($profileId, $optParams = array())
84  {
85    $params = array('profileId' => $profileId);
86    $params = array_merge($params, $optParams);
87    return $this->call('list', array($params), "Google_Service_Dfareporting_ReportList");
88  }
89  /**
90   * Updates a report. This method supports patch semantics. (reports.patch)
91   *
92   * @param string $profileId The DFA user profile ID.
93   * @param string $reportId The ID of the report.
94   * @param Google_Service_Dfareporting_Report $postBody
95   * @param array $optParams Optional parameters.
96   * @return Google_Service_Dfareporting_Report
97   */
98  public function patch($profileId, $reportId, Google_Service_Dfareporting_Report $postBody, $optParams = array())
99  {
100    $params = array('profileId' => $profileId, 'reportId' => $reportId, 'postBody' => $postBody);
101    $params = array_merge($params, $optParams);
102    return $this->call('patch', array($params), "Google_Service_Dfareporting_Report");
103  }
104  /**
105   * Runs a report. (reports.run)
106   *
107   * @param string $profileId The DFA profile ID.
108   * @param string $reportId The ID of the report.
109   * @param array $optParams Optional parameters.
110   *
111   * @opt_param bool synchronous If set and true, tries to run the report
112   * synchronously.
113   * @return Google_Service_Dfareporting_DfareportingFile
114   */
115  public function run($profileId, $reportId, $optParams = array())
116  {
117    $params = array('profileId' => $profileId, 'reportId' => $reportId);
118    $params = array_merge($params, $optParams);
119    return $this->call('run', array($params), "Google_Service_Dfareporting_DfareportingFile");
120  }
121  /**
122   * Updates a report. (reports.update)
123   *
124   * @param string $profileId The DFA user profile ID.
125   * @param string $reportId The ID of the report.
126   * @param Google_Service_Dfareporting_Report $postBody
127   * @param array $optParams Optional parameters.
128   * @return Google_Service_Dfareporting_Report
129   */
130  public function update($profileId, $reportId, Google_Service_Dfareporting_Report $postBody, $optParams = array())
131  {
132    $params = array('profileId' => $profileId, 'reportId' => $reportId, 'postBody' => $postBody);
133    $params = array_merge($params, $optParams);
134    return $this->call('update', array($params), "Google_Service_Dfareporting_Report");
135  }
136}
137