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 18namespace Google\Service\DisplayVideo\Resource; 19 20use Google\Service\DisplayVideo\ListTargetingOptionsResponse; 21use Google\Service\DisplayVideo\SearchTargetingOptionsRequest; 22use Google\Service\DisplayVideo\SearchTargetingOptionsResponse; 23use Google\Service\DisplayVideo\TargetingOption; 24 25/** 26 * The "targetingOptions" collection of methods. 27 * Typical usage is: 28 * <code> 29 * $displayvideoService = new Google\Service\DisplayVideo(...); 30 * $targetingOptions = $displayvideoService->targetingOptions; 31 * </code> 32 */ 33class TargetingTypesTargetingOptions extends \Google\Service\Resource 34{ 35 /** 36 * Gets a single targeting option. (targetingOptions.get) 37 * 38 * @param string $targetingType Required. The type of targeting option to 39 * retrieve. Accepted values are: * `TARGETING_TYPE_APP_CATEGORY` * 40 * `TARGETING_TYPE_AGE_RANGE` * `TARGETING_TYPE_GENDER` * 41 * `TARGETING_TYPE_VIDEO_PLAYER_SIZE` * `TARGETING_TYPE_USER_REWARDED_CONTENT` * 42 * `TARGETING_TYPE_PARENTAL_STATUS` * `TARGETING_TYPE_CONTENT_INSTREAM_POSITION` 43 * * `TARGETING_TYPE_CONTENT_OUTSTREAM_POSITION` * `TARGETING_TYPE_DEVICE_TYPE` 44 * * `TARGETING_TYPE_BROWSER` * `TARGETING_TYPE_HOUSEHOLD_INCOME` * 45 * `TARGETING_TYPE_ON_SCREEN_POSITION` * `TARGETING_TYPE_CARRIER_AND_ISP` * 46 * `TARGETING_TYPE_OPERATING_SYSTEM` * `TARGETING_TYPE_DEVICE_MAKE_MODEL` * 47 * `TARGETING_TYPE_ENVIRONMENT` * `TARGETING_TYPE_CATEGORY` * 48 * `TARGETING_TYPE_VIEWABILITY` * `TARGETING_TYPE_AUTHORIZED_SELLER_STATUS` * 49 * `TARGETING_TYPE_LANGUAGE` * `TARGETING_TYPE_GEO_REGION` * 50 * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * 51 * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * `TARGETING_TYPE_EXCHANGE` * 52 * `TARGETING_TYPE_SUB_EXCHANGE` * `TARGETING_TYPE_NATIVE_CONTENT_POSITION` * 53 * `TARGETING_TYPE_OMID` 54 * @param string $targetingOptionId Required. The ID of the of targeting option 55 * to retrieve. 56 * @param array $optParams Optional parameters. 57 * 58 * @opt_param string advertiserId Required. The Advertiser this request is being 59 * made in the context of. 60 * @return TargetingOption 61 */ 62 public function get($targetingType, $targetingOptionId, $optParams = []) 63 { 64 $params = ['targetingType' => $targetingType, 'targetingOptionId' => $targetingOptionId]; 65 $params = array_merge($params, $optParams); 66 return $this->call('get', [$params], TargetingOption::class); 67 } 68 /** 69 * Lists targeting options of a given type. 70 * (targetingOptions.listTargetingTypesTargetingOptions) 71 * 72 * @param string $targetingType Required. The type of targeting option to be 73 * listed. Accepted values are: * `TARGETING_TYPE_APP_CATEGORY` * 74 * `TARGETING_TYPE_AGE_RANGE` * `TARGETING_TYPE_GENDER` * 75 * `TARGETING_TYPE_VIDEO_PLAYER_SIZE` * `TARGETING_TYPE_USER_REWARDED_CONTENT` * 76 * `TARGETING_TYPE_PARENTAL_STATUS` * `TARGETING_TYPE_CONTENT_INSTREAM_POSITION` 77 * * `TARGETING_TYPE_CONTENT_OUTSTREAM_POSITION` * `TARGETING_TYPE_DEVICE_TYPE` 78 * * `TARGETING_TYPE_BROWSER` * `TARGETING_TYPE_HOUSEHOLD_INCOME` * 79 * `TARGETING_TYPE_ON_SCREEN_POSITION` * `TARGETING_TYPE_CARRIER_AND_ISP` * 80 * `TARGETING_TYPE_OPERATING_SYSTEM` * `TARGETING_TYPE_DEVICE_MAKE_MODEL` * 81 * `TARGETING_TYPE_ENVIRONMENT` * `TARGETING_TYPE_CATEGORY` * 82 * `TARGETING_TYPE_VIEWABILITY` * `TARGETING_TYPE_AUTHORIZED_SELLER_STATUS` * 83 * `TARGETING_TYPE_LANGUAGE` * `TARGETING_TYPE_GEO_REGION` * 84 * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * 85 * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION` * `TARGETING_TYPE_EXCHANGE` * 86 * `TARGETING_TYPE_SUB_EXCHANGE` * `TARGETING_TYPE_NATIVE_CONTENT_POSITION` * 87 * `TARGETING_TYPE_OMID` 88 * @param array $optParams Optional parameters. 89 * 90 * @opt_param string advertiserId Required. The Advertiser this request is being 91 * made in the context of. 92 * @opt_param string filter Allows filtering by targeting option properties. 93 * Supported syntax: * Filter expressions are made up of one or more 94 * restrictions. * Restrictions can be combined by `OR` logical operators. * A 95 * restriction has the form of `{field} {operator} {value}`. * The operator must 96 * be "=" (equal sign). * Supported fields: - `carrierAndIspDetails.type` - 97 * `geoRegionDetails.geoRegionType` - `targetingOptionId` Examples: * All `GEO 98 * REGION` targeting options that belong to sub type `GEO_REGION_TYPE_COUNTRY` 99 * or `GEO_REGION_TYPE_STATE`: 100 * `geoRegionDetails.geoRegionType="GEO_REGION_TYPE_COUNTRY" OR 101 * geoRegionDetails.geoRegionType="GEO_REGION_TYPE_STATE"` * All `CARRIER AND 102 * ISP` targeting options that belong to sub type 103 * `CARRIER_AND_ISP_TYPE_CARRIER`: 104 * `carrierAndIspDetails.type="CARRIER_AND_ISP_TYPE_CARRIER"`. The length of 105 * this field should be no more than 500 characters. 106 * @opt_param string orderBy Field by which to sort the list. Acceptable values 107 * are: * `targetingOptionId` (default) The default sorting order is ascending. 108 * To specify descending order for a field, a suffix "desc" should be added to 109 * the field name. Example: `targetingOptionId desc`. 110 * @opt_param int pageSize Requested page size. Must be between `1` and `100`. 111 * If unspecified will default to `100`. Returns error code `INVALID_ARGUMENT` 112 * if an invalid value is specified. 113 * @opt_param string pageToken A token identifying a page of results the server 114 * should return. Typically, this is the value of next_page_token returned from 115 * the previous call to `ListTargetingOptions` method. If not specified, the 116 * first page of results will be returned. 117 * @return ListTargetingOptionsResponse 118 */ 119 public function listTargetingTypesTargetingOptions($targetingType, $optParams = []) 120 { 121 $params = ['targetingType' => $targetingType]; 122 $params = array_merge($params, $optParams); 123 return $this->call('list', [$params], ListTargetingOptionsResponse::class); 124 } 125 /** 126 * Searches for targeting options of a given type based on the given search 127 * terms. (targetingOptions.search) 128 * 129 * @param string $targetingType Required. The type of targeting options to 130 * retrieve. Accepted values are: * `TARGETING_TYPE_GEO_REGION` * 131 * `TARGETING_TYPE_POI` * `TARGETING_TYPE_BUSINESS_CHAIN` 132 * @param SearchTargetingOptionsRequest $postBody 133 * @param array $optParams Optional parameters. 134 * @return SearchTargetingOptionsResponse 135 */ 136 public function search($targetingType, SearchTargetingOptionsRequest $postBody, $optParams = []) 137 { 138 $params = ['targetingType' => $targetingType, 'postBody' => $postBody]; 139 $params = array_merge($params, $optParams); 140 return $this->call('search', [$params], SearchTargetingOptionsResponse::class); 141 } 142} 143 144// Adding a class alias for backwards compatibility with the previous class name. 145class_alias(TargetingTypesTargetingOptions::class, 'Google_Service_DisplayVideo_Resource_TargetingTypesTargetingOptions'); 146