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\ListAdvertiserAssignedTargetingOptionsResponse;
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 AdvertisersTargetingTypesAssignedTargetingOptions extends \Google\Service\Resource
33{
34  /**
35   * Assigns a targeting option to an advertiser. Returns the assigned targeting
36   * option if successful. (assignedTargetingOptions.create)
37   *
38   * @param string $advertiserId Required. The ID of the advertiser.
39   * @param string $targetingType Required. Identifies the type of this assigned
40   * targeting option. Supported targeting types: * `TARGETING_TYPE_CHANNEL` *
41   * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` *
42   * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION`
43   * @param AssignedTargetingOption $postBody
44   * @param array $optParams Optional parameters.
45   * @return AssignedTargetingOption
46   */
47  public function create($advertiserId, $targetingType, AssignedTargetingOption $postBody, $optParams = [])
48  {
49    $params = ['advertiserId' => $advertiserId, 'targetingType' => $targetingType, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('create', [$params], AssignedTargetingOption::class);
52  }
53  /**
54   * Deletes an assigned targeting option from an advertiser.
55   * (assignedTargetingOptions.delete)
56   *
57   * @param string $advertiserId Required. The ID of the advertiser.
58   * @param string $targetingType Required. Identifies the type of this assigned
59   * targeting option. Supported targeting types: * `TARGETING_TYPE_CHANNEL` *
60   * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` *
61   * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION`
62   * @param string $assignedTargetingOptionId Required. The ID of the assigned
63   * targeting option to delete.
64   * @param array $optParams Optional parameters.
65   * @return DisplayvideoEmpty
66   */
67  public function delete($advertiserId, $targetingType, $assignedTargetingOptionId, $optParams = [])
68  {
69    $params = ['advertiserId' => $advertiserId, 'targetingType' => $targetingType, 'assignedTargetingOptionId' => $assignedTargetingOptionId];
70    $params = array_merge($params, $optParams);
71    return $this->call('delete', [$params], DisplayvideoEmpty::class);
72  }
73  /**
74   * Gets a single targeting option assigned to an advertiser.
75   * (assignedTargetingOptions.get)
76   *
77   * @param string $advertiserId Required. The ID of the advertiser.
78   * @param string $targetingType Required. Identifies the type of this assigned
79   * targeting option. Supported targeting types: * `TARGETING_TYPE_CHANNEL` *
80   * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` * `TARGETING_TYPE_OMID` *
81   * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION`
82   * @param string $assignedTargetingOptionId Required. An identifier unique to
83   * the targeting type in this advertiser that identifies the assigned targeting
84   * option being requested.
85   * @param array $optParams Optional parameters.
86   * @return AssignedTargetingOption
87   */
88  public function get($advertiserId, $targetingType, $assignedTargetingOptionId, $optParams = [])
89  {
90    $params = ['advertiserId' => $advertiserId, 'targetingType' => $targetingType, 'assignedTargetingOptionId' => $assignedTargetingOptionId];
91    $params = array_merge($params, $optParams);
92    return $this->call('get', [$params], AssignedTargetingOption::class);
93  }
94  /**
95   * Lists the targeting options assigned to an advertiser. (assignedTargetingOpti
96   * ons.listAdvertisersTargetingTypesAssignedTargetingOptions)
97   *
98   * @param string $advertiserId Required. The ID of the advertiser.
99   * @param string $targetingType Required. Identifies the type of assigned
100   * targeting options to list. Supported targeting types: *
101   * `TARGETING_TYPE_CHANNEL` * `TARGETING_TYPE_DIGITAL_CONTENT_LABEL_EXCLUSION` *
102   * `TARGETING_TYPE_OMID` * `TARGETING_TYPE_SENSITIVE_CATEGORY_EXCLUSION`
103   * @param array $optParams Optional parameters.
104   *
105   * @opt_param string filter Allows filtering by assigned targeting option
106   * properties. Supported syntax: * Filter expressions are made up of one or more
107   * restrictions. * Restrictions can be combined by the logical operator `OR`. *
108   * A restriction has the form of `{field} {operator} {value}`. * The operator
109   * must be `EQUALS (=)`. * Supported fields: - `assignedTargetingOptionId`
110   * Examples: * AssignedTargetingOption with ID 123456
111   * `assignedTargetingOptionId="123456"` The length of this field should be no
112   * more than 500 characters.
113   * @opt_param string orderBy Field by which to sort the list. Acceptable values
114   * are: * `assignedTargetingOptionId` (default) The default sorting order is
115   * ascending. To specify descending order for a field, a suffix "desc" should be
116   * added to the field name. Example: `assignedTargetingOptionId desc`.
117   * @opt_param int pageSize Requested page size. Must be between `1` and `5000`.
118   * If unspecified will default to `100`. Returns error code `INVALID_ARGUMENT`
119   * if an invalid value is specified.
120   * @opt_param string pageToken A token identifying a page of results the server
121   * should return. Typically, this is the value of next_page_token returned from
122   * the previous call to `ListAdvertiserAssignedTargetingOptions` method. If not
123   * specified, the first page of results will be returned.
124   * @return ListAdvertiserAssignedTargetingOptionsResponse
125   */
126  public function listAdvertisersTargetingTypesAssignedTargetingOptions($advertiserId, $targetingType, $optParams = [])
127  {
128    $params = ['advertiserId' => $advertiserId, 'targetingType' => $targetingType];
129    $params = array_merge($params, $optParams);
130    return $this->call('list', [$params], ListAdvertiserAssignedTargetingOptionsResponse::class);
131  }
132}
133
134// Adding a class alias for backwards compatibility with the previous class name.
135class_alias(AdvertisersTargetingTypesAssignedTargetingOptions::class, 'Google_Service_DisplayVideo_Resource_AdvertisersTargetingTypesAssignedTargetingOptions');
136