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\DebugResponse;
|
---|
21 | use Google\Service\CloudSearch\RemoveActivityRequest;
|
---|
22 | use Google\Service\CloudSearch\RemoveActivityResponse;
|
---|
23 | use Google\Service\CloudSearch\SearchRequest;
|
---|
24 | use Google\Service\CloudSearch\SearchResponse;
|
---|
25 | use Google\Service\CloudSearch\SuggestRequest;
|
---|
26 | use Google\Service\CloudSearch\SuggestResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "query" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $cloudsearchService = new Google\Service\CloudSearch(...);
|
---|
33 | * $query = $cloudsearchService->query;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class Query extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Returns Debug information for Cloud Search Query API provides the search
|
---|
40 | * method. **Note:** This API requires a standard end user account to execute. A
|
---|
41 | * service account can't perform Query API requests directly; to use a service
|
---|
42 | * account to perform queries, set up [Google Workspace domain-wide delegation
|
---|
43 | * of authority](https://developers.google.com/cloud-
|
---|
44 | * search/docs/guides/delegation/). (query.debugSearch)
|
---|
45 | *
|
---|
46 | * @param SearchRequest $postBody
|
---|
47 | * @param array $optParams Optional parameters.
|
---|
48 | * @return DebugResponse
|
---|
49 | * @throws \Google\Service\Exception
|
---|
50 | */
|
---|
51 | public function debugSearch(SearchRequest $postBody, $optParams = [])
|
---|
52 | {
|
---|
53 | $params = ['postBody' => $postBody];
|
---|
54 | $params = array_merge($params, $optParams);
|
---|
55 | return $this->call('debugSearch', [$params], DebugResponse::class);
|
---|
56 | }
|
---|
57 | /**
|
---|
58 | * Provides functionality to remove logged activity for a user. Currently to be
|
---|
59 | * used only for Chat 1p clients **Note:** This API requires a standard end user
|
---|
60 | * account to execute. A service account can't perform Remove Activity requests
|
---|
61 | * directly; to use a service account to perform queries, set up [Google
|
---|
62 | * Workspace domain-wide delegation of
|
---|
63 | * authority](https://developers.google.com/cloud-
|
---|
64 | * search/docs/guides/delegation/). (query.removeActivity)
|
---|
65 | *
|
---|
66 | * @param RemoveActivityRequest $postBody
|
---|
67 | * @param array $optParams Optional parameters.
|
---|
68 | * @return RemoveActivityResponse
|
---|
69 | * @throws \Google\Service\Exception
|
---|
70 | */
|
---|
71 | public function removeActivity(RemoveActivityRequest $postBody, $optParams = [])
|
---|
72 | {
|
---|
73 | $params = ['postBody' => $postBody];
|
---|
74 | $params = array_merge($params, $optParams);
|
---|
75 | return $this->call('removeActivity', [$params], RemoveActivityResponse::class);
|
---|
76 | }
|
---|
77 | /**
|
---|
78 | * The Cloud Search Query API provides the search method, which returns the most
|
---|
79 | * relevant results from a user query. The results can come from Google
|
---|
80 | * Workspace apps, such as Gmail or Google Drive, or they can come from data
|
---|
81 | * that you have indexed from a third party. **Note:** This API requires a
|
---|
82 | * standard end user account to execute. A service account can't perform Query
|
---|
83 | * API requests directly; to use a service account to perform queries, set up
|
---|
84 | * [Google Workspace domain-wide delegation of
|
---|
85 | * authority](https://developers.google.com/cloud-
|
---|
86 | * search/docs/guides/delegation/). (query.search)
|
---|
87 | *
|
---|
88 | * @param SearchRequest $postBody
|
---|
89 | * @param array $optParams Optional parameters.
|
---|
90 | * @return SearchResponse
|
---|
91 | * @throws \Google\Service\Exception
|
---|
92 | */
|
---|
93 | public function search(SearchRequest $postBody, $optParams = [])
|
---|
94 | {
|
---|
95 | $params = ['postBody' => $postBody];
|
---|
96 | $params = array_merge($params, $optParams);
|
---|
97 | return $this->call('search', [$params], SearchResponse::class);
|
---|
98 | }
|
---|
99 | /**
|
---|
100 | * Provides suggestions for autocompleting the query. **Note:** This API
|
---|
101 | * requires a standard end user account to execute. A service account can't
|
---|
102 | * perform Query API requests directly; to use a service account to perform
|
---|
103 | * queries, set up [Google Workspace domain-wide delegation of
|
---|
104 | * authority](https://developers.google.com/cloud-
|
---|
105 | * search/docs/guides/delegation/). (query.suggest)
|
---|
106 | *
|
---|
107 | * @param SuggestRequest $postBody
|
---|
108 | * @param array $optParams Optional parameters.
|
---|
109 | * @return SuggestResponse
|
---|
110 | * @throws \Google\Service\Exception
|
---|
111 | */
|
---|
112 | public function suggest(SuggestRequest $postBody, $optParams = [])
|
---|
113 | {
|
---|
114 | $params = ['postBody' => $postBody];
|
---|
115 | $params = array_merge($params, $optParams);
|
---|
116 | return $this->call('suggest', [$params], SuggestResponse::class);
|
---|
117 | }
|
---|
118 | }
|
---|
119 |
|
---|
120 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
121 | class_alias(Query::class, 'Google_Service_CloudSearch_Resource_Query');
|
---|