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\BulkListAdGroupAssignedTargetingOptionsResponse;
|
---|
21 | use Google\Service\DisplayVideo\ListYoutubeAdGroupsResponse;
|
---|
22 | use Google\Service\DisplayVideo\YoutubeAdGroup;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "youtubeAdGroups" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $displayvideoService = new Google\Service\DisplayVideo(...);
|
---|
29 | * $youtubeAdGroups = $displayvideoService->advertisers_youtubeAdGroups;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class AdvertisersYoutubeAdGroups extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Lists assigned targeting options for multiple YouTube ad groups across
|
---|
36 | * targeting types. Inherieted assigned targeting options are not included.
|
---|
37 | * (youtubeAdGroups.bulkListAdGroupAssignedTargetingOptions)
|
---|
38 | *
|
---|
39 | * @param string $advertiserId Required. The ID of the advertiser the line items
|
---|
40 | * belongs to.
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string filter Optional. Allows filtering by assigned targeting
|
---|
44 | * option fields. Supported syntax: * Filter expressions are made up of one or
|
---|
45 | * more restrictions. * Restrictions can be combined by the logical operator
|
---|
46 | * `OR`. * A restriction has the form of `{field} {operator} {value}`. * All
|
---|
47 | * fields must use the `EQUALS (=)` operator. Supported fields: *
|
---|
48 | * `targetingType` Examples: * `AssignedTargetingOption` resources of targeting
|
---|
49 | * type `TARGETING_TYPE_YOUTUBE_VIDEO` or `TARGETING_TYPE_YOUTUBE_CHANNEL`:
|
---|
50 | * `targetingType="TARGETING_TYPE_YOUTUBE_VIDEO" OR
|
---|
51 | * targetingType="TARGETING_TYPE_YOUTUBE_CHANNEL"` The length of this field
|
---|
52 | * should be no more than 500 characters. Reference our [filter `LIST`
|
---|
53 | * requests](/display-video/api/guides/how-tos/filters) guide for more
|
---|
54 | * information.
|
---|
55 | * @opt_param string orderBy Optional. Field by which to sort the list.
|
---|
56 | * Acceptable values are: * `youtubeAdGroupId` (acceptable in v2) * `adGroupId`
|
---|
57 | * (acceptable in v3) * `assignedTargetingOption.targetingType` The default
|
---|
58 | * sorting order is ascending. To specify descending order for a field, a suffix
|
---|
59 | * "desc" should be added to the field name. Example: `targetingType desc`.
|
---|
60 | * @opt_param int pageSize Optional. Requested page size. The size must be an
|
---|
61 | * integer between `1` and `5000`. If unspecified, the default is `5000`.
|
---|
62 | * Returns error code `INVALID_ARGUMENT` if an invalid value is specified.
|
---|
63 | * @opt_param string pageToken Optional. A token that lets the client fetch the
|
---|
64 | * next page of results. Typically, this is the value of next_page_token
|
---|
65 | * returned from the previous call to the
|
---|
66 | * `BulkListAdGroupAssignedTargetingOptions` method. If not specified, the first
|
---|
67 | * page of results will be returned.
|
---|
68 | * @opt_param string youtubeAdGroupIds Required. The IDs of the youtube ad
|
---|
69 | * groups to list assigned targeting options for.
|
---|
70 | * @return BulkListAdGroupAssignedTargetingOptionsResponse
|
---|
71 | */
|
---|
72 | public function bulkListAdGroupAssignedTargetingOptions($advertiserId, $optParams = [])
|
---|
73 | {
|
---|
74 | $params = ['advertiserId' => $advertiserId];
|
---|
75 | $params = array_merge($params, $optParams);
|
---|
76 | return $this->call('bulkListAdGroupAssignedTargetingOptions', [$params], BulkListAdGroupAssignedTargetingOptionsResponse::class);
|
---|
77 | }
|
---|
78 | /**
|
---|
79 | * Gets a YouTube ad group. (youtubeAdGroups.get)
|
---|
80 | *
|
---|
81 | * @param string $advertiserId Required. The ID of the advertiser this ad group
|
---|
82 | * belongs to.
|
---|
83 | * @param string $youtubeAdGroupId Required. The ID of the ad group to fetch.
|
---|
84 | * @param array $optParams Optional parameters.
|
---|
85 | * @return YoutubeAdGroup
|
---|
86 | */
|
---|
87 | public function get($advertiserId, $youtubeAdGroupId, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['advertiserId' => $advertiserId, 'youtubeAdGroupId' => $youtubeAdGroupId];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('get', [$params], YoutubeAdGroup::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Lists YouTube ad groups. (youtubeAdGroups.listAdvertisersYoutubeAdGroups)
|
---|
95 | *
|
---|
96 | * @param string $advertiserId Required. The ID of the advertiser the ad groups
|
---|
97 | * belongs to.
|
---|
98 | * @param array $optParams Optional parameters.
|
---|
99 | *
|
---|
100 | * @opt_param string filter Allows filtering by custom YouTube ad group fields.
|
---|
101 | * Supported syntax: * Filter expressions are made up of one or more
|
---|
102 | * restrictions. * Restrictions can be combined by `AND` and `OR`. A sequence of
|
---|
103 | * restrictions implicitly uses `AND`. * A restriction has the form of `{field}
|
---|
104 | * {operator} {value}`. * All fields must use the `EQUALS (=)` operator.
|
---|
105 | * Supported properties: * `adGroupId` * `displayName` * `entityStatus` *
|
---|
106 | * `lineItemId` * `adGroupFormat` Examples: * All ad groups under an line item:
|
---|
107 | * `lineItemId="1234"` * All `ENTITY_STATUS_ACTIVE` or `ENTITY_STATUS_PAUSED`
|
---|
108 | * `YOUTUBE_AND_PARTNERS_AD_GROUP_FORMAT_IN_STREAM` ad groups under an
|
---|
109 | * advertiser: `(entityStatus="ENTITY_STATUS_ACTIVE" OR
|
---|
110 | * entityStatus="ENTITY_STATUS_PAUSED") AND
|
---|
111 | * adGroupFormat="YOUTUBE_AND_PARTNERS_AD_GROUP_FORMAT_IN_STREAM"` The length of
|
---|
112 | * this field should be no more than 500 characters. Reference our [filter
|
---|
113 | * `LIST` requests](/display-video/api/guides/how-tos/filters) guide for more
|
---|
114 | * information.
|
---|
115 | * @opt_param string orderBy Field by which to sort the list. Acceptable values
|
---|
116 | * are: * `displayName` (default) * `entityStatus` The default sorting order is
|
---|
117 | * ascending. To specify descending order for a field, a suffix "desc" should be
|
---|
118 | * added to the field name. Example: `displayName desc`.
|
---|
119 | * @opt_param int pageSize Requested page size. Must be between `1` and `200`.
|
---|
120 | * If unspecified will default to `100`. Returns error code `INVALID_ARGUMENT`
|
---|
121 | * if an invalid value is specified.
|
---|
122 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
123 | * should return. Typically, this is the value of next_page_token returned from
|
---|
124 | * the previous call to `ListYoutubeAdGroups` method. If not specified, the
|
---|
125 | * first page of results will be returned.
|
---|
126 | * @return ListYoutubeAdGroupsResponse
|
---|
127 | */
|
---|
128 | public function listAdvertisersYoutubeAdGroups($advertiserId, $optParams = [])
|
---|
129 | {
|
---|
130 | $params = ['advertiserId' => $advertiserId];
|
---|
131 | $params = array_merge($params, $optParams);
|
---|
132 | return $this->call('list', [$params], ListYoutubeAdGroupsResponse::class);
|
---|
133 | }
|
---|
134 | }
|
---|
135 |
|
---|
136 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
137 | class_alias(AdvertisersYoutubeAdGroups::class, 'Google_Service_DisplayVideo_Resource_AdvertisersYoutubeAdGroups');
|
---|