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\CloudSearch\Resource;
19
20use Google\Service\CloudSearch\CheckAccessResponse;
21use Google\Service\CloudSearch\Principal;
22use Google\Service\CloudSearch\SearchItemsByViewUrlRequest;
23use 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->items;
31 *  </code>
32 */
33class 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   */
49  public function checkAccess($name, Principal $postBody, $optParams = [])
50  {
51    $params = ['name' => $name, 'postBody' => $postBody];
52    $params = array_merge($params, $optParams);
53    return $this->call('checkAccess', [$params], CheckAccessResponse::class);
54  }
55  /**
56   * Fetches the item whose viewUrl exactly matches that of the URL provided in
57   * the request. **Note:** This API requires an admin account to execute.
58   * (items.searchByViewUrl)
59   *
60   * @param string $name Source name, format: datasources/{source_id}
61   * @param SearchItemsByViewUrlRequest $postBody
62   * @param array $optParams Optional parameters.
63   * @return SearchItemsByViewUrlResponse
64   */
65  public function searchByViewUrl($name, SearchItemsByViewUrlRequest $postBody, $optParams = [])
66  {
67    $params = ['name' => $name, 'postBody' => $postBody];
68    $params = array_merge($params, $optParams);
69    return $this->call('searchByViewUrl', [$params], SearchItemsByViewUrlResponse::class);
70  }
71}
72
73// Adding a class alias for backwards compatibility with the previous class name.
74class_alias(DebugDatasourcesItems::class, 'Google_Service_CloudSearch_Resource_DebugDatasourcesItems');
75