source: vendor/google/apiclient-services/src/ShoppingContent/Resource/Collections.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 2 weeks ago

Upload project files

  • Property mode set to 100644
File size: 4.5 KB
Line 
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\ShoppingContent\Resource;
19
20use Google\Service\ShoppingContent\Collection;
21use Google\Service\ShoppingContent\ListCollectionsResponse;
22
23/**
24 * The "collections" collection of methods.
25 * Typical usage is:
26 * <code>
27 * $contentService = new Google\Service\ShoppingContent(...);
28 * $collections = $contentService->collections;
29 * </code>
30 */
31class Collections extends \Google\Service\Resource
32{
33 /**
34 * Uploads a collection to your Merchant Center account. If a collection with
35 * the same collectionId already exists, this method updates that entry. In each
36 * update, the collection is completely replaced by the fields in the body of
37 * the update request. (collections.create)
38 *
39 * @param string $merchantId Required. The ID of the account that contains the
40 * collection. This account cannot be a multi-client account.
41 * @param Collection $postBody
42 * @param array $optParams Optional parameters.
43 * @return Collection
44 * @throws \Google\Service\Exception
45 */
46 public function create($merchantId, Collection $postBody, $optParams = [])
47 {
48 $params = ['merchantId' => $merchantId, 'postBody' => $postBody];
49 $params = array_merge($params, $optParams);
50 return $this->call('create', [$params], Collection::class);
51 }
52 /**
53 * Deletes a collection from your Merchant Center account. (collections.delete)
54 *
55 * @param string $merchantId Required. The ID of the account that contains the
56 * collection. This account cannot be a multi-client account.
57 * @param string $collectionId Required. The collectionId of the collection.
58 * CollectionId is the same as the REST ID of the collection.
59 * @param array $optParams Optional parameters.
60 * @throws \Google\Service\Exception
61 */
62 public function delete($merchantId, $collectionId, $optParams = [])
63 {
64 $params = ['merchantId' => $merchantId, 'collectionId' => $collectionId];
65 $params = array_merge($params, $optParams);
66 return $this->call('delete', [$params]);
67 }
68 /**
69 * Retrieves a collection from your Merchant Center account. (collections.get)
70 *
71 * @param string $merchantId Required. The ID of the account that contains the
72 * collection. This account cannot be a multi-client account.
73 * @param string $collectionId Required. The REST ID of the collection.
74 * @param array $optParams Optional parameters.
75 * @return Collection
76 * @throws \Google\Service\Exception
77 */
78 public function get($merchantId, $collectionId, $optParams = [])
79 {
80 $params = ['merchantId' => $merchantId, 'collectionId' => $collectionId];
81 $params = array_merge($params, $optParams);
82 return $this->call('get', [$params], Collection::class);
83 }
84 /**
85 * Lists the collections in your Merchant Center account. The response might
86 * contain fewer items than specified by page_size. Rely on next_page_token to
87 * determine if there are more items to be requested.
88 * (collections.listCollections)
89 *
90 * @param string $merchantId Required. The ID of the account that contains the
91 * collection. This account cannot be a multi-client account.
92 * @param array $optParams Optional parameters.
93 *
94 * @opt_param int pageSize The maximum number of collections to return in the
95 * response, used for paging. Defaults to 50; values above 1000 will be coerced
96 * to 1000.
97 * @opt_param string pageToken Token (if provided) to retrieve the subsequent
98 * page. All other parameters must match the original call that provided the
99 * page token.
100 * @return ListCollectionsResponse
101 * @throws \Google\Service\Exception
102 */
103 public function listCollections($merchantId, $optParams = [])
104 {
105 $params = ['merchantId' => $merchantId];
106 $params = array_merge($params, $optParams);
107 return $this->call('list', [$params], ListCollectionsResponse::class);
108 }
109}
110
111// Adding a class alias for backwards compatibility with the previous class name.
112class_alias(Collections::class, 'Google_Service_ShoppingContent_Resource_Collections');
Note: See TracBrowser for help on using the repository browser.