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\Datafeed;
|
---|
21 | use Google\Service\ShoppingContent\DatafeedsCustomBatchRequest;
|
---|
22 | use Google\Service\ShoppingContent\DatafeedsCustomBatchResponse;
|
---|
23 | use Google\Service\ShoppingContent\DatafeedsFetchNowResponse;
|
---|
24 | use Google\Service\ShoppingContent\DatafeedsListResponse;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "datafeeds" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $contentService = new Google\Service\ShoppingContent(...);
|
---|
31 | * $datafeeds = $contentService->datafeeds;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class Datafeeds extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Deletes, fetches, gets, inserts and updates multiple datafeeds in a single
|
---|
38 | * request. (datafeeds.custombatch)
|
---|
39 | *
|
---|
40 | * @param DatafeedsCustomBatchRequest $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | * @return DatafeedsCustomBatchResponse
|
---|
43 | * @throws \Google\Service\Exception
|
---|
44 | */
|
---|
45 | public function custombatch(DatafeedsCustomBatchRequest $postBody, $optParams = [])
|
---|
46 | {
|
---|
47 | $params = ['postBody' => $postBody];
|
---|
48 | $params = array_merge($params, $optParams);
|
---|
49 | return $this->call('custombatch', [$params], DatafeedsCustomBatchResponse::class);
|
---|
50 | }
|
---|
51 | /**
|
---|
52 | * Deletes a datafeed configuration from your Merchant Center account.
|
---|
53 | * (datafeeds.delete)
|
---|
54 | *
|
---|
55 | * @param string $merchantId The ID of the account that manages the datafeed.
|
---|
56 | * This account cannot be a multi-client account.
|
---|
57 | * @param string $datafeedId The ID of the datafeed.
|
---|
58 | * @param array $optParams Optional parameters.
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function delete($merchantId, $datafeedId, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['merchantId' => $merchantId, 'datafeedId' => $datafeedId];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('delete', [$params]);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Invokes a fetch for the datafeed in your Merchant Center account. If you need
|
---|
69 | * to call this method more than once per day, we recommend you use the
|
---|
70 | * [Products service](https://developers.google.com/shopping-
|
---|
71 | * content/reference/rest/v2.1/products) to update your product data.
|
---|
72 | * (datafeeds.fetchnow)
|
---|
73 | *
|
---|
74 | * @param string $merchantId The ID of the account that manages the datafeed.
|
---|
75 | * This account cannot be a multi-client account.
|
---|
76 | * @param string $datafeedId The ID of the datafeed to be fetched.
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | * @return DatafeedsFetchNowResponse
|
---|
79 | * @throws \Google\Service\Exception
|
---|
80 | */
|
---|
81 | public function fetchnow($merchantId, $datafeedId, $optParams = [])
|
---|
82 | {
|
---|
83 | $params = ['merchantId' => $merchantId, 'datafeedId' => $datafeedId];
|
---|
84 | $params = array_merge($params, $optParams);
|
---|
85 | return $this->call('fetchnow', [$params], DatafeedsFetchNowResponse::class);
|
---|
86 | }
|
---|
87 | /**
|
---|
88 | * Retrieves a datafeed configuration from your Merchant Center account.
|
---|
89 | * (datafeeds.get)
|
---|
90 | *
|
---|
91 | * @param string $merchantId The ID of the account that manages the datafeed.
|
---|
92 | * This account cannot be a multi-client account.
|
---|
93 | * @param string $datafeedId The ID of the datafeed.
|
---|
94 | * @param array $optParams Optional parameters.
|
---|
95 | * @return Datafeed
|
---|
96 | * @throws \Google\Service\Exception
|
---|
97 | */
|
---|
98 | public function get($merchantId, $datafeedId, $optParams = [])
|
---|
99 | {
|
---|
100 | $params = ['merchantId' => $merchantId, 'datafeedId' => $datafeedId];
|
---|
101 | $params = array_merge($params, $optParams);
|
---|
102 | return $this->call('get', [$params], Datafeed::class);
|
---|
103 | }
|
---|
104 | /**
|
---|
105 | * Registers a datafeed configuration with your Merchant Center account.
|
---|
106 | * (datafeeds.insert)
|
---|
107 | *
|
---|
108 | * @param string $merchantId The ID of the account that manages the datafeed.
|
---|
109 | * This account cannot be a multi-client account.
|
---|
110 | * @param Datafeed $postBody
|
---|
111 | * @param array $optParams Optional parameters.
|
---|
112 | * @return Datafeed
|
---|
113 | * @throws \Google\Service\Exception
|
---|
114 | */
|
---|
115 | public function insert($merchantId, Datafeed $postBody, $optParams = [])
|
---|
116 | {
|
---|
117 | $params = ['merchantId' => $merchantId, 'postBody' => $postBody];
|
---|
118 | $params = array_merge($params, $optParams);
|
---|
119 | return $this->call('insert', [$params], Datafeed::class);
|
---|
120 | }
|
---|
121 | /**
|
---|
122 | * Lists the configurations for datafeeds in your Merchant Center account.
|
---|
123 | * (datafeeds.listDatafeeds)
|
---|
124 | *
|
---|
125 | * @param string $merchantId The ID of the account that manages the datafeeds.
|
---|
126 | * This account cannot be a multi-client account.
|
---|
127 | * @param array $optParams Optional parameters.
|
---|
128 | *
|
---|
129 | * @opt_param string maxResults The maximum number of products to return in the
|
---|
130 | * response, used for paging.
|
---|
131 | * @opt_param string pageToken The token returned by the previous request.
|
---|
132 | * @return DatafeedsListResponse
|
---|
133 | * @throws \Google\Service\Exception
|
---|
134 | */
|
---|
135 | public function listDatafeeds($merchantId, $optParams = [])
|
---|
136 | {
|
---|
137 | $params = ['merchantId' => $merchantId];
|
---|
138 | $params = array_merge($params, $optParams);
|
---|
139 | return $this->call('list', [$params], DatafeedsListResponse::class);
|
---|
140 | }
|
---|
141 | /**
|
---|
142 | * Updates a datafeed configuration of your Merchant Center account. Any fields
|
---|
143 | * that are not provided are deleted from the resource. (datafeeds.update)
|
---|
144 | *
|
---|
145 | * @param string $merchantId The ID of the account that manages the datafeed.
|
---|
146 | * This account cannot be a multi-client account.
|
---|
147 | * @param string $datafeedId The ID of the datafeed.
|
---|
148 | * @param Datafeed $postBody
|
---|
149 | * @param array $optParams Optional parameters.
|
---|
150 | * @return Datafeed
|
---|
151 | * @throws \Google\Service\Exception
|
---|
152 | */
|
---|
153 | public function update($merchantId, $datafeedId, Datafeed $postBody, $optParams = [])
|
---|
154 | {
|
---|
155 | $params = ['merchantId' => $merchantId, 'datafeedId' => $datafeedId, 'postBody' => $postBody];
|
---|
156 | $params = array_merge($params, $optParams);
|
---|
157 | return $this->call('update', [$params], Datafeed::class);
|
---|
158 | }
|
---|
159 | }
|
---|
160 |
|
---|
161 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
162 | class_alias(Datafeeds::class, 'Google_Service_ShoppingContent_Resource_Datafeeds');
|
---|