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\AuthorizedBuyersMarketplace\Resource; 19 20use Google\Service\AuthorizedBuyersMarketplace\AuctionPackage; 21use Google\Service\AuthorizedBuyersMarketplace\ListAuctionPackagesResponse; 22use Google\Service\AuthorizedBuyersMarketplace\SubscribeAuctionPackageRequest; 23use Google\Service\AuthorizedBuyersMarketplace\SubscribeClientsRequest; 24use Google\Service\AuthorizedBuyersMarketplace\UnsubscribeAuctionPackageRequest; 25use Google\Service\AuthorizedBuyersMarketplace\UnsubscribeClientsRequest; 26 27/** 28 * The "auctionPackages" collection of methods. 29 * Typical usage is: 30 * <code> 31 * $authorizedbuyersmarketplaceService = new Google\Service\AuthorizedBuyersMarketplace(...); 32 * $auctionPackages = $authorizedbuyersmarketplaceService->auctionPackages; 33 * </code> 34 */ 35class BuyersAuctionPackages extends \Google\Service\Resource 36{ 37 /** 38 * Gets an auction package given its name. (auctionPackages.get) 39 * 40 * @param string $name Required. Name of auction package to get. Format: 41 * `buyers/{accountId}/auctionPackages/{auctionPackageId}` 42 * @param array $optParams Optional parameters. 43 * @return AuctionPackage 44 */ 45 public function get($name, $optParams = []) 46 { 47 $params = ['name' => $name]; 48 $params = array_merge($params, $optParams); 49 return $this->call('get', [$params], AuctionPackage::class); 50 } 51 /** 52 * List the auction packages subscribed by a buyer and its clients. 53 * (auctionPackages.listBuyersAuctionPackages) 54 * 55 * @param string $parent Required. Name of the parent buyer that can access the 56 * auction package. Format: `buyers/{accountId}` 57 * @param array $optParams Optional parameters. 58 * 59 * @opt_param int pageSize Requested page size. The server may return fewer 60 * results than requested. Max allowed page size is 500. 61 * @opt_param string pageToken The page token as returned. 62 * ListAuctionPackagesResponse.nextPageToken 63 * @return ListAuctionPackagesResponse 64 */ 65 public function listBuyersAuctionPackages($parent, $optParams = []) 66 { 67 $params = ['parent' => $parent]; 68 $params = array_merge($params, $optParams); 69 return $this->call('list', [$params], ListAuctionPackagesResponse::class); 70 } 71 /** 72 * Subscribe to the auction package for the specified buyer. Once subscribed, 73 * the bidder will receive a call out for inventory matching the auction package 74 * targeting criteria with the auction package deal ID and the specified buyer. 75 * (auctionPackages.subscribe) 76 * 77 * @param string $name Required. Name of the auction package. Format: 78 * `buyers/{accountId}/auctionPackages/{auctionPackageId}` 79 * @param SubscribeAuctionPackageRequest $postBody 80 * @param array $optParams Optional parameters. 81 * @return AuctionPackage 82 */ 83 public function subscribe($name, SubscribeAuctionPackageRequest $postBody, $optParams = []) 84 { 85 $params = ['name' => $name, 'postBody' => $postBody]; 86 $params = array_merge($params, $optParams); 87 return $this->call('subscribe', [$params], AuctionPackage::class); 88 } 89 /** 90 * Subscribe the specified clients of the buyer to the auction package. If a 91 * client in the list does not belong to the buyer, an error response will be 92 * returned, and all of the following clients in the list will not be 93 * subscribed. Subscribing an already subscribed client will have no effect. 94 * (auctionPackages.subscribeClients) 95 * 96 * @param string $auctionPackage Required. Name of the auction package. Format: 97 * `buyers/{accountId}/auctionPackages/{auctionPackageId}` 98 * @param SubscribeClientsRequest $postBody 99 * @param array $optParams Optional parameters. 100 * @return AuctionPackage 101 */ 102 public function subscribeClients($auctionPackage, SubscribeClientsRequest $postBody, $optParams = []) 103 { 104 $params = ['auctionPackage' => $auctionPackage, 'postBody' => $postBody]; 105 $params = array_merge($params, $optParams); 106 return $this->call('subscribeClients', [$params], AuctionPackage::class); 107 } 108 /** 109 * Unsubscribe from the auction package for the specified buyer. Once 110 * unsubscribed, the bidder will no longer receive a call out for the auction 111 * package deal ID and the specified buyer. (auctionPackages.unsubscribe) 112 * 113 * @param string $name Required. Name of the auction package. Format: 114 * `buyers/{accountId}/auctionPackages/{auctionPackageId}` 115 * @param UnsubscribeAuctionPackageRequest $postBody 116 * @param array $optParams Optional parameters. 117 * @return AuctionPackage 118 */ 119 public function unsubscribe($name, UnsubscribeAuctionPackageRequest $postBody, $optParams = []) 120 { 121 $params = ['name' => $name, 'postBody' => $postBody]; 122 $params = array_merge($params, $optParams); 123 return $this->call('unsubscribe', [$params], AuctionPackage::class); 124 } 125 /** 126 * Unsubscribe from the auction package for the specified clients of the buyer. 127 * Unsubscribing a client that is not subscribed will have no effect. 128 * (auctionPackages.unsubscribeClients) 129 * 130 * @param string $auctionPackage Required. Name of the auction package. Format: 131 * `buyers/{accountId}/auctionPackages/{auctionPackageId}` 132 * @param UnsubscribeClientsRequest $postBody 133 * @param array $optParams Optional parameters. 134 * @return AuctionPackage 135 */ 136 public function unsubscribeClients($auctionPackage, UnsubscribeClientsRequest $postBody, $optParams = []) 137 { 138 $params = ['auctionPackage' => $auctionPackage, 'postBody' => $postBody]; 139 $params = array_merge($params, $optParams); 140 return $this->call('unsubscribeClients', [$params], AuctionPackage::class); 141 } 142} 143 144// Adding a class alias for backwards compatibility with the previous class name. 145class_alias(BuyersAuctionPackages::class, 'Google_Service_AuthorizedBuyersMarketplace_Resource_BuyersAuctionPackages'); 146