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\AssignedLocation;
21use Google\Service\DisplayVideo\BulkEditAssignedLocationsRequest;
22use Google\Service\DisplayVideo\BulkEditAssignedLocationsResponse;
23use Google\Service\DisplayVideo\DisplayvideoEmpty;
24use Google\Service\DisplayVideo\ListAssignedLocationsResponse;
25
26/**
27 * The "assignedLocations" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $displayvideoService = new Google\Service\DisplayVideo(...);
31 *   $assignedLocations = $displayvideoService->assignedLocations;
32 *  </code>
33 */
34class AdvertisersLocationListsAssignedLocations extends \Google\Service\Resource
35{
36  /**
37   * Bulk edits multiple assignments between locations and a single location list.
38   * The operation will delete the assigned locations provided in
39   * BulkEditAssignedLocationsRequest.deleted_assigned_locations and then create
40   * the assigned locations provided in
41   * BulkEditAssignedLocationsRequest.created_assigned_locations.
42   * (assignedLocations.bulkEdit)
43   *
44   * @param string $advertiserId Required. The ID of the DV360 advertiser to which
45   * the location list belongs.
46   * @param string $locationListId Required. The ID of the location list to which
47   * these assignments are assigned.
48   * @param BulkEditAssignedLocationsRequest $postBody
49   * @param array $optParams Optional parameters.
50   * @return BulkEditAssignedLocationsResponse
51   */
52  public function bulkEdit($advertiserId, $locationListId, BulkEditAssignedLocationsRequest $postBody, $optParams = [])
53  {
54    $params = ['advertiserId' => $advertiserId, 'locationListId' => $locationListId, 'postBody' => $postBody];
55    $params = array_merge($params, $optParams);
56    return $this->call('bulkEdit', [$params], BulkEditAssignedLocationsResponse::class);
57  }
58  /**
59   * Creates an assignment between a location and a location list.
60   * (assignedLocations.create)
61   *
62   * @param string $advertiserId Required. The ID of the DV360 advertiser to which
63   * the location list belongs.
64   * @param string $locationListId Required. The ID of the location list for which
65   * the assignment will be created.
66   * @param AssignedLocation $postBody
67   * @param array $optParams Optional parameters.
68   * @return AssignedLocation
69   */
70  public function create($advertiserId, $locationListId, AssignedLocation $postBody, $optParams = [])
71  {
72    $params = ['advertiserId' => $advertiserId, 'locationListId' => $locationListId, 'postBody' => $postBody];
73    $params = array_merge($params, $optParams);
74    return $this->call('create', [$params], AssignedLocation::class);
75  }
76  /**
77   * Deletes the assignment between a location and a location list.
78   * (assignedLocations.delete)
79   *
80   * @param string $advertiserId Required. The ID of the DV360 advertiser to which
81   * the location list belongs.
82   * @param string $locationListId Required. The ID of the location list to which
83   * this assignment is assigned.
84   * @param string $assignedLocationId Required. The ID of the assigned location
85   * to delete.
86   * @param array $optParams Optional parameters.
87   * @return DisplayvideoEmpty
88   */
89  public function delete($advertiserId, $locationListId, $assignedLocationId, $optParams = [])
90  {
91    $params = ['advertiserId' => $advertiserId, 'locationListId' => $locationListId, 'assignedLocationId' => $assignedLocationId];
92    $params = array_merge($params, $optParams);
93    return $this->call('delete', [$params], DisplayvideoEmpty::class);
94  }
95  /**
96   * Lists locations assigned to a location list.
97   * (assignedLocations.listAdvertisersLocationListsAssignedLocations)
98   *
99   * @param string $advertiserId Required. The ID of the DV360 advertiser to which
100   * the location list belongs.
101   * @param string $locationListId Required. The ID of the location list to which
102   * these assignments are assigned.
103   * @param array $optParams Optional parameters.
104   *
105   * @opt_param string filter Allows filtering by location list assignment fields.
106   * 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: - `assignedLocationId` The length
110   * of this field should be no more than 500 characters.
111   * @opt_param string orderBy Field by which to sort the list. Acceptable values
112   * are: * `assignedLocationId` (default) The default sorting order is ascending.
113   * To specify descending order for a field, a suffix " desc" should be added to
114   * the field name. Example: `assignedLocationId desc`.
115   * @opt_param int pageSize Requested page size. Must be between `1` and `100`.
116   * If unspecified will default to `100`. Returns error code `INVALID_ARGUMENT`
117   * if an invalid value is specified.
118   * @opt_param string pageToken A token identifying a page of results the server
119   * should return. Typically, this is the value of next_page_token returned from
120   * the previous call to `ListAssignedLocations` method. If not specified, the
121   * first page of results will be returned.
122   * @return ListAssignedLocationsResponse
123   */
124  public function listAdvertisersLocationListsAssignedLocations($advertiserId, $locationListId, $optParams = [])
125  {
126    $params = ['advertiserId' => $advertiserId, 'locationListId' => $locationListId];
127    $params = array_merge($params, $optParams);
128    return $this->call('list', [$params], ListAssignedLocationsResponse::class);
129  }
130}
131
132// Adding a class alias for backwards compatibility with the previous class name.
133class_alias(AdvertisersLocationListsAssignedLocations::class, 'Google_Service_DisplayVideo_Resource_AdvertisersLocationListsAssignedLocations');
134