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\ListSearchApplicationsResponse;
21use Google\Service\CloudSearch\Operation;
22use Google\Service\CloudSearch\ResetSearchApplicationRequest;
23use 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->searchapplications;
31 *  </code>
32 */
33class 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   */
43  public function create(SearchApplication $postBody, $optParams = [])
44  {
45    $params = ['postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('create', [$params], Operation::class);
48  }
49  /**
50   * Deletes a search application. **Note:** This API requires an admin account to
51   * execute. (searchapplications.delete)
52   *
53   * @param string $name The name of the search application to be deleted. Format:
54   * applications/{application_id}.
55   * @param array $optParams Optional parameters.
56   *
57   * @opt_param bool debugOptions.enableDebugging If you are asked by Google to
58   * help with debugging, set this field. Otherwise, ignore this field.
59   * @return Operation
60   */
61  public function delete($name, $optParams = [])
62  {
63    $params = ['name' => $name];
64    $params = array_merge($params, $optParams);
65    return $this->call('delete', [$params], Operation::class);
66  }
67  /**
68   * Gets the specified search application. **Note:** This API requires an admin
69   * account to execute. (searchapplications.get)
70   *
71   * @param string $name Name of the search application. Format:
72   * searchapplications/{application_id}.
73   * @param array $optParams Optional parameters.
74   *
75   * @opt_param bool debugOptions.enableDebugging If you are asked by Google to
76   * help with debugging, set this field. Otherwise, ignore this field.
77   * @return SearchApplication
78   */
79  public function get($name, $optParams = [])
80  {
81    $params = ['name' => $name];
82    $params = array_merge($params, $optParams);
83    return $this->call('get', [$params], SearchApplication::class);
84  }
85  /**
86   * Lists all search applications. **Note:** This API requires an admin account
87   * to execute. (searchapplications.listSettingsSearchapplications)
88   *
89   * @param array $optParams Optional parameters.
90   *
91   * @opt_param bool debugOptions.enableDebugging If you are asked by Google to
92   * help with debugging, set this field. Otherwise, ignore this field.
93   * @opt_param int pageSize The maximum number of items to return.
94   * @opt_param string pageToken The next_page_token value returned from a
95   * previous List request, if any. The default value is 10
96   * @return ListSearchApplicationsResponse
97   */
98  public function listSettingsSearchapplications($optParams = [])
99  {
100    $params = [];
101    $params = array_merge($params, $optParams);
102    return $this->call('list', [$params], ListSearchApplicationsResponse::class);
103  }
104  /**
105   * Resets a search application to default settings. This will return an empty
106   * response. **Note:** This API requires an admin account to execute.
107   * (searchapplications.reset)
108   *
109   * @param string $name The name of the search application to be reset. Format:
110   * applications/{application_id}.
111   * @param ResetSearchApplicationRequest $postBody
112   * @param array $optParams Optional parameters.
113   * @return Operation
114   */
115  public function reset($name, ResetSearchApplicationRequest $postBody, $optParams = [])
116  {
117    $params = ['name' => $name, 'postBody' => $postBody];
118    $params = array_merge($params, $optParams);
119    return $this->call('reset', [$params], Operation::class);
120  }
121  /**
122   * Updates a search application. **Note:** This API requires an admin account to
123   * execute. (searchapplications.update)
124   *
125   * @param string $name Name of the Search Application. Format:
126   * searchapplications/{application_id}.
127   * @param SearchApplication $postBody
128   * @param array $optParams Optional parameters.
129   * @return Operation
130   */
131  public function update($name, SearchApplication $postBody, $optParams = [])
132  {
133    $params = ['name' => $name, 'postBody' => $postBody];
134    $params = array_merge($params, $optParams);
135    return $this->call('update', [$params], Operation::class);
136  }
137}
138
139// Adding a class alias for backwards compatibility with the previous class name.
140class_alias(SettingsSearchapplications::class, 'Google_Service_CloudSearch_Resource_SettingsSearchapplications');
141