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\AccountLabel;
|
---|
21 | use Google\Service\ShoppingContent\ListAccountLabelsResponse;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "labels" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $contentService = new Google\Service\ShoppingContent(...);
|
---|
28 | * $labels = $contentService->accounts_labels;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class AccountsLabels extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Creates a new label, not assigned to any account. (labels.create)
|
---|
35 | *
|
---|
36 | * @param string $accountId Required. The id of the account this label belongs
|
---|
37 | * to.
|
---|
38 | * @param AccountLabel $postBody
|
---|
39 | * @param array $optParams Optional parameters.
|
---|
40 | * @return AccountLabel
|
---|
41 | * @throws \Google\Service\Exception
|
---|
42 | */
|
---|
43 | public function create($accountId, AccountLabel $postBody, $optParams = [])
|
---|
44 | {
|
---|
45 | $params = ['accountId' => $accountId, 'postBody' => $postBody];
|
---|
46 | $params = array_merge($params, $optParams);
|
---|
47 | return $this->call('create', [$params], AccountLabel::class);
|
---|
48 | }
|
---|
49 | /**
|
---|
50 | * Deletes a label and removes it from all accounts to which it was assigned.
|
---|
51 | * (labels.delete)
|
---|
52 | *
|
---|
53 | * @param string $accountId Required. The id of the account that owns the label.
|
---|
54 | * @param string $labelId Required. The id of the label to delete.
|
---|
55 | * @param array $optParams Optional parameters.
|
---|
56 | * @throws \Google\Service\Exception
|
---|
57 | */
|
---|
58 | public function delete($accountId, $labelId, $optParams = [])
|
---|
59 | {
|
---|
60 | $params = ['accountId' => $accountId, 'labelId' => $labelId];
|
---|
61 | $params = array_merge($params, $optParams);
|
---|
62 | return $this->call('delete', [$params]);
|
---|
63 | }
|
---|
64 | /**
|
---|
65 | * Lists the labels assigned to an account. (labels.listAccountsLabels)
|
---|
66 | *
|
---|
67 | * @param string $accountId Required. The account id for whose labels are to be
|
---|
68 | * listed.
|
---|
69 | * @param array $optParams Optional parameters.
|
---|
70 | *
|
---|
71 | * @opt_param int pageSize The maximum number of labels to return. The service
|
---|
72 | * may return fewer than this value. If unspecified, at most 50 labels will be
|
---|
73 | * returned. The maximum value is 1000; values above 1000 will be coerced to
|
---|
74 | * 1000.
|
---|
75 | * @opt_param string pageToken A page token, received from a previous
|
---|
76 | * `ListAccountLabels` call. Provide this to retrieve the subsequent page. When
|
---|
77 | * paginating, all other parameters provided to `ListAccountLabels` must match
|
---|
78 | * the call that provided the page token.
|
---|
79 | * @return ListAccountLabelsResponse
|
---|
80 | * @throws \Google\Service\Exception
|
---|
81 | */
|
---|
82 | public function listAccountsLabels($accountId, $optParams = [])
|
---|
83 | {
|
---|
84 | $params = ['accountId' => $accountId];
|
---|
85 | $params = array_merge($params, $optParams);
|
---|
86 | return $this->call('list', [$params], ListAccountLabelsResponse::class);
|
---|
87 | }
|
---|
88 | /**
|
---|
89 | * Updates a label. (labels.patch)
|
---|
90 | *
|
---|
91 | * @param string $accountId Required. The id of the account this label belongs
|
---|
92 | * to.
|
---|
93 | * @param string $labelId Required. The id of the label to update.
|
---|
94 | * @param AccountLabel $postBody
|
---|
95 | * @param array $optParams Optional parameters.
|
---|
96 | * @return AccountLabel
|
---|
97 | * @throws \Google\Service\Exception
|
---|
98 | */
|
---|
99 | public function patch($accountId, $labelId, AccountLabel $postBody, $optParams = [])
|
---|
100 | {
|
---|
101 | $params = ['accountId' => $accountId, 'labelId' => $labelId, 'postBody' => $postBody];
|
---|
102 | $params = array_merge($params, $optParams);
|
---|
103 | return $this->call('patch', [$params], AccountLabel::class);
|
---|
104 | }
|
---|
105 | }
|
---|
106 |
|
---|
107 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
108 | class_alias(AccountsLabels::class, 'Google_Service_ShoppingContent_Resource_AccountsLabels');
|
---|