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\CloudSearch\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudSearch\CheckAccessResponse;
|
---|
21 | use Google\Service\CloudSearch\Principal;
|
---|
22 | use Google\Service\CloudSearch\SearchItemsByViewUrlRequest;
|
---|
23 | use Google\Service\CloudSearch\SearchItemsByViewUrlResponse;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "items" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $cloudsearchService = new Google\Service\CloudSearch(...);
|
---|
30 | * $items = $cloudsearchService->debug_datasources_items;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class DebugDatasourcesItems extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Checks whether an item is accessible by specified principal. Principal must
|
---|
37 | * be a user; groups and domain values aren't supported. **Note:** This API
|
---|
38 | * requires an admin account to execute. (items.checkAccess)
|
---|
39 | *
|
---|
40 | * @param string $name Item name, format:
|
---|
41 | * datasources/{source_id}/items/{item_id}
|
---|
42 | * @param Principal $postBody
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | *
|
---|
45 | * @opt_param bool debugOptions.enableDebugging If you are asked by Google to
|
---|
46 | * help with debugging, set this field. Otherwise, ignore this field.
|
---|
47 | * @return CheckAccessResponse
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function checkAccess($name, Principal $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('checkAccess', [$params], CheckAccessResponse::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Fetches the item whose viewUrl exactly matches that of the URL provided in
|
---|
58 | * the request. **Note:** This API requires an admin account to execute.
|
---|
59 | * (items.searchByViewUrl)
|
---|
60 | *
|
---|
61 | * @param string $name Source name, format: datasources/{source_id}
|
---|
62 | * @param SearchItemsByViewUrlRequest $postBody
|
---|
63 | * @param array $optParams Optional parameters.
|
---|
64 | * @return SearchItemsByViewUrlResponse
|
---|
65 | * @throws \Google\Service\Exception
|
---|
66 | */
|
---|
67 | public function searchByViewUrl($name, SearchItemsByViewUrlRequest $postBody, $optParams = [])
|
---|
68 | {
|
---|
69 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
70 | $params = array_merge($params, $optParams);
|
---|
71 | return $this->call('searchByViewUrl', [$params], SearchItemsByViewUrlResponse::class);
|
---|
72 | }
|
---|
73 | }
|
---|
74 |
|
---|
75 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
76 | class_alias(DebugDatasourcesItems::class, 'Google_Service_CloudSearch_Resource_DebugDatasourcesItems');
|
---|