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\AuthorizedBuyersMarketplace\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\AuthorizedBuyersMarketplace\AddCreativeRequest;
|
---|
21 | use Google\Service\AuthorizedBuyersMarketplace\FinalizedDeal;
|
---|
22 | use Google\Service\AuthorizedBuyersMarketplace\ListFinalizedDealsResponse;
|
---|
23 | use Google\Service\AuthorizedBuyersMarketplace\PauseFinalizedDealRequest;
|
---|
24 | use Google\Service\AuthorizedBuyersMarketplace\ResumeFinalizedDealRequest;
|
---|
25 | use Google\Service\AuthorizedBuyersMarketplace\SetReadyToServeRequest;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * The "finalizedDeals" collection of methods.
|
---|
29 | * Typical usage is:
|
---|
30 | * <code>
|
---|
31 | * $authorizedbuyersmarketplaceService = new Google\Service\AuthorizedBuyersMarketplace(...);
|
---|
32 | * $finalizedDeals = $authorizedbuyersmarketplaceService->buyers_finalizedDeals;
|
---|
33 | * </code>
|
---|
34 | */
|
---|
35 | class BuyersFinalizedDeals extends \Google\Service\Resource
|
---|
36 | {
|
---|
37 | /**
|
---|
38 | * Add creative to be used in the bidding process for a finalized deal. For
|
---|
39 | * programmatic guaranteed deals, it's recommended that you associate at least
|
---|
40 | * one approved creative with the deal before calling SetReadyToServe, to help
|
---|
41 | * reduce the number of bid responses filtered because they don't contain
|
---|
42 | * approved creatives. Creatives successfully added to a deal can be found in
|
---|
43 | * the Realtime-bidding Creatives API creative.deal_ids. This method only
|
---|
44 | * applies to programmatic guaranteed deals. Maximum number of 1000 creatives
|
---|
45 | * can be added to a finalized deal. (finalizedDeals.addCreative)
|
---|
46 | *
|
---|
47 | * @param string $deal Required. Name of the finalized deal in the format of:
|
---|
48 | * `buyers/{accountId}/finalizedDeals/{dealId}`
|
---|
49 | * @param AddCreativeRequest $postBody
|
---|
50 | * @param array $optParams Optional parameters.
|
---|
51 | * @return FinalizedDeal
|
---|
52 | * @throws \Google\Service\Exception
|
---|
53 | */
|
---|
54 | public function addCreative($deal, AddCreativeRequest $postBody, $optParams = [])
|
---|
55 | {
|
---|
56 | $params = ['deal' => $deal, 'postBody' => $postBody];
|
---|
57 | $params = array_merge($params, $optParams);
|
---|
58 | return $this->call('addCreative', [$params], FinalizedDeal::class);
|
---|
59 | }
|
---|
60 | /**
|
---|
61 | * Gets a finalized deal given its name. (finalizedDeals.get)
|
---|
62 | *
|
---|
63 | * @param string $name Required. Format:
|
---|
64 | * `buyers/{accountId}/finalizedDeals/{dealId}`
|
---|
65 | * @param array $optParams Optional parameters.
|
---|
66 | * @return FinalizedDeal
|
---|
67 | * @throws \Google\Service\Exception
|
---|
68 | */
|
---|
69 | public function get($name, $optParams = [])
|
---|
70 | {
|
---|
71 | $params = ['name' => $name];
|
---|
72 | $params = array_merge($params, $optParams);
|
---|
73 | return $this->call('get', [$params], FinalizedDeal::class);
|
---|
74 | }
|
---|
75 | /**
|
---|
76 | * Lists finalized deals. Use the URL path
|
---|
77 | * "/v1/buyers/{accountId}/finalizedDeals" to list finalized deals for the
|
---|
78 | * current buyer and its clients. Bidders can use the URL path
|
---|
79 | * "/v1/bidders/{accountId}/finalizedDeals" to list finalized deals for the
|
---|
80 | * bidder, its buyers and all their clients.
|
---|
81 | * (finalizedDeals.listBuyersFinalizedDeals)
|
---|
82 | *
|
---|
83 | * @param string $parent Required. The buyer to list the finalized deals for, in
|
---|
84 | * the format: `buyers/{accountId}`. When used to list finalized deals for a
|
---|
85 | * bidder, its buyers and clients, in the format `bidders/{accountId}`.
|
---|
86 | * @param array $optParams Optional parameters.
|
---|
87 | *
|
---|
88 | * @opt_param string filter Optional query string using the [Cloud API list
|
---|
89 | * filtering syntax](https://developers.google.com/authorized-
|
---|
90 | * buyers/apis/guides/list-filters) Supported columns for filtering are: *
|
---|
91 | * deal.displayName * deal.dealType * deal.createTime * deal.updateTime *
|
---|
92 | * deal.flightStartTime * deal.flightEndTime * deal.eligibleSeatIds *
|
---|
93 | * dealServingStatus
|
---|
94 | * @opt_param string orderBy An optional query string to sort finalized deals
|
---|
95 | * using the [Cloud API sorting
|
---|
96 | * syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order).
|
---|
97 | * If no sort order is specified, results will be returned in an arbitrary
|
---|
98 | * order. Supported columns for sorting are: * deal.displayName *
|
---|
99 | * deal.createTime * deal.updateTime * deal.flightStartTime * deal.flightEndTime
|
---|
100 | * * rtbMetrics.bidRequests7Days * rtbMetrics.bids7Days *
|
---|
101 | * rtbMetrics.adImpressions7Days * rtbMetrics.bidRate7Days *
|
---|
102 | * rtbMetrics.filteredBidRate7Days * rtbMetrics.mustBidRateCurrentMonth
|
---|
103 | * @opt_param int pageSize Requested page size. The server may return fewer
|
---|
104 | * results than requested. If requested more than 500, the server will return
|
---|
105 | * 500 results per page. If unspecified, the server will pick a default page
|
---|
106 | * size of 100.
|
---|
107 | * @opt_param string pageToken The page token as returned from
|
---|
108 | * ListFinalizedDealsResponse.
|
---|
109 | * @return ListFinalizedDealsResponse
|
---|
110 | * @throws \Google\Service\Exception
|
---|
111 | */
|
---|
112 | public function listBuyersFinalizedDeals($parent, $optParams = [])
|
---|
113 | {
|
---|
114 | $params = ['parent' => $parent];
|
---|
115 | $params = array_merge($params, $optParams);
|
---|
116 | return $this->call('list', [$params], ListFinalizedDealsResponse::class);
|
---|
117 | }
|
---|
118 | /**
|
---|
119 | * Pauses serving of the given finalized deal. This call only pauses the serving
|
---|
120 | * status, and does not affect other fields of the finalized deal. Calling this
|
---|
121 | * method for an already paused deal has no effect. This method only applies to
|
---|
122 | * programmatic guaranteed deals and preferred deals. (finalizedDeals.pause)
|
---|
123 | *
|
---|
124 | * @param string $name Required. Format:
|
---|
125 | * `buyers/{accountId}/finalizedDeals/{dealId}`
|
---|
126 | * @param PauseFinalizedDealRequest $postBody
|
---|
127 | * @param array $optParams Optional parameters.
|
---|
128 | * @return FinalizedDeal
|
---|
129 | * @throws \Google\Service\Exception
|
---|
130 | */
|
---|
131 | public function pause($name, PauseFinalizedDealRequest $postBody, $optParams = [])
|
---|
132 | {
|
---|
133 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
134 | $params = array_merge($params, $optParams);
|
---|
135 | return $this->call('pause', [$params], FinalizedDeal::class);
|
---|
136 | }
|
---|
137 | /**
|
---|
138 | * Resumes serving of the given finalized deal. Calling this method for an
|
---|
139 | * running deal has no effect. If a deal is initially paused by the seller,
|
---|
140 | * calling this method will not resume serving of the deal until the seller also
|
---|
141 | * resumes the deal. This method only applies to programmatic guaranteed deals
|
---|
142 | * and preferred deals. (finalizedDeals.resume)
|
---|
143 | *
|
---|
144 | * @param string $name Required. Format:
|
---|
145 | * `buyers/{accountId}/finalizedDeals/{dealId}`
|
---|
146 | * @param ResumeFinalizedDealRequest $postBody
|
---|
147 | * @param array $optParams Optional parameters.
|
---|
148 | * @return FinalizedDeal
|
---|
149 | * @throws \Google\Service\Exception
|
---|
150 | */
|
---|
151 | public function resume($name, ResumeFinalizedDealRequest $postBody, $optParams = [])
|
---|
152 | {
|
---|
153 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
154 | $params = array_merge($params, $optParams);
|
---|
155 | return $this->call('resume', [$params], FinalizedDeal::class);
|
---|
156 | }
|
---|
157 | /**
|
---|
158 | * Sets the given finalized deal as ready to serve. By default, deals are set as
|
---|
159 | * ready to serve as soon as they're finalized. If you want to opt out of the
|
---|
160 | * default behavior, and manually indicate that deals are ready to serve, ask
|
---|
161 | * your Technical Account Manager to add you to the allowlist. If you choose to
|
---|
162 | * use this method, finalized deals belonging to the bidder and its child seats
|
---|
163 | * don't start serving until after you call `setReadyToServe`, and after the
|
---|
164 | * deals become active. For example, you can use this method to delay receiving
|
---|
165 | * bid requests until your creative is ready. This method only applies to
|
---|
166 | * programmatic guaranteed deals. (finalizedDeals.setReadyToServe)
|
---|
167 | *
|
---|
168 | * @param string $deal Required. Format:
|
---|
169 | * `buyers/{accountId}/finalizedDeals/{dealId}`
|
---|
170 | * @param SetReadyToServeRequest $postBody
|
---|
171 | * @param array $optParams Optional parameters.
|
---|
172 | * @return FinalizedDeal
|
---|
173 | * @throws \Google\Service\Exception
|
---|
174 | */
|
---|
175 | public function setReadyToServe($deal, SetReadyToServeRequest $postBody, $optParams = [])
|
---|
176 | {
|
---|
177 | $params = ['deal' => $deal, 'postBody' => $postBody];
|
---|
178 | $params = array_merge($params, $optParams);
|
---|
179 | return $this->call('setReadyToServe', [$params], FinalizedDeal::class);
|
---|
180 | }
|
---|
181 | }
|
---|
182 |
|
---|
183 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
184 | class_alias(BuyersFinalizedDeals::class, 'Google_Service_AuthorizedBuyersMarketplace_Resource_BuyersFinalizedDeals');
|
---|