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\DoubleClickBidManager\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DoubleClickBidManager\ListQueriesResponse;
|
---|
21 | use Google\Service\DoubleClickBidManager\Query;
|
---|
22 | use Google\Service\DoubleClickBidManager\Report;
|
---|
23 | use Google\Service\DoubleClickBidManager\RunQueryRequest;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "queries" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $doubleclickbidmanagerService = new Google\Service\DoubleClickBidManager(...);
|
---|
30 | * $queries = $doubleclickbidmanagerService->queries;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class Queries extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Creates a new query. (queries.create)
|
---|
37 | *
|
---|
38 | * @param Query $postBody
|
---|
39 | * @param array $optParams Optional parameters.
|
---|
40 | * @return Query
|
---|
41 | * @throws \Google\Service\Exception
|
---|
42 | */
|
---|
43 | public function create(Query $postBody, $optParams = [])
|
---|
44 | {
|
---|
45 | $params = ['postBody' => $postBody];
|
---|
46 | $params = array_merge($params, $optParams);
|
---|
47 | return $this->call('create', [$params], Query::class);
|
---|
48 | }
|
---|
49 | /**
|
---|
50 | * Deletes an existing query as well as its generated reports. (queries.delete)
|
---|
51 | *
|
---|
52 | * @param string $queryId Required. The ID of the query to delete.
|
---|
53 | * @param array $optParams Optional parameters.
|
---|
54 | * @throws \Google\Service\Exception
|
---|
55 | */
|
---|
56 | public function delete($queryId, $optParams = [])
|
---|
57 | {
|
---|
58 | $params = ['queryId' => $queryId];
|
---|
59 | $params = array_merge($params, $optParams);
|
---|
60 | return $this->call('delete', [$params]);
|
---|
61 | }
|
---|
62 | /**
|
---|
63 | * Retrieves a query. (queries.get)
|
---|
64 | *
|
---|
65 | * @param string $queryId Required. The ID of the query to retrieve.
|
---|
66 | * @param array $optParams Optional parameters.
|
---|
67 | * @return Query
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function get($queryId, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['queryId' => $queryId];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('get', [$params], Query::class);
|
---|
75 | }
|
---|
76 | /**
|
---|
77 | * Lists queries created by the current user. (queries.listQueries)
|
---|
78 | *
|
---|
79 | * @param array $optParams Optional parameters.
|
---|
80 | *
|
---|
81 | * @opt_param string orderBy Field to sort the list by. Accepts the following
|
---|
82 | * values: * `queryId` (default) * `metadata.title` The default sorting order is
|
---|
83 | * ascending. To specify descending order for a field, add the suffix `desc` to
|
---|
84 | * the field name. For example, `queryId desc`.
|
---|
85 | * @opt_param int pageSize Maximum number of results per page. Must be between
|
---|
86 | * `1` and `100`. Defaults to `100` if unspecified.
|
---|
87 | * @opt_param string pageToken A token identifying which page of results the
|
---|
88 | * server should return. Typically, this is the value of nextPageToken, returned
|
---|
89 | * from the previous call to the `queries.list` method. If unspecified, the
|
---|
90 | * first page of results is returned.
|
---|
91 | * @return ListQueriesResponse
|
---|
92 | * @throws \Google\Service\Exception
|
---|
93 | */
|
---|
94 | public function listQueries($optParams = [])
|
---|
95 | {
|
---|
96 | $params = [];
|
---|
97 | $params = array_merge($params, $optParams);
|
---|
98 | return $this->call('list', [$params], ListQueriesResponse::class);
|
---|
99 | }
|
---|
100 | /**
|
---|
101 | * Runs an existing query to generate a report. (queries.run)
|
---|
102 | *
|
---|
103 | * @param string $queryId Required. The ID of the query to run.
|
---|
104 | * @param RunQueryRequest $postBody
|
---|
105 | * @param array $optParams Optional parameters.
|
---|
106 | *
|
---|
107 | * @opt_param bool synchronous Whether the query should be run synchronously.
|
---|
108 | * When `true`, the request won't return until the resulting report has finished
|
---|
109 | * running. This parameter is `false` by default. Setting this parameter to
|
---|
110 | * `true` is **not recommended**.
|
---|
111 | * @return Report
|
---|
112 | * @throws \Google\Service\Exception
|
---|
113 | */
|
---|
114 | public function run($queryId, RunQueryRequest $postBody, $optParams = [])
|
---|
115 | {
|
---|
116 | $params = ['queryId' => $queryId, 'postBody' => $postBody];
|
---|
117 | $params = array_merge($params, $optParams);
|
---|
118 | return $this->call('run', [$params], Report::class);
|
---|
119 | }
|
---|
120 | }
|
---|
121 |
|
---|
122 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
123 | class_alias(Queries::class, 'Google_Service_DoubleClickBidManager_Resource_Queries');
|
---|