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\ShoppingContent\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\ShoppingContent\ActivateBuyOnGoogleProgramRequest;
|
---|
21 | use Google\Service\ShoppingContent\BuyOnGoogleProgramStatus;
|
---|
22 | use Google\Service\ShoppingContent\OnboardBuyOnGoogleProgramRequest;
|
---|
23 | use Google\Service\ShoppingContent\PauseBuyOnGoogleProgramRequest;
|
---|
24 | use Google\Service\ShoppingContent\RequestReviewBuyOnGoogleProgramRequest;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "buyongoogleprograms" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $contentService = new Google\Service\ShoppingContent(...);
|
---|
31 | * $buyongoogleprograms = $contentService->buyongoogleprograms;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class Buyongoogleprograms extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Reactivates the BoG program in your Merchant Center account. Moves the
|
---|
38 | * program to the active state when allowed, for example, when paused. This
|
---|
39 | * method is only available to selected merchants.
|
---|
40 | * (buyongoogleprograms.activate)
|
---|
41 | *
|
---|
42 | * @param string $merchantId Required. The ID of the account.
|
---|
43 | * @param string $regionCode Required. The program region code [ISO 3166-1
|
---|
44 | * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US
|
---|
45 | * is available.
|
---|
46 | * @param ActivateBuyOnGoogleProgramRequest $postBody
|
---|
47 | * @param array $optParams Optional parameters.
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function activate($merchantId, $regionCode, ActivateBuyOnGoogleProgramRequest $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('activate', [$params]);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Retrieves a status of the BoG program for your Merchant Center account.
|
---|
58 | * (buyongoogleprograms.get)
|
---|
59 | *
|
---|
60 | * @param string $merchantId Required. The ID of the account.
|
---|
61 | * @param string $regionCode Required. The Program region code [ISO 3166-1
|
---|
62 | * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US
|
---|
63 | * is available.
|
---|
64 | * @param array $optParams Optional parameters.
|
---|
65 | * @return BuyOnGoogleProgramStatus
|
---|
66 | * @throws \Google\Service\Exception
|
---|
67 | */
|
---|
68 | public function get($merchantId, $regionCode, $optParams = [])
|
---|
69 | {
|
---|
70 | $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode];
|
---|
71 | $params = array_merge($params, $optParams);
|
---|
72 | return $this->call('get', [$params], BuyOnGoogleProgramStatus::class);
|
---|
73 | }
|
---|
74 | /**
|
---|
75 | * Onboards the BoG program in your Merchant Center account. By using this
|
---|
76 | * method, you agree to the [Terms of Service](https://merchants.google.com/mc/t
|
---|
77 | * ermsofservice/transactions/US/latest). Calling this method is only possible
|
---|
78 | * if the authenticated account is the same as the merchant id in the request.
|
---|
79 | * Calling this method multiple times will only accept Terms of Service if the
|
---|
80 | * latest version is not currently signed. (buyongoogleprograms.onboard)
|
---|
81 | *
|
---|
82 | * @param string $merchantId Required. The ID of the account.
|
---|
83 | * @param string $regionCode Required. The program region code [ISO 3166-1
|
---|
84 | * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US
|
---|
85 | * is available.
|
---|
86 | * @param OnboardBuyOnGoogleProgramRequest $postBody
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | * @throws \Google\Service\Exception
|
---|
89 | */
|
---|
90 | public function onboard($merchantId, $regionCode, OnboardBuyOnGoogleProgramRequest $postBody, $optParams = [])
|
---|
91 | {
|
---|
92 | $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode, 'postBody' => $postBody];
|
---|
93 | $params = array_merge($params, $optParams);
|
---|
94 | return $this->call('onboard', [$params]);
|
---|
95 | }
|
---|
96 | /**
|
---|
97 | * Updates the status of the BoG program for your Merchant Center account.
|
---|
98 | * (buyongoogleprograms.patch)
|
---|
99 | *
|
---|
100 | * @param string $merchantId Required. The ID of the account.
|
---|
101 | * @param string $regionCode Required. The program region code [ISO 3166-1
|
---|
102 | * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US
|
---|
103 | * is available.
|
---|
104 | * @param BuyOnGoogleProgramStatus $postBody
|
---|
105 | * @param array $optParams Optional parameters.
|
---|
106 | *
|
---|
107 | * @opt_param string updateMask The list of fields to update. If the update mask
|
---|
108 | * is not provided, then all the fields set in buyOnGoogleProgramStatus will be
|
---|
109 | * updated. Clearing fields is only possible if update mask is provided.
|
---|
110 | * @return BuyOnGoogleProgramStatus
|
---|
111 | * @throws \Google\Service\Exception
|
---|
112 | */
|
---|
113 | public function patch($merchantId, $regionCode, BuyOnGoogleProgramStatus $postBody, $optParams = [])
|
---|
114 | {
|
---|
115 | $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode, 'postBody' => $postBody];
|
---|
116 | $params = array_merge($params, $optParams);
|
---|
117 | return $this->call('patch', [$params], BuyOnGoogleProgramStatus::class);
|
---|
118 | }
|
---|
119 | /**
|
---|
120 | * Pauses the BoG program in your Merchant Center account. This method is only
|
---|
121 | * available to selected merchants. (buyongoogleprograms.pause)
|
---|
122 | *
|
---|
123 | * @param string $merchantId Required. The ID of the account.
|
---|
124 | * @param string $regionCode Required. The program region code [ISO 3166-1
|
---|
125 | * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US
|
---|
126 | * is available.
|
---|
127 | * @param PauseBuyOnGoogleProgramRequest $postBody
|
---|
128 | * @param array $optParams Optional parameters.
|
---|
129 | * @throws \Google\Service\Exception
|
---|
130 | */
|
---|
131 | public function pause($merchantId, $regionCode, PauseBuyOnGoogleProgramRequest $postBody, $optParams = [])
|
---|
132 | {
|
---|
133 | $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode, 'postBody' => $postBody];
|
---|
134 | $params = array_merge($params, $optParams);
|
---|
135 | return $this->call('pause', [$params]);
|
---|
136 | }
|
---|
137 | /**
|
---|
138 | * Requests review and then activates the BoG program in your Merchant Center
|
---|
139 | * account for the first time. Moves the program to the REVIEW_PENDING state.
|
---|
140 | * This method is only available to selected merchants.
|
---|
141 | * (buyongoogleprograms.requestreview)
|
---|
142 | *
|
---|
143 | * @param string $merchantId Required. The ID of the account.
|
---|
144 | * @param string $regionCode Required. The program region code [ISO 3166-1
|
---|
145 | * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US
|
---|
146 | * is available.
|
---|
147 | * @param RequestReviewBuyOnGoogleProgramRequest $postBody
|
---|
148 | * @param array $optParams Optional parameters.
|
---|
149 | * @throws \Google\Service\Exception
|
---|
150 | */
|
---|
151 | public function requestreview($merchantId, $regionCode, RequestReviewBuyOnGoogleProgramRequest $postBody, $optParams = [])
|
---|
152 | {
|
---|
153 | $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode, 'postBody' => $postBody];
|
---|
154 | $params = array_merge($params, $optParams);
|
---|
155 | return $this->call('requestreview', [$params]);
|
---|
156 | }
|
---|
157 | }
|
---|
158 |
|
---|
159 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
160 | class_alias(Buyongoogleprograms::class, 'Google_Service_ShoppingContent_Resource_Buyongoogleprograms');
|
---|