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