PageRenderTime 21ms CodeModel.GetById 21ms RepoModel.GetById 2ms app.codeStats 0ms

/vendor/google/apiclient-services/src/AuthorizedBuyersMarketplace/Resource/BuyersFinalizedDeals.php

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