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\DisplayvideoEmpty;
21use Google\Service\DisplayVideo\InventorySourceGroup;
22use Google\Service\DisplayVideo\ListInventorySourceGroupsResponse;
23
24/**
25 * The "inventorySourceGroups" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $displayvideoService = new Google\Service\DisplayVideo(...);
29 *   $inventorySourceGroups = $displayvideoService->inventorySourceGroups;
30 *  </code>
31 */
32class InventorySourceGroups extends \Google\Service\Resource
33{
34  /**
35   * Creates a new inventory source group. Returns the newly created inventory
36   * source group if successful. (inventorySourceGroups.create)
37   *
38   * @param InventorySourceGroup $postBody
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param string advertiserId The ID of the advertiser that owns the
42   * inventory source group. The parent partner will not have access to this
43   * group.
44   * @opt_param string partnerId The ID of the partner that owns the inventory
45   * source group. Only this partner will have write access to this group. Only
46   * advertisers to which this group is explicitly shared will have read access to
47   * this group.
48   * @return InventorySourceGroup
49   */
50  public function create(InventorySourceGroup $postBody, $optParams = [])
51  {
52    $params = ['postBody' => $postBody];
53    $params = array_merge($params, $optParams);
54    return $this->call('create', [$params], InventorySourceGroup::class);
55  }
56  /**
57   * Deletes an inventory source group. (inventorySourceGroups.delete)
58   *
59   * @param string $inventorySourceGroupId Required. The ID of the inventory
60   * source group to delete.
61   * @param array $optParams Optional parameters.
62   *
63   * @opt_param string advertiserId The ID of the advertiser that owns the
64   * inventory source group. The parent partner does not have access to this
65   * group.
66   * @opt_param string partnerId The ID of the partner that owns the inventory
67   * source group. Only this partner has write access to this group.
68   * @return DisplayvideoEmpty
69   */
70  public function delete($inventorySourceGroupId, $optParams = [])
71  {
72    $params = ['inventorySourceGroupId' => $inventorySourceGroupId];
73    $params = array_merge($params, $optParams);
74    return $this->call('delete', [$params], DisplayvideoEmpty::class);
75  }
76  /**
77   * Gets an inventory source group. (inventorySourceGroups.get)
78   *
79   * @param string $inventorySourceGroupId Required. The ID of the inventory
80   * source group to fetch.
81   * @param array $optParams Optional parameters.
82   *
83   * @opt_param string advertiserId The ID of the advertiser that has access to
84   * the inventory source group. If an inventory source group is partner-owned,
85   * only advertisers to which the group is explicitly shared can access the
86   * group.
87   * @opt_param string partnerId The ID of the partner that has access to the
88   * inventory source group. A partner cannot access an advertiser-owned inventory
89   * source group.
90   * @return InventorySourceGroup
91   */
92  public function get($inventorySourceGroupId, $optParams = [])
93  {
94    $params = ['inventorySourceGroupId' => $inventorySourceGroupId];
95    $params = array_merge($params, $optParams);
96    return $this->call('get', [$params], InventorySourceGroup::class);
97  }
98  /**
99   * Lists inventory source groups that are accessible to the current user. The
100   * order is defined by the order_by parameter.
101   * (inventorySourceGroups.listInventorySourceGroups)
102   *
103   * @param array $optParams Optional parameters.
104   *
105   * @opt_param string advertiserId The ID of the advertiser that has access to
106   * the inventory source group. If an inventory source group is partner-owned,
107   * only advertisers to which the group is explicitly shared can access the
108   * group.
109   * @opt_param string filter Allows filtering by inventory source group
110   * properties. Supported syntax: * Filter expressions are made up of one or more
111   * restrictions. * Restrictions can be combined by the logical operator `OR`. *
112   * A restriction has the form of `{field} {operator} {value}`. * The operator
113   * must be `EQUALS (=)`. * Supported fields: - `inventorySourceGroupId` The
114   * length of this field should be no more than 500 characters.
115   * @opt_param string orderBy Field by which to sort the list. Acceptable values
116   * are: * `displayName` (default) * `inventorySourceGroupId` The default sorting
117   * order is ascending. To specify descending order for a field, a suffix "desc"
118   * should be added to the field name. For example, `displayName desc`.
119   * @opt_param int pageSize Requested page size. Must be between `1` and `100`.
120   * If unspecified will default to `100`.
121   * @opt_param string pageToken A token identifying a page of results the server
122   * should return. Typically, this is the value of next_page_token returned from
123   * the previous call to `ListInventorySources` method. If not specified, the
124   * first page of results will be returned.
125   * @opt_param string partnerId The ID of the partner that has access to the
126   * inventory source group. A partner cannot access advertiser-owned inventory
127   * source groups.
128   * @return ListInventorySourceGroupsResponse
129   */
130  public function listInventorySourceGroups($optParams = [])
131  {
132    $params = [];
133    $params = array_merge($params, $optParams);
134    return $this->call('list', [$params], ListInventorySourceGroupsResponse::class);
135  }
136  /**
137   * Updates an inventory source group. Returns the updated inventory source group
138   * if successful. (inventorySourceGroups.patch)
139   *
140   * @param string $inventorySourceGroupId Output only. The unique ID of the
141   * inventory source group. Assigned by the system.
142   * @param InventorySourceGroup $postBody
143   * @param array $optParams Optional parameters.
144   *
145   * @opt_param string advertiserId The ID of the advertiser that owns the
146   * inventory source group. The parent partner does not have access to this
147   * group.
148   * @opt_param string partnerId The ID of the partner that owns the inventory
149   * source group. Only this partner has write access to this group.
150   * @opt_param string updateMask Required. The mask to control which fields to
151   * update.
152   * @return InventorySourceGroup
153   */
154  public function patch($inventorySourceGroupId, InventorySourceGroup $postBody, $optParams = [])
155  {
156    $params = ['inventorySourceGroupId' => $inventorySourceGroupId, 'postBody' => $postBody];
157    $params = array_merge($params, $optParams);
158    return $this->call('patch', [$params], InventorySourceGroup::class);
159  }
160}
161
162// Adding a class alias for backwards compatibility with the previous class name.
163class_alias(InventorySourceGroups::class, 'Google_Service_DisplayVideo_Resource_InventorySourceGroups');
164