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\ListSearchApplicationsResponse;
|
---|
21 | use Google\Service\CloudSearch\Operation;
|
---|
22 | use Google\Service\CloudSearch\ResetSearchApplicationRequest;
|
---|
23 | use Google\Service\CloudSearch\SearchApplication;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "searchapplications" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $cloudsearchService = new Google\Service\CloudSearch(...);
|
---|
30 | * $searchapplications = $cloudsearchService->settings_searchapplications;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class SettingsSearchapplications extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Creates a search application. **Note:** This API requires an admin account to
|
---|
37 | * execute. (searchapplications.create)
|
---|
38 | *
|
---|
39 | * @param SearchApplication $postBody
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | * @return Operation
|
---|
42 | * @throws \Google\Service\Exception
|
---|
43 | */
|
---|
44 | public function create(SearchApplication $postBody, $optParams = [])
|
---|
45 | {
|
---|
46 | $params = ['postBody' => $postBody];
|
---|
47 | $params = array_merge($params, $optParams);
|
---|
48 | return $this->call('create', [$params], Operation::class);
|
---|
49 | }
|
---|
50 | /**
|
---|
51 | * Deletes a search application. **Note:** This API requires an admin account to
|
---|
52 | * execute. (searchapplications.delete)
|
---|
53 | *
|
---|
54 | * @param string $name The name of the search application to be deleted. Format:
|
---|
55 | * applications/{application_id}.
|
---|
56 | * @param array $optParams Optional parameters.
|
---|
57 | *
|
---|
58 | * @opt_param bool debugOptions.enableDebugging If you are asked by Google to
|
---|
59 | * help with debugging, set this field. Otherwise, ignore this field.
|
---|
60 | * @return Operation
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function delete($name, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['name' => $name];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('delete', [$params], Operation::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Gets the specified search application. **Note:** This API requires an admin
|
---|
71 | * account to execute. (searchapplications.get)
|
---|
72 | *
|
---|
73 | * @param string $name The name of the search application. Format:
|
---|
74 | * searchapplications/{application_id}.
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | *
|
---|
77 | * @opt_param bool debugOptions.enableDebugging If you are asked by Google to
|
---|
78 | * help with debugging, set this field. Otherwise, ignore this field.
|
---|
79 | * @return SearchApplication
|
---|
80 | * @throws \Google\Service\Exception
|
---|
81 | */
|
---|
82 | public function get($name, $optParams = [])
|
---|
83 | {
|
---|
84 | $params = ['name' => $name];
|
---|
85 | $params = array_merge($params, $optParams);
|
---|
86 | return $this->call('get', [$params], SearchApplication::class);
|
---|
87 | }
|
---|
88 | /**
|
---|
89 | * Lists all search applications. **Note:** This API requires an admin account
|
---|
90 | * to execute. (searchapplications.listSettingsSearchapplications)
|
---|
91 | *
|
---|
92 | * @param array $optParams Optional parameters.
|
---|
93 | *
|
---|
94 | * @opt_param bool debugOptions.enableDebugging If you are asked by Google to
|
---|
95 | * help with debugging, set this field. Otherwise, ignore this field.
|
---|
96 | * @opt_param int pageSize The maximum number of items to return.
|
---|
97 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
98 | * previous List request, if any. The default value is 10
|
---|
99 | * @return ListSearchApplicationsResponse
|
---|
100 | * @throws \Google\Service\Exception
|
---|
101 | */
|
---|
102 | public function listSettingsSearchapplications($optParams = [])
|
---|
103 | {
|
---|
104 | $params = [];
|
---|
105 | $params = array_merge($params, $optParams);
|
---|
106 | return $this->call('list', [$params], ListSearchApplicationsResponse::class);
|
---|
107 | }
|
---|
108 | /**
|
---|
109 | * Updates a search application. **Note:** This API requires an admin account to
|
---|
110 | * execute. (searchapplications.patch)
|
---|
111 | *
|
---|
112 | * @param string $name The name of the Search Application. Format:
|
---|
113 | * searchapplications/{application_id}.
|
---|
114 | * @param SearchApplication $postBody
|
---|
115 | * @param array $optParams Optional parameters.
|
---|
116 | *
|
---|
117 | * @opt_param string updateMask Only applies to
|
---|
118 | * [`settings.searchapplications.patch`](https://developers.google.com/cloud-
|
---|
119 | * search/docs/reference/rest/v1/settings.searchapplications/patch). Update mask
|
---|
120 | * to control which fields to update. Example field paths:
|
---|
121 | * `search_application.name`, `search_application.displayName`. * If
|
---|
122 | * `update_mask` is non-empty, then only the fields specified in the
|
---|
123 | * `update_mask` are updated. * If you specify a field in the `update_mask`, but
|
---|
124 | * don't specify its value in the `search_application`, then that field is
|
---|
125 | * cleared. * If the `update_mask` is not present or empty or has the value `*`,
|
---|
126 | * then all fields are updated.
|
---|
127 | * @return Operation
|
---|
128 | * @throws \Google\Service\Exception
|
---|
129 | */
|
---|
130 | public function patch($name, SearchApplication $postBody, $optParams = [])
|
---|
131 | {
|
---|
132 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
133 | $params = array_merge($params, $optParams);
|
---|
134 | return $this->call('patch', [$params], Operation::class);
|
---|
135 | }
|
---|
136 | /**
|
---|
137 | * Resets a search application to default settings. This will return an empty
|
---|
138 | * response. **Note:** This API requires an admin account to execute.
|
---|
139 | * (searchapplications.reset)
|
---|
140 | *
|
---|
141 | * @param string $name The name of the search application to be reset. Format:
|
---|
142 | * applications/{application_id}.
|
---|
143 | * @param ResetSearchApplicationRequest $postBody
|
---|
144 | * @param array $optParams Optional parameters.
|
---|
145 | * @return Operation
|
---|
146 | * @throws \Google\Service\Exception
|
---|
147 | */
|
---|
148 | public function reset($name, ResetSearchApplicationRequest $postBody, $optParams = [])
|
---|
149 | {
|
---|
150 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
151 | $params = array_merge($params, $optParams);
|
---|
152 | return $this->call('reset', [$params], Operation::class);
|
---|
153 | }
|
---|
154 | /**
|
---|
155 | * Updates a search application. **Note:** This API requires an admin account to
|
---|
156 | * execute. (searchapplications.update)
|
---|
157 | *
|
---|
158 | * @param string $name The name of the Search Application. Format:
|
---|
159 | * searchapplications/{application_id}.
|
---|
160 | * @param SearchApplication $postBody
|
---|
161 | * @param array $optParams Optional parameters.
|
---|
162 | *
|
---|
163 | * @opt_param string updateMask Only applies to
|
---|
164 | * [`settings.searchapplications.patch`](https://developers.google.com/cloud-
|
---|
165 | * search/docs/reference/rest/v1/settings.searchapplications/patch). Update mask
|
---|
166 | * to control which fields to update. Example field paths:
|
---|
167 | * `search_application.name`, `search_application.displayName`. * If
|
---|
168 | * `update_mask` is non-empty, then only the fields specified in the
|
---|
169 | * `update_mask` are updated. * If you specify a field in the `update_mask`, but
|
---|
170 | * don't specify its value in the `search_application`, then that field is
|
---|
171 | * cleared. * If the `update_mask` is not present or empty or has the value `*`,
|
---|
172 | * then all fields are updated.
|
---|
173 | * @return Operation
|
---|
174 | * @throws \Google\Service\Exception
|
---|
175 | */
|
---|
176 | public function update($name, SearchApplication $postBody, $optParams = [])
|
---|
177 | {
|
---|
178 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
179 | $params = array_merge($params, $optParams);
|
---|
180 | return $this->call('update', [$params], Operation::class);
|
---|
181 | }
|
---|
182 | }
|
---|
183 |
|
---|
184 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
185 | class_alias(SettingsSearchapplications::class, 'Google_Service_CloudSearch_Resource_SettingsSearchapplications');
|
---|