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