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\AdExchangeBuyer\Resource; 19 20use Google\Service\AdExchangeBuyer\AddOrderDealsRequest; 21use Google\Service\AdExchangeBuyer\AddOrderDealsResponse; 22use Google\Service\AdExchangeBuyer\DeleteOrderDealsRequest; 23use Google\Service\AdExchangeBuyer\DeleteOrderDealsResponse; 24use Google\Service\AdExchangeBuyer\EditAllOrderDealsRequest; 25use Google\Service\AdExchangeBuyer\EditAllOrderDealsResponse; 26use Google\Service\AdExchangeBuyer\GetOrderDealsResponse; 27 28/** 29 * The "marketplacedeals" collection of methods. 30 * Typical usage is: 31 * <code> 32 * $adexchangebuyerService = new Google\Service\AdExchangeBuyer(...); 33 * $marketplacedeals = $adexchangebuyerService->marketplacedeals; 34 * </code> 35 */ 36class Marketplacedeals extends \Google\Service\Resource 37{ 38 /** 39 * Delete the specified deals from the proposal (marketplacedeals.delete) 40 * 41 * @param string $proposalId The proposalId to delete deals from. 42 * @param DeleteOrderDealsRequest $postBody 43 * @param array $optParams Optional parameters. 44 * @return DeleteOrderDealsResponse 45 */ 46 public function delete($proposalId, DeleteOrderDealsRequest $postBody, $optParams = []) 47 { 48 $params = ['proposalId' => $proposalId, 'postBody' => $postBody]; 49 $params = array_merge($params, $optParams); 50 return $this->call('delete', [$params], DeleteOrderDealsResponse::class); 51 } 52 /** 53 * Add new deals for the specified proposal (marketplacedeals.insert) 54 * 55 * @param string $proposalId proposalId for which deals need to be added. 56 * @param AddOrderDealsRequest $postBody 57 * @param array $optParams Optional parameters. 58 * @return AddOrderDealsResponse 59 */ 60 public function insert($proposalId, AddOrderDealsRequest $postBody, $optParams = []) 61 { 62 $params = ['proposalId' => $proposalId, 'postBody' => $postBody]; 63 $params = array_merge($params, $optParams); 64 return $this->call('insert', [$params], AddOrderDealsResponse::class); 65 } 66 /** 67 * List all the deals for a given proposal 68 * (marketplacedeals.listMarketplacedeals) 69 * 70 * @param string $proposalId The proposalId to get deals for. To search across 71 * all proposals specify order_id = '-' as part of the URL. 72 * @param array $optParams Optional parameters. 73 * 74 * @opt_param string pqlQuery Query string to retrieve specific deals. 75 * @return GetOrderDealsResponse 76 */ 77 public function listMarketplacedeals($proposalId, $optParams = []) 78 { 79 $params = ['proposalId' => $proposalId]; 80 $params = array_merge($params, $optParams); 81 return $this->call('list', [$params], GetOrderDealsResponse::class); 82 } 83 /** 84 * Replaces all the deals in the proposal with the passed in deals 85 * (marketplacedeals.update) 86 * 87 * @param string $proposalId The proposalId to edit deals on. 88 * @param EditAllOrderDealsRequest $postBody 89 * @param array $optParams Optional parameters. 90 * @return EditAllOrderDealsResponse 91 */ 92 public function update($proposalId, EditAllOrderDealsRequest $postBody, $optParams = []) 93 { 94 $params = ['proposalId' => $proposalId, 'postBody' => $postBody]; 95 $params = array_merge($params, $optParams); 96 return $this->call('update', [$params], EditAllOrderDealsResponse::class); 97 } 98} 99 100// Adding a class alias for backwards compatibility with the previous class name. 101class_alias(Marketplacedeals::class, 'Google_Service_AdExchangeBuyer_Resource_Marketplacedeals'); 102