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\BatchUpdateDealsRequest;
|
---|
21 | use Google\Service\AuthorizedBuyersMarketplace\BatchUpdateDealsResponse;
|
---|
22 | use Google\Service\AuthorizedBuyersMarketplace\Deal;
|
---|
23 | use Google\Service\AuthorizedBuyersMarketplace\ListDealsResponse;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "deals" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $authorizedbuyersmarketplaceService = new Google\Service\AuthorizedBuyersMarketplace(...);
|
---|
30 | * $deals = $authorizedbuyersmarketplaceService->buyers_proposals_deals;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class BuyersProposalsDeals extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Batch updates multiple deals in the same proposal. (deals.batchUpdate)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. The name of the proposal containing the deals
|
---|
39 | * to batch update. Format: buyers/{accountId}/proposals/{proposalId}
|
---|
40 | * @param BatchUpdateDealsRequest $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | * @return BatchUpdateDealsResponse
|
---|
43 | * @throws \Google\Service\Exception
|
---|
44 | */
|
---|
45 | public function batchUpdate($parent, BatchUpdateDealsRequest $postBody, $optParams = [])
|
---|
46 | {
|
---|
47 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
48 | $params = array_merge($params, $optParams);
|
---|
49 | return $this->call('batchUpdate', [$params], BatchUpdateDealsResponse::class);
|
---|
50 | }
|
---|
51 | /**
|
---|
52 | * Gets a deal given its name. The deal is returned at its head revision.
|
---|
53 | * (deals.get)
|
---|
54 | *
|
---|
55 | * @param string $name Required. Format:
|
---|
56 | * buyers/{accountId}/proposals/{proposalId}/deals/{dealId}
|
---|
57 | * @param array $optParams Optional parameters.
|
---|
58 | * @return Deal
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function get($name, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['name' => $name];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('get', [$params], Deal::class);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Lists all deals in a proposal. To retrieve only the finalized revision deals
|
---|
69 | * regardless if a deal is being renegotiated, see the FinalizedDeals resource.
|
---|
70 | * (deals.listBuyersProposalsDeals)
|
---|
71 | *
|
---|
72 | * @param string $parent Required. The name of the proposal containing the deals
|
---|
73 | * to retrieve. Format: buyers/{accountId}/proposals/{proposalId}
|
---|
74 | * @param array $optParams Optional parameters.
|
---|
75 | *
|
---|
76 | * @opt_param int pageSize Requested page size. The server may return fewer
|
---|
77 | * results than requested. If requested more than 500, the server will return
|
---|
78 | * 500 results per page. If unspecified, the server will pick a default page
|
---|
79 | * size of 100.
|
---|
80 | * @opt_param string pageToken The page token as returned from
|
---|
81 | * ListDealsResponse.
|
---|
82 | * @return ListDealsResponse
|
---|
83 | * @throws \Google\Service\Exception
|
---|
84 | */
|
---|
85 | public function listBuyersProposalsDeals($parent, $optParams = [])
|
---|
86 | {
|
---|
87 | $params = ['parent' => $parent];
|
---|
88 | $params = array_merge($params, $optParams);
|
---|
89 | return $this->call('list', [$params], ListDealsResponse::class);
|
---|
90 | }
|
---|
91 | /**
|
---|
92 | * Updates the given deal at the buyer known revision number. If the server
|
---|
93 | * revision has advanced since the passed-in proposal.proposal_revision an
|
---|
94 | * ABORTED error message will be returned. The revision number is incremented by
|
---|
95 | * the server whenever the proposal or its constituent deals are updated. Note:
|
---|
96 | * The revision number is kept at a proposal level. The buyer of the API is
|
---|
97 | * expected to keep track of the revision number after the last update operation
|
---|
98 | * and send it in as part of the next update request. This way, if there are
|
---|
99 | * further changes on the server (for example, seller making new updates), then
|
---|
100 | * the server can detect conflicts and reject the proposed changes.
|
---|
101 | * (deals.patch)
|
---|
102 | *
|
---|
103 | * @param string $name Immutable. The unique identifier of the deal. Auto-
|
---|
104 | * generated by the server when a deal is created. Format:
|
---|
105 | * buyers/{accountId}/proposals/{proposalId}/deals/{dealId}
|
---|
106 | * @param Deal $postBody
|
---|
107 | * @param array $optParams Optional parameters.
|
---|
108 | *
|
---|
109 | * @opt_param string updateMask List of fields to be updated. If empty or
|
---|
110 | * unspecified, the service will update all fields populated in the update
|
---|
111 | * request excluding the output only fields and primitive fields with default
|
---|
112 | * value. Note that explicit field mask is required in order to reset a
|
---|
113 | * primitive field back to its default value, for example, false for boolean
|
---|
114 | * fields, 0 for integer fields. A special field mask consisting of a single
|
---|
115 | * path "*" can be used to indicate full replacement(the equivalent of PUT
|
---|
116 | * method), updatable fields unset or unspecified in the input will be cleared
|
---|
117 | * or set to default value. Output only fields will be ignored regardless of the
|
---|
118 | * value of updateMask.
|
---|
119 | * @return Deal
|
---|
120 | * @throws \Google\Service\Exception
|
---|
121 | */
|
---|
122 | public function patch($name, Deal $postBody, $optParams = [])
|
---|
123 | {
|
---|
124 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
125 | $params = array_merge($params, $optParams);
|
---|
126 | return $this->call('patch', [$params], Deal::class);
|
---|
127 | }
|
---|
128 | }
|
---|
129 |
|
---|
130 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
131 | class_alias(BuyersProposalsDeals::class, 'Google_Service_AuthorizedBuyersMarketplace_Resource_BuyersProposalsDeals');
|
---|