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\DisplayVideo\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DisplayVideo\Advertiser;
|
---|
21 | use Google\Service\DisplayVideo\AuditAdvertiserResponse;
|
---|
22 | use Google\Service\DisplayVideo\BulkEditAdvertiserAssignedTargetingOptionsRequest;
|
---|
23 | use Google\Service\DisplayVideo\BulkEditAdvertiserAssignedTargetingOptionsResponse;
|
---|
24 | use Google\Service\DisplayVideo\BulkListAdvertiserAssignedTargetingOptionsResponse;
|
---|
25 | use Google\Service\DisplayVideo\DisplayvideoEmpty;
|
---|
26 | use Google\Service\DisplayVideo\ListAdvertisersResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "advertisers" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $displayvideoService = new Google\Service\DisplayVideo(...);
|
---|
33 | * $advertisers = $displayvideoService->advertisers;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class Advertisers extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Audits an advertiser. Returns the counts of used entities per resource type
|
---|
40 | * under the advertiser provided. Used entities count towards their respective
|
---|
41 | * resource limit. See https://support.google.com/displayvideo/answer/6071450.
|
---|
42 | * (advertisers.audit)
|
---|
43 | *
|
---|
44 | * @param string $advertiserId Required. The ID of the advertiser to audit.
|
---|
45 | * @param array $optParams Optional parameters.
|
---|
46 | *
|
---|
47 | * @opt_param string readMask Optional. The specific fields to return. If no
|
---|
48 | * mask is specified, all fields in the response proto will be filled. Valid
|
---|
49 | * values are: * usedLineItemsCount * usedInsertionOrdersCount *
|
---|
50 | * usedCampaignsCount * channelsCount * negativelyTargetedChannelsCount *
|
---|
51 | * negativeKeywordListsCount * adGroupCriteriaCount * campaignCriteriaCount
|
---|
52 | * @return AuditAdvertiserResponse
|
---|
53 | * @throws \Google\Service\Exception
|
---|
54 | */
|
---|
55 | public function audit($advertiserId, $optParams = [])
|
---|
56 | {
|
---|
57 | $params = ['advertiserId' => $advertiserId];
|
---|
58 | $params = array_merge($params, $optParams);
|
---|
59 | return $this->call('audit', [$params], AuditAdvertiserResponse::class);
|
---|
60 | }
|
---|
61 | /**
|
---|
62 | * Creates a new advertiser. Returns the newly created advertiser if successful.
|
---|
63 | * **This method regularly experiences high latency.** We recommend [increasing
|
---|
64 | * your default timeout](/display-video/api/guides/best-
|
---|
65 | * practices/timeouts#client_library_timeout) to avoid errors.
|
---|
66 | * (advertisers.create)
|
---|
67 | *
|
---|
68 | * @param Advertiser $postBody
|
---|
69 | * @param array $optParams Optional parameters.
|
---|
70 | * @return Advertiser
|
---|
71 | * @throws \Google\Service\Exception
|
---|
72 | */
|
---|
73 | public function create(Advertiser $postBody, $optParams = [])
|
---|
74 | {
|
---|
75 | $params = ['postBody' => $postBody];
|
---|
76 | $params = array_merge($params, $optParams);
|
---|
77 | return $this->call('create', [$params], Advertiser::class);
|
---|
78 | }
|
---|
79 | /**
|
---|
80 | * Deletes an advertiser. Deleting an advertiser will delete all of its child
|
---|
81 | * resources, for example, campaigns, insertion orders and line items. A deleted
|
---|
82 | * advertiser cannot be recovered. (advertisers.delete)
|
---|
83 | *
|
---|
84 | * @param string $advertiserId The ID of the advertiser we need to delete.
|
---|
85 | * @param array $optParams Optional parameters.
|
---|
86 | * @return DisplayvideoEmpty
|
---|
87 | * @throws \Google\Service\Exception
|
---|
88 | */
|
---|
89 | public function delete($advertiserId, $optParams = [])
|
---|
90 | {
|
---|
91 | $params = ['advertiserId' => $advertiserId];
|
---|
92 | $params = array_merge($params, $optParams);
|
---|
93 | return $this->call('delete', [$params], DisplayvideoEmpty::class);
|
---|
94 | }
|
---|
95 | /**
|
---|
96 | * Edits targeting options under a single advertiser. The operation will delete
|
---|
97 | * the assigned targeting options provided in
|
---|
98 | * BulkEditAdvertiserAssignedTargetingOptionsRequest.delete_requests and then
|
---|
99 | * create the assigned targeting options provided in
|
---|
100 | * BulkEditAdvertiserAssignedTargetingOptionsRequest.create_requests .
|
---|
101 | * (advertisers.editAssignedTargetingOptions)
|
---|
102 | *
|
---|
103 | * @param string $advertiserId Required. The ID of the advertiser.
|
---|
104 | * @param BulkEditAdvertiserAssignedTargetingOptionsRequest $postBody
|
---|
105 | * @param array $optParams Optional parameters.
|
---|
106 | * @return BulkEditAdvertiserAssignedTargetingOptionsResponse
|
---|
107 | * @throws \Google\Service\Exception
|
---|
108 | */
|
---|
109 | public function editAssignedTargetingOptions($advertiserId, BulkEditAdvertiserAssignedTargetingOptionsRequest $postBody, $optParams = [])
|
---|
110 | {
|
---|
111 | $params = ['advertiserId' => $advertiserId, 'postBody' => $postBody];
|
---|
112 | $params = array_merge($params, $optParams);
|
---|
113 | return $this->call('editAssignedTargetingOptions', [$params], BulkEditAdvertiserAssignedTargetingOptionsResponse::class);
|
---|
114 | }
|
---|
115 | /**
|
---|
116 | * Gets an advertiser. (advertisers.get)
|
---|
117 | *
|
---|
118 | * @param string $advertiserId Required. The ID of the advertiser to fetch.
|
---|
119 | * @param array $optParams Optional parameters.
|
---|
120 | * @return Advertiser
|
---|
121 | * @throws \Google\Service\Exception
|
---|
122 | */
|
---|
123 | public function get($advertiserId, $optParams = [])
|
---|
124 | {
|
---|
125 | $params = ['advertiserId' => $advertiserId];
|
---|
126 | $params = array_merge($params, $optParams);
|
---|
127 | return $this->call('get', [$params], Advertiser::class);
|
---|
128 | }
|
---|
129 | /**
|
---|
130 | * Lists advertisers that are accessible to the current user. The order is
|
---|
131 | * defined by the order_by parameter. A single partner_id is required. Cross-
|
---|
132 | * partner listing is not supported. (advertisers.listAdvertisers)
|
---|
133 | *
|
---|
134 | * @param array $optParams Optional parameters.
|
---|
135 | *
|
---|
136 | * @opt_param string filter Allows filtering by advertiser fields. Supported
|
---|
137 | * syntax: * Filter expressions are made up of one or more restrictions. *
|
---|
138 | * Restrictions can be combined by `AND` or `OR` logical operators. * A
|
---|
139 | * restriction has the form of `{field} {operator} {value}`. * The `updateTime`
|
---|
140 | * field must use the `GREATER THAN OR EQUAL TO (>=)` or `LESS THAN OR EQUAL TO
|
---|
141 | * (<=)` operators. * All other fields must use the `EQUALS (=)` operator.
|
---|
142 | * Supported fields: * `advertiserId` * `displayName` * `entityStatus` *
|
---|
143 | * `updateTime` (input in ISO 8601 format, or `YYYY-MM-DDTHH:MM:SSZ`) Examples:
|
---|
144 | * * All active advertisers under a partner:
|
---|
145 | * `entityStatus="ENTITY_STATUS_ACTIVE"` * All advertisers with an update time
|
---|
146 | * less than or equal to 2020-11-04T18:54:47Z (format of ISO 8601):
|
---|
147 | * `updateTime<="2020-11-04T18:54:47Z"` * All advertisers with an update time
|
---|
148 | * greater than or equal to 2020-11-04T18:54:47Z (format of ISO 8601):
|
---|
149 | * `updateTime>="2020-11-04T18:54:47Z"` The length of this field should be no
|
---|
150 | * more than 500 characters. Reference our [filter `LIST` requests](/display-
|
---|
151 | * video/api/guides/how-tos/filters) guide for more information.
|
---|
152 | * @opt_param string orderBy Field by which to sort the list. Acceptable values
|
---|
153 | * are: * `displayName` (default) * `entityStatus` * `updateTime` The default
|
---|
154 | * sorting order is ascending. To specify descending order for a field, a suffix
|
---|
155 | * "desc" should be added to the field name. For example, `displayName desc`.
|
---|
156 | * @opt_param int pageSize Requested page size. Must be between `1` and `200`.
|
---|
157 | * If unspecified will default to `100`.
|
---|
158 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
159 | * should return. Typically, this is the value of next_page_token returned from
|
---|
160 | * the previous call to `ListAdvertisers` method. If not specified, the first
|
---|
161 | * page of results will be returned.
|
---|
162 | * @opt_param string partnerId Required. The ID of the partner that the fetched
|
---|
163 | * advertisers should all belong to. The system only supports listing
|
---|
164 | * advertisers for one partner at a time.
|
---|
165 | * @return ListAdvertisersResponse
|
---|
166 | * @throws \Google\Service\Exception
|
---|
167 | */
|
---|
168 | public function listAdvertisers($optParams = [])
|
---|
169 | {
|
---|
170 | $params = [];
|
---|
171 | $params = array_merge($params, $optParams);
|
---|
172 | return $this->call('list', [$params], ListAdvertisersResponse::class);
|
---|
173 | }
|
---|
174 | /**
|
---|
175 | * Lists assigned targeting options of an advertiser across targeting types.
|
---|
176 | * (advertisers.listAssignedTargetingOptions)
|
---|
177 | *
|
---|
178 | * @param string $advertiserId Required. The ID of the advertiser the line item
|
---|
179 | * belongs to.
|
---|
180 | * @param array $optParams Optional parameters.
|
---|
181 | *
|
---|
182 | * @opt_param string filter Allows filtering by assigned targeting option
|
---|
183 | * fields. Supported syntax: * Filter expressions are made up of one or more
|
---|
184 | * restrictions. * Restrictions can be combined by the `OR` logical operator. *
|
---|
185 | * A restriction has the form of `{field} {operator} {value}`. * All fields must
|
---|
186 | * use the `EQUALS (=) operator`. Supported fields: * `targetingType` Examples:
|
---|
187 | * * targetingType with value TARGETING_TYPE_CHANNEL
|
---|
188 | * `targetingType="TARGETING_TYPE_CHANNEL"` The length of this field should be
|
---|
189 | * no more than 500 characters. Reference our [filter `LIST` requests](/display-
|
---|
190 | * video/api/guides/how-tos/filters) guide for more information.
|
---|
191 | * @opt_param string orderBy Field by which to sort the list. Acceptable values
|
---|
192 | * are: * `targetingType` (default) The default sorting order is ascending. To
|
---|
193 | * specify descending order for a field, a suffix "desc" should be added to the
|
---|
194 | * field name. Example: `targetingType desc`.
|
---|
195 | * @opt_param int pageSize Requested page size. The size must be an integer
|
---|
196 | * between `1` and `5000`. If unspecified, the default is '5000'. Returns error
|
---|
197 | * code `INVALID_ARGUMENT` if an invalid value is specified.
|
---|
198 | * @opt_param string pageToken A token that lets the client fetch the next page
|
---|
199 | * of results. Typically, this is the value of next_page_token returned from the
|
---|
200 | * previous call to `BulkListAdvertiserAssignedTargetingOptions` method. If not
|
---|
201 | * specified, the first page of results will be returned.
|
---|
202 | * @return BulkListAdvertiserAssignedTargetingOptionsResponse
|
---|
203 | * @throws \Google\Service\Exception
|
---|
204 | */
|
---|
205 | public function listAssignedTargetingOptions($advertiserId, $optParams = [])
|
---|
206 | {
|
---|
207 | $params = ['advertiserId' => $advertiserId];
|
---|
208 | $params = array_merge($params, $optParams);
|
---|
209 | return $this->call('listAssignedTargetingOptions', [$params], BulkListAdvertiserAssignedTargetingOptionsResponse::class);
|
---|
210 | }
|
---|
211 | /**
|
---|
212 | * Updates an existing advertiser. Returns the updated advertiser if successful.
|
---|
213 | * (advertisers.patch)
|
---|
214 | *
|
---|
215 | * @param string $advertiserId Output only. The unique ID of the advertiser.
|
---|
216 | * Assigned by the system.
|
---|
217 | * @param Advertiser $postBody
|
---|
218 | * @param array $optParams Optional parameters.
|
---|
219 | *
|
---|
220 | * @opt_param string updateMask Required. The mask to control which fields to
|
---|
221 | * update.
|
---|
222 | * @return Advertiser
|
---|
223 | * @throws \Google\Service\Exception
|
---|
224 | */
|
---|
225 | public function patch($advertiserId, Advertiser $postBody, $optParams = [])
|
---|
226 | {
|
---|
227 | $params = ['advertiserId' => $advertiserId, 'postBody' => $postBody];
|
---|
228 | $params = array_merge($params, $optParams);
|
---|
229 | return $this->call('patch', [$params], Advertiser::class);
|
---|
230 | }
|
---|
231 | }
|
---|
232 |
|
---|
233 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
234 | class_alias(Advertisers::class, 'Google_Service_DisplayVideo_Resource_Advertisers');
|
---|