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\Doubleclicksearch\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Doubleclicksearch\IdMappingFile;
|
---|
21 | use Google\Service\Doubleclicksearch\Report;
|
---|
22 | use Google\Service\Doubleclicksearch\ReportRequest;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "reports" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $doubleclicksearchService = new Google\Service\Doubleclicksearch(...);
|
---|
29 | * $reports = $doubleclicksearchService->reports;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class Reports extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Generates and returns a report immediately. (reports.generate)
|
---|
36 | *
|
---|
37 | * @param ReportRequest $postBody
|
---|
38 | * @param array $optParams Optional parameters.
|
---|
39 | * @return Report
|
---|
40 | * @throws \Google\Service\Exception
|
---|
41 | */
|
---|
42 | public function generate(ReportRequest $postBody, $optParams = [])
|
---|
43 | {
|
---|
44 | $params = ['postBody' => $postBody];
|
---|
45 | $params = array_merge($params, $optParams);
|
---|
46 | return $this->call('generate', [$params], Report::class);
|
---|
47 | }
|
---|
48 | /**
|
---|
49 | * Polls for the status of a report request. (reports.get)
|
---|
50 | *
|
---|
51 | * @param string $reportId ID of the report request being polled.
|
---|
52 | * @param array $optParams Optional parameters.
|
---|
53 | * @return Report
|
---|
54 | * @throws \Google\Service\Exception
|
---|
55 | */
|
---|
56 | public function get($reportId, $optParams = [])
|
---|
57 | {
|
---|
58 | $params = ['reportId' => $reportId];
|
---|
59 | $params = array_merge($params, $optParams);
|
---|
60 | return $this->call('get', [$params], Report::class);
|
---|
61 | }
|
---|
62 | /**
|
---|
63 | * Downloads a report file encoded in UTF-8. (reports.getFile)
|
---|
64 | *
|
---|
65 | * @param string $reportId ID of the report.
|
---|
66 | * @param int $reportFragment The index of the report fragment to download.
|
---|
67 | * @param array $optParams Optional parameters.
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function getFile($reportId, $reportFragment, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['reportId' => $reportId, 'reportFragment' => $reportFragment];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('getFile', [$params]);
|
---|
75 | }
|
---|
76 | /**
|
---|
77 | * Downloads a csv file(encoded in UTF-8) that contains ID mappings between
|
---|
78 | * legacy SA360 and new SA360. The file includes all children entities of the
|
---|
79 | * given advertiser(e.g. engine accounts, campaigns, ad groups, etc.) that exist
|
---|
80 | * in both legacy SA360 and new SA360. (reports.getIdMappingFile)
|
---|
81 | *
|
---|
82 | * @param string $agencyId Legacy SA360 agency ID.
|
---|
83 | * @param string $advertiserId Legacy SA360 advertiser ID.
|
---|
84 | * @param array $optParams Optional parameters.
|
---|
85 | * @return IdMappingFile
|
---|
86 | * @throws \Google\Service\Exception
|
---|
87 | */
|
---|
88 | public function getIdMappingFile($agencyId, $advertiserId, $optParams = [])
|
---|
89 | {
|
---|
90 | $params = ['agencyId' => $agencyId, 'advertiserId' => $advertiserId];
|
---|
91 | $params = array_merge($params, $optParams);
|
---|
92 | return $this->call('getIdMappingFile', [$params], IdMappingFile::class);
|
---|
93 | }
|
---|
94 | /**
|
---|
95 | * Inserts a report request into the reporting system. (reports.request)
|
---|
96 | *
|
---|
97 | * @param ReportRequest $postBody
|
---|
98 | * @param array $optParams Optional parameters.
|
---|
99 | * @return Report
|
---|
100 | * @throws \Google\Service\Exception
|
---|
101 | */
|
---|
102 | public function request(ReportRequest $postBody, $optParams = [])
|
---|
103 | {
|
---|
104 | $params = ['postBody' => $postBody];
|
---|
105 | $params = array_merge($params, $optParams);
|
---|
106 | return $this->call('request', [$params], Report::class);
|
---|
107 | }
|
---|
108 | }
|
---|
109 |
|
---|
110 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
111 | class_alias(Reports::class, 'Google_Service_Doubleclicksearch_Resource_Reports');
|
---|