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\AcceptProposalRequest;
|
---|
21 | use Google\Service\AuthorizedBuyersMarketplace\AddNoteRequest;
|
---|
22 | use Google\Service\AuthorizedBuyersMarketplace\CancelNegotiationRequest;
|
---|
23 | use Google\Service\AuthorizedBuyersMarketplace\ListProposalsResponse;
|
---|
24 | use Google\Service\AuthorizedBuyersMarketplace\Proposal;
|
---|
25 | use Google\Service\AuthorizedBuyersMarketplace\SendRfpRequest;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * The "proposals" collection of methods.
|
---|
29 | * Typical usage is:
|
---|
30 | * <code>
|
---|
31 | * $authorizedbuyersmarketplaceService = new Google\Service\AuthorizedBuyersMarketplace(...);
|
---|
32 | * $proposals = $authorizedbuyersmarketplaceService->buyers_proposals;
|
---|
33 | * </code>
|
---|
34 | */
|
---|
35 | class BuyersProposals extends \Google\Service\Resource
|
---|
36 | {
|
---|
37 | /**
|
---|
38 | * Accepts the proposal at the given revision number. If the revision number in
|
---|
39 | * the request is behind the latest from the server, an error message will be
|
---|
40 | * returned. This call updates the Proposal.state from
|
---|
41 | * `BUYER_ACCEPTANCE_REQUESTED` to `FINALIZED`; it has no side effect if the
|
---|
42 | * Proposal.state is already `FINALIZED` and throws exception if the
|
---|
43 | * Proposal.state is not either `BUYER_ACCEPTANCE_REQUESTED` or `FINALIZED`.
|
---|
44 | * Accepting a proposal means the buyer understands and accepts the
|
---|
45 | * Proposal.terms_and_conditions proposed by the seller. (proposals.accept)
|
---|
46 | *
|
---|
47 | * @param string $name Name of the proposal. Format:
|
---|
48 | * `buyers/{accountId}/proposals/{proposalId}`
|
---|
49 | * @param AcceptProposalRequest $postBody
|
---|
50 | * @param array $optParams Optional parameters.
|
---|
51 | * @return Proposal
|
---|
52 | * @throws \Google\Service\Exception
|
---|
53 | */
|
---|
54 | public function accept($name, AcceptProposalRequest $postBody, $optParams = [])
|
---|
55 | {
|
---|
56 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
57 | $params = array_merge($params, $optParams);
|
---|
58 | return $this->call('accept', [$params], Proposal::class);
|
---|
59 | }
|
---|
60 | /**
|
---|
61 | * Creates a note for this proposal and sends to the seller. This method is not
|
---|
62 | * supported for proposals with DealType set to 'PRIVATE_AUCTION'.
|
---|
63 | * (proposals.addNote)
|
---|
64 | *
|
---|
65 | * @param string $proposal Name of the proposal. Format:
|
---|
66 | * `buyers/{accountId}/proposals/{proposalId}`
|
---|
67 | * @param AddNoteRequest $postBody
|
---|
68 | * @param array $optParams Optional parameters.
|
---|
69 | * @return Proposal
|
---|
70 | * @throws \Google\Service\Exception
|
---|
71 | */
|
---|
72 | public function addNote($proposal, AddNoteRequest $postBody, $optParams = [])
|
---|
73 | {
|
---|
74 | $params = ['proposal' => $proposal, 'postBody' => $postBody];
|
---|
75 | $params = array_merge($params, $optParams);
|
---|
76 | return $this->call('addNote', [$params], Proposal::class);
|
---|
77 | }
|
---|
78 | /**
|
---|
79 | * Cancels an ongoing negotiation on a proposal. This does not cancel or end
|
---|
80 | * serving for the deals if the proposal has been finalized. If the proposal has
|
---|
81 | * not been finalized before, calling this method will set the Proposal.state to
|
---|
82 | * `TERMINATED` and increment the Proposal.proposal_revision. If the proposal
|
---|
83 | * has been finalized before and is under renegotiation now, calling this method
|
---|
84 | * will reset the Proposal.state to `FINALIZED` and increment the
|
---|
85 | * Proposal.proposal_revision. This method does not support private auction
|
---|
86 | * proposals whose Proposal.deal_type is 'PRIVATE_AUCTION'.
|
---|
87 | * (proposals.cancelNegotiation)
|
---|
88 | *
|
---|
89 | * @param string $proposal Name of the proposal. Format:
|
---|
90 | * `buyers/{accountId}/proposals/{proposalId}`
|
---|
91 | * @param CancelNegotiationRequest $postBody
|
---|
92 | * @param array $optParams Optional parameters.
|
---|
93 | * @return Proposal
|
---|
94 | * @throws \Google\Service\Exception
|
---|
95 | */
|
---|
96 | public function cancelNegotiation($proposal, CancelNegotiationRequest $postBody, $optParams = [])
|
---|
97 | {
|
---|
98 | $params = ['proposal' => $proposal, 'postBody' => $postBody];
|
---|
99 | $params = array_merge($params, $optParams);
|
---|
100 | return $this->call('cancelNegotiation', [$params], Proposal::class);
|
---|
101 | }
|
---|
102 | /**
|
---|
103 | * Gets a proposal using its resource name. The proposal is returned at the
|
---|
104 | * latest revision. (proposals.get)
|
---|
105 | *
|
---|
106 | * @param string $name Required. Name of the proposal. Format:
|
---|
107 | * `buyers/{accountId}/proposals/{proposalId}`
|
---|
108 | * @param array $optParams Optional parameters.
|
---|
109 | * @return Proposal
|
---|
110 | * @throws \Google\Service\Exception
|
---|
111 | */
|
---|
112 | public function get($name, $optParams = [])
|
---|
113 | {
|
---|
114 | $params = ['name' => $name];
|
---|
115 | $params = array_merge($params, $optParams);
|
---|
116 | return $this->call('get', [$params], Proposal::class);
|
---|
117 | }
|
---|
118 | /**
|
---|
119 | * Lists proposals. A filter expression using [Cloud API list filtering
|
---|
120 | * syntax](https://developers.google.com/authorized-buyers/apis/guides/list-
|
---|
121 | * filters) may be specified to filter the results.
|
---|
122 | * (proposals.listBuyersProposals)
|
---|
123 | *
|
---|
124 | * @param string $parent Required. Parent that owns the collection of proposals
|
---|
125 | * Format: `buyers/{accountId}`
|
---|
126 | * @param array $optParams Optional parameters.
|
---|
127 | *
|
---|
128 | * @opt_param string filter Optional query string using the [Cloud API list
|
---|
129 | * filtering syntax](https://developers.google.com/authorized-
|
---|
130 | * buyers/apis/guides/list-filters) Supported columns for filtering are: *
|
---|
131 | * displayName * dealType * updateTime * state
|
---|
132 | * @opt_param int pageSize Requested page size. The server may return fewer
|
---|
133 | * results than requested. If unspecified, the server will put a size of 500.
|
---|
134 | * @opt_param string pageToken The page token as returned from
|
---|
135 | * ListProposalsResponse.
|
---|
136 | * @return ListProposalsResponse
|
---|
137 | * @throws \Google\Service\Exception
|
---|
138 | */
|
---|
139 | public function listBuyersProposals($parent, $optParams = [])
|
---|
140 | {
|
---|
141 | $params = ['parent' => $parent];
|
---|
142 | $params = array_merge($params, $optParams);
|
---|
143 | return $this->call('list', [$params], ListProposalsResponse::class);
|
---|
144 | }
|
---|
145 | /**
|
---|
146 | * Updates the proposal at the given revision number. If the revision number in
|
---|
147 | * the request is behind the latest one kept in the server, an error message
|
---|
148 | * will be returned. See FieldMask for how to use FieldMask. Only fields
|
---|
149 | * specified in the UpdateProposalRequest.update_mask will be updated; Fields
|
---|
150 | * noted as 'Immutable' or 'Output only' yet specified in the
|
---|
151 | * UpdateProposalRequest.update_mask will be ignored and left unchanged.
|
---|
152 | * Updating a private auction proposal is not allowed and will result in an
|
---|
153 | * error. (proposals.patch)
|
---|
154 | *
|
---|
155 | * @param string $name Immutable. The name of the proposal serving as a unique
|
---|
156 | * identifier. Format: buyers/{accountId}/proposals/{proposalId}
|
---|
157 | * @param Proposal $postBody
|
---|
158 | * @param array $optParams Optional parameters.
|
---|
159 | *
|
---|
160 | * @opt_param string updateMask List of fields to be updated. If empty or
|
---|
161 | * unspecified, the service will update all fields populated in the update
|
---|
162 | * request excluding the output only fields and primitive fields with default
|
---|
163 | * value. Note that explicit field mask is required in order to reset a
|
---|
164 | * primitive field back to its default value, for example, false for boolean
|
---|
165 | * fields, 0 for integer fields. A special field mask consisting of a single
|
---|
166 | * path "*" can be used to indicate full replacement(the equivalent of PUT
|
---|
167 | * method), updatable fields unset or unspecified in the input will be cleared
|
---|
168 | * or set to default value. Output only fields will be ignored regardless of the
|
---|
169 | * value of updateMask.
|
---|
170 | * @return Proposal
|
---|
171 | * @throws \Google\Service\Exception
|
---|
172 | */
|
---|
173 | public function patch($name, Proposal $postBody, $optParams = [])
|
---|
174 | {
|
---|
175 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
176 | $params = array_merge($params, $optParams);
|
---|
177 | return $this->call('patch', [$params], Proposal::class);
|
---|
178 | }
|
---|
179 | /**
|
---|
180 | * Sends a request for proposal (RFP) to a publisher to initiate the negotiation
|
---|
181 | * regarding certain inventory. In the RFP, buyers can specify the deal type,
|
---|
182 | * deal terms, start and end dates, targeting, and a message to the publisher.
|
---|
183 | * Once the RFP is sent, a proposal in `SELLER_REVIEW_REQUESTED` state will be
|
---|
184 | * created and returned in the response. The publisher may review your request
|
---|
185 | * and respond with detailed deals in the proposal. (proposals.sendRfp)
|
---|
186 | *
|
---|
187 | * @param string $buyer Required. The current buyer who is sending the RFP in
|
---|
188 | * the format: `buyers/{accountId}`.
|
---|
189 | * @param SendRfpRequest $postBody
|
---|
190 | * @param array $optParams Optional parameters.
|
---|
191 | * @return Proposal
|
---|
192 | * @throws \Google\Service\Exception
|
---|
193 | */
|
---|
194 | public function sendRfp($buyer, SendRfpRequest $postBody, $optParams = [])
|
---|
195 | {
|
---|
196 | $params = ['buyer' => $buyer, 'postBody' => $postBody];
|
---|
197 | $params = array_merge($params, $optParams);
|
---|
198 | return $this->call('sendRfp', [$params], Proposal::class);
|
---|
199 | }
|
---|
200 | }
|
---|
201 |
|
---|
202 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
203 | class_alias(BuyersProposals::class, 'Google_Service_AuthorizedBuyersMarketplace_Resource_BuyersProposals');
|
---|