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\AssignedInventorySource;
21use Google\Service\DisplayVideo\BulkEditAssignedInventorySourcesRequest;
22use Google\Service\DisplayVideo\BulkEditAssignedInventorySourcesResponse;
23use Google\Service\DisplayVideo\DisplayvideoEmpty;
24use Google\Service\DisplayVideo\ListAssignedInventorySourcesResponse;
25
26/**
27 * The "assignedInventorySources" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $displayvideoService = new Google\Service\DisplayVideo(...);
31 *   $assignedInventorySources = $displayvideoService->assignedInventorySources;
32 *  </code>
33 */
34class InventorySourceGroupsAssignedInventorySources extends \Google\Service\Resource
35{
36  /**
37   * Bulk edits multiple assignments between inventory sources and a single
38   * inventory source group. The operation will delete the assigned inventory
39   * sources provided in
40   * BulkEditAssignedInventorySourcesRequest.deleted_assigned_inventory_sources
41   * and then create the assigned inventory sources provided in
42   * BulkEditAssignedInventorySourcesRequest.created_assigned_inventory_sources.
43   * (assignedInventorySources.bulkEdit)
44   *
45   * @param string $inventorySourceGroupId Required. The ID of the inventory
46   * source group to which the assignments are assigned.
47   * @param BulkEditAssignedInventorySourcesRequest $postBody
48   * @param array $optParams Optional parameters.
49   * @return BulkEditAssignedInventorySourcesResponse
50   */
51  public function bulkEdit($inventorySourceGroupId, BulkEditAssignedInventorySourcesRequest $postBody, $optParams = [])
52  {
53    $params = ['inventorySourceGroupId' => $inventorySourceGroupId, 'postBody' => $postBody];
54    $params = array_merge($params, $optParams);
55    return $this->call('bulkEdit', [$params], BulkEditAssignedInventorySourcesResponse::class);
56  }
57  /**
58   * Creates an assignment between an inventory source and an inventory source
59   * group. (assignedInventorySources.create)
60   *
61   * @param string $inventorySourceGroupId Required. The ID of the inventory
62   * source group to which the assignment will be assigned.
63   * @param AssignedInventorySource $postBody
64   * @param array $optParams Optional parameters.
65   *
66   * @opt_param string advertiserId The ID of the advertiser that owns the parent
67   * inventory source group. The parent partner will not have access to this
68   * assigned inventory source.
69   * @opt_param string partnerId The ID of the partner that owns the parent
70   * inventory source group. Only this partner will have write access to this
71   * assigned inventory source.
72   * @return AssignedInventorySource
73   */
74  public function create($inventorySourceGroupId, AssignedInventorySource $postBody, $optParams = [])
75  {
76    $params = ['inventorySourceGroupId' => $inventorySourceGroupId, 'postBody' => $postBody];
77    $params = array_merge($params, $optParams);
78    return $this->call('create', [$params], AssignedInventorySource::class);
79  }
80  /**
81   * Deletes the assignment between an inventory source and an inventory source
82   * group. (assignedInventorySources.delete)
83   *
84   * @param string $inventorySourceGroupId Required. The ID of the inventory
85   * source group to which this assignment is assigned.
86   * @param string $assignedInventorySourceId Required. The ID of the assigned
87   * inventory source to delete.
88   * @param array $optParams Optional parameters.
89   *
90   * @opt_param string advertiserId The ID of the advertiser that owns the parent
91   * inventory source group. The parent partner does not have access to this
92   * assigned inventory source.
93   * @opt_param string partnerId The ID of the partner that owns the parent
94   * inventory source group. Only this partner has write access to this assigned
95   * inventory source.
96   * @return DisplayvideoEmpty
97   */
98  public function delete($inventorySourceGroupId, $assignedInventorySourceId, $optParams = [])
99  {
100    $params = ['inventorySourceGroupId' => $inventorySourceGroupId, 'assignedInventorySourceId' => $assignedInventorySourceId];
101    $params = array_merge($params, $optParams);
102    return $this->call('delete', [$params], DisplayvideoEmpty::class);
103  }
104  /**
105   * Lists inventory sources assigned to an inventory source group.
106   * (assignedInventorySources.listInventorySourceGroupsAssignedInventorySources)
107   *
108   * @param string $inventorySourceGroupId Required. The ID of the inventory
109   * source group to which these assignments are assigned.
110   * @param array $optParams Optional parameters.
111   *
112   * @opt_param string advertiserId The ID of the advertiser that has access to
113   * the assignment. If the parent inventory source group is partner-owned, only
114   * advertisers to which the parent group is explicitly shared can access the
115   * assigned inventory source.
116   * @opt_param string filter Allows filtering by assigned inventory source
117   * fields. Supported syntax: * Filter expressions are made up of one or more
118   * restrictions. * Restrictions can be combined by the logical operator `OR`. *
119   * A restriction has the form of `{field} {operator} {value}`. * The operator
120   * must be `EQUALS (=)`. * Supported fields: - `assignedInventorySourceId` The
121   * length of this field should be no more than 500 characters.
122   * @opt_param string orderBy Field by which to sort the list. Acceptable values
123   * are: * `assignedInventorySourceId` (default) The default sorting order is
124   * ascending. To specify descending order for a field, a suffix " desc" should
125   * be added to the field name. Example: `assignedInventorySourceId desc`.
126   * @opt_param int pageSize Requested page size. Must be between `1` and `100`.
127   * If unspecified will default to `100`. Returns error code `INVALID_ARGUMENT`
128   * if an invalid value is specified.
129   * @opt_param string pageToken A token identifying a page of results the server
130   * should return. Typically, this is the value of next_page_token returned from
131   * the previous call to `ListAssignedInventorySources` method. If not specified,
132   * the first page of results will be returned.
133   * @opt_param string partnerId The ID of the partner that has access to the
134   * assignment. If the parent inventory source group is advertiser-owned, the
135   * assignment cannot be accessed via a partner.
136   * @return ListAssignedInventorySourcesResponse
137   */
138  public function listInventorySourceGroupsAssignedInventorySources($inventorySourceGroupId, $optParams = [])
139  {
140    $params = ['inventorySourceGroupId' => $inventorySourceGroupId];
141    $params = array_merge($params, $optParams);
142    return $this->call('list', [$params], ListAssignedInventorySourcesResponse::class);
143  }
144}
145
146// Adding a class alias for backwards compatibility with the previous class name.
147class_alias(InventorySourceGroupsAssignedInventorySources::class, 'Google_Service_DisplayVideo_Resource_InventorySourceGroupsAssignedInventorySources');
148