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\EditGuaranteedOrderReadAccessorsRequest;
|
---|
21 | use Google\Service\DisplayVideo\EditGuaranteedOrderReadAccessorsResponse;
|
---|
22 | use Google\Service\DisplayVideo\GuaranteedOrder;
|
---|
23 | use Google\Service\DisplayVideo\ListGuaranteedOrdersResponse;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "guaranteedOrders" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $displayvideoService = new Google\Service\DisplayVideo(...);
|
---|
30 | * $guaranteedOrders = $displayvideoService->guaranteedOrders;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class GuaranteedOrders extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Creates a new guaranteed order. Returns the newly created guaranteed order if
|
---|
37 | * successful. (guaranteedOrders.create)
|
---|
38 | *
|
---|
39 | * @param GuaranteedOrder $postBody
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | *
|
---|
42 | * @opt_param string advertiserId The ID of the advertiser that the request is
|
---|
43 | * being made within.
|
---|
44 | * @opt_param string partnerId The ID of the partner that the request is being
|
---|
45 | * made within.
|
---|
46 | * @return GuaranteedOrder
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function create(GuaranteedOrder $postBody, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['postBody' => $postBody];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('create', [$params], GuaranteedOrder::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Edits read advertisers of a guaranteed order.
|
---|
57 | * (guaranteedOrders.editGuaranteedOrderReadAccessors)
|
---|
58 | *
|
---|
59 | * @param string $guaranteedOrderId Required. The ID of the guaranteed order to
|
---|
60 | * edit. The ID is of the format `{exchange}-{legacy_guaranteed_order_id}`
|
---|
61 | * @param EditGuaranteedOrderReadAccessorsRequest $postBody
|
---|
62 | * @param array $optParams Optional parameters.
|
---|
63 | * @return EditGuaranteedOrderReadAccessorsResponse
|
---|
64 | * @throws \Google\Service\Exception
|
---|
65 | */
|
---|
66 | public function editGuaranteedOrderReadAccessors($guaranteedOrderId, EditGuaranteedOrderReadAccessorsRequest $postBody, $optParams = [])
|
---|
67 | {
|
---|
68 | $params = ['guaranteedOrderId' => $guaranteedOrderId, 'postBody' => $postBody];
|
---|
69 | $params = array_merge($params, $optParams);
|
---|
70 | return $this->call('editGuaranteedOrderReadAccessors', [$params], EditGuaranteedOrderReadAccessorsResponse::class);
|
---|
71 | }
|
---|
72 | /**
|
---|
73 | * Gets a guaranteed order. (guaranteedOrders.get)
|
---|
74 | *
|
---|
75 | * @param string $guaranteedOrderId Required. The ID of the guaranteed order to
|
---|
76 | * fetch. The ID is of the format `{exchange}-{legacy_guaranteed_order_id}`
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | *
|
---|
79 | * @opt_param string advertiserId The ID of the advertiser that has access to
|
---|
80 | * the guaranteed order.
|
---|
81 | * @opt_param string partnerId The ID of the partner that has access to the
|
---|
82 | * guaranteed order.
|
---|
83 | * @return GuaranteedOrder
|
---|
84 | * @throws \Google\Service\Exception
|
---|
85 | */
|
---|
86 | public function get($guaranteedOrderId, $optParams = [])
|
---|
87 | {
|
---|
88 | $params = ['guaranteedOrderId' => $guaranteedOrderId];
|
---|
89 | $params = array_merge($params, $optParams);
|
---|
90 | return $this->call('get', [$params], GuaranteedOrder::class);
|
---|
91 | }
|
---|
92 | /**
|
---|
93 | * Lists guaranteed orders that are accessible to the current user. The order is
|
---|
94 | * defined by the order_by parameter. If a filter by entity_status is not
|
---|
95 | * specified, guaranteed orders with entity status `ENTITY_STATUS_ARCHIVED` will
|
---|
96 | * not be included in the results. (guaranteedOrders.listGuaranteedOrders)
|
---|
97 | *
|
---|
98 | * @param array $optParams Optional parameters.
|
---|
99 | *
|
---|
100 | * @opt_param string advertiserId The ID of the advertiser that has access to
|
---|
101 | * the guaranteed order.
|
---|
102 | * @opt_param string filter Allows filtering by guaranteed order fields. *
|
---|
103 | * Filter expressions are made up of one or more restrictions. * Restrictions
|
---|
104 | * can be combined by `AND` or `OR` logical operators. A sequence of
|
---|
105 | * restrictions implicitly uses `AND`. * A restriction has the form of `{field}
|
---|
106 | * {operator} {value}`. * All fields must use the `EQUALS (=)` operator.
|
---|
107 | * Supported fields: * `guaranteed_order_id` * `exchange` * `display_name` *
|
---|
108 | * `status.entityStatus` Examples: * All active guaranteed orders:
|
---|
109 | * `status.entityStatus="ENTITY_STATUS_ACTIVE"` * Guaranteed orders belonging to
|
---|
110 | * Google Ad Manager or Rubicon exchanges:
|
---|
111 | * `exchange="EXCHANGE_GOOGLE_AD_MANAGER" OR exchange="EXCHANGE_RUBICON"` The
|
---|
112 | * length of this field should be no more than 500 characters. Reference our
|
---|
113 | * [filter `LIST` requests](/display-video/api/guides/how-tos/filters) guide for
|
---|
114 | * more information.
|
---|
115 | * @opt_param string orderBy Field by which to sort the list. Acceptable values
|
---|
116 | * are: * `displayName` (default) The default sorting order is ascending. To
|
---|
117 | * specify descending order for a field, a suffix "desc" should be added to the
|
---|
118 | * field name. For example, `displayName desc`.
|
---|
119 | * @opt_param int pageSize Requested page size. Must be between `1` and `200`.
|
---|
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 `ListGuaranteedOrders` 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 | * guaranteed order.
|
---|
127 | * @return ListGuaranteedOrdersResponse
|
---|
128 | * @throws \Google\Service\Exception
|
---|
129 | */
|
---|
130 | public function listGuaranteedOrders($optParams = [])
|
---|
131 | {
|
---|
132 | $params = [];
|
---|
133 | $params = array_merge($params, $optParams);
|
---|
134 | return $this->call('list', [$params], ListGuaranteedOrdersResponse::class);
|
---|
135 | }
|
---|
136 | /**
|
---|
137 | * Updates an existing guaranteed order. Returns the updated guaranteed order if
|
---|
138 | * successful. (guaranteedOrders.patch)
|
---|
139 | *
|
---|
140 | * @param string $guaranteedOrderId Output only. The unique identifier of the
|
---|
141 | * guaranteed order. The guaranteed order IDs have the format
|
---|
142 | * `{exchange}-{legacy_guaranteed_order_id}`.
|
---|
143 | * @param GuaranteedOrder $postBody
|
---|
144 | * @param array $optParams Optional parameters.
|
---|
145 | *
|
---|
146 | * @opt_param string advertiserId The ID of the advertiser that the request is
|
---|
147 | * being made within.
|
---|
148 | * @opt_param string partnerId The ID of the partner that the request is being
|
---|
149 | * made within.
|
---|
150 | * @opt_param string updateMask Required. The mask to control which fields to
|
---|
151 | * update.
|
---|
152 | * @return GuaranteedOrder
|
---|
153 | * @throws \Google\Service\Exception
|
---|
154 | */
|
---|
155 | public function patch($guaranteedOrderId, GuaranteedOrder $postBody, $optParams = [])
|
---|
156 | {
|
---|
157 | $params = ['guaranteedOrderId' => $guaranteedOrderId, 'postBody' => $postBody];
|
---|
158 | $params = array_merge($params, $optParams);
|
---|
159 | return $this->call('patch', [$params], GuaranteedOrder::class);
|
---|
160 | }
|
---|
161 | }
|
---|
162 |
|
---|
163 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
164 | class_alias(GuaranteedOrders::class, 'Google_Service_DisplayVideo_Resource_GuaranteedOrders');
|
---|