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\AssignedTargetingOption; 21use Google\Service\DisplayVideo\DisplayvideoEmpty; 22use Google\Service\DisplayVideo\ListPartnerAssignedTargetingOptionsResponse; 23 24/** 25 * The "assignedTargetingOptions" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $displayvideoService = new Google\Service\DisplayVideo(...); 29 * $assignedTargetingOptions = $displayvideoService->assignedTargetingOptions; 30 * </code> 31 */ 32class PartnersTargetingTypesAssignedTargetingOptions extends \Google\Service\Resource 33{ 34 /** 35 * Assigns a targeting option to a partner. Returns the assigned targeting 36 * option if successful. (assignedTargetingOptions.create) 37 * 38 * @param string $partnerId Required. The ID of the partner. 39 * @param string $targetingType Required. Identifies the type of this assigned 40 * targeting option. Supported targeting types: * `TARGETING_TYPE_CHANNEL` 41 * @param AssignedTargetingOption $postBody 42 * @param array $optParams Optional parameters. 43 * @return AssignedTargetingOption 44 */ 45 public function create($partnerId, $targetingType, AssignedTargetingOption $postBody, $optParams = []) 46 { 47 $params = ['partnerId' => $partnerId, 'targetingType' => $targetingType, 'postBody' => $postBody]; 48 $params = array_merge($params, $optParams); 49 return $this->call('create', [$params], AssignedTargetingOption::class); 50 } 51 /** 52 * Deletes an assigned targeting option from a partner. 53 * (assignedTargetingOptions.delete) 54 * 55 * @param string $partnerId Required. The ID of the partner. 56 * @param string $targetingType Required. Identifies the type of this assigned 57 * targeting option. Supported targeting types: * `TARGETING_TYPE_CHANNEL` 58 * @param string $assignedTargetingOptionId Required. The ID of the assigned 59 * targeting option to delete. 60 * @param array $optParams Optional parameters. 61 * @return DisplayvideoEmpty 62 */ 63 public function delete($partnerId, $targetingType, $assignedTargetingOptionId, $optParams = []) 64 { 65 $params = ['partnerId' => $partnerId, 'targetingType' => $targetingType, 'assignedTargetingOptionId' => $assignedTargetingOptionId]; 66 $params = array_merge($params, $optParams); 67 return $this->call('delete', [$params], DisplayvideoEmpty::class); 68 } 69 /** 70 * Gets a single targeting option assigned to a partner. 71 * (assignedTargetingOptions.get) 72 * 73 * @param string $partnerId Required. The ID of the partner. 74 * @param string $targetingType Required. Identifies the type of this assigned 75 * targeting option. Supported targeting types: * `TARGETING_TYPE_CHANNEL` 76 * @param string $assignedTargetingOptionId Required. An identifier unique to 77 * the targeting type in this partner that identifies the assigned targeting 78 * option being requested. 79 * @param array $optParams Optional parameters. 80 * @return AssignedTargetingOption 81 */ 82 public function get($partnerId, $targetingType, $assignedTargetingOptionId, $optParams = []) 83 { 84 $params = ['partnerId' => $partnerId, 'targetingType' => $targetingType, 'assignedTargetingOptionId' => $assignedTargetingOptionId]; 85 $params = array_merge($params, $optParams); 86 return $this->call('get', [$params], AssignedTargetingOption::class); 87 } 88 /** 89 * Lists the targeting options assigned to a partner. 90 * (assignedTargetingOptions.listPartnersTargetingTypesAssignedTargetingOptions) 91 * 92 * @param string $partnerId Required. The ID of the partner. 93 * @param string $targetingType Required. Identifies the type of assigned 94 * targeting options to list. Supported targeting types: * 95 * `TARGETING_TYPE_CHANNEL` 96 * @param array $optParams Optional parameters. 97 * 98 * @opt_param string filter Allows filtering by assigned targeting option 99 * properties. Supported syntax: * Filter expressions are made up of one or more 100 * restrictions. * Restrictions can be combined by the logical operator `OR`. * 101 * A restriction has the form of `{field} {operator} {value}`. * The operator 102 * must be `EQUALS (=)`. * Supported fields: - `assignedTargetingOptionId` 103 * Examples: * AssignedTargetingOption with ID 123456 104 * `assignedTargetingOptionId="123456"` The length of this field should be no 105 * more than 500 characters. 106 * @opt_param string orderBy Field by which to sort the list. Acceptable values 107 * are: * `assignedTargetingOptionId` (default) The default sorting order is 108 * ascending. To specify descending order for a field, a suffix "desc" should be 109 * added to the field name. Example: `assignedTargetingOptionId 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 `ListPartnerAssignedTargetingOptions` method. If not 116 * specified, the first page of results will be returned. 117 * @return ListPartnerAssignedTargetingOptionsResponse 118 */ 119 public function listPartnersTargetingTypesAssignedTargetingOptions($partnerId, $targetingType, $optParams = []) 120 { 121 $params = ['partnerId' => $partnerId, 'targetingType' => $targetingType]; 122 $params = array_merge($params, $optParams); 123 return $this->call('list', [$params], ListPartnerAssignedTargetingOptionsResponse::class); 124 } 125} 126 127// Adding a class alias for backwards compatibility with the previous class name. 128class_alias(PartnersTargetingTypesAssignedTargetingOptions::class, 'Google_Service_DisplayVideo_Resource_PartnersTargetingTypesAssignedTargetingOptions'); 129