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