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\DataSource;
|
---|
21 | use Google\Service\CloudSearch\ListDataSourceResponse;
|
---|
22 | use Google\Service\CloudSearch\Operation;
|
---|
23 | use Google\Service\CloudSearch\UpdateDataSourceRequest;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "datasources" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $cloudsearchService = new Google\Service\CloudSearch(...);
|
---|
30 | * $datasources = $cloudsearchService->settings_datasources;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class SettingsDatasources extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Creates a datasource. **Note:** This API requires an admin account to
|
---|
37 | * execute. (datasources.create)
|
---|
38 | *
|
---|
39 | * @param DataSource $postBody
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | * @return Operation
|
---|
42 | * @throws \Google\Service\Exception
|
---|
43 | */
|
---|
44 | public function create(DataSource $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 datasource. **Note:** This API requires an admin account to
|
---|
52 | * execute. (datasources.delete)
|
---|
53 | *
|
---|
54 | * @param string $name The name of the datasource. Format:
|
---|
55 | * datasources/{source_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 a datasource. **Note:** This API requires an admin account to execute.
|
---|
71 | * (datasources.get)
|
---|
72 | *
|
---|
73 | * @param string $name The name of the datasource resource. Format:
|
---|
74 | * datasources/{source_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 DataSource
|
---|
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], DataSource::class);
|
---|
87 | }
|
---|
88 | /**
|
---|
89 | * Lists datasources. **Note:** This API requires an admin account to execute.
|
---|
90 | * (datasources.listSettingsDatasources)
|
---|
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 Maximum number of datasources to fetch in a request.
|
---|
97 | * The max value is 1000. The default value is 1000.
|
---|
98 | * @opt_param string pageToken Starting index of the results.
|
---|
99 | * @return ListDataSourceResponse
|
---|
100 | * @throws \Google\Service\Exception
|
---|
101 | */
|
---|
102 | public function listSettingsDatasources($optParams = [])
|
---|
103 | {
|
---|
104 | $params = [];
|
---|
105 | $params = array_merge($params, $optParams);
|
---|
106 | return $this->call('list', [$params], ListDataSourceResponse::class);
|
---|
107 | }
|
---|
108 | /**
|
---|
109 | * Updates a datasource. **Note:** This API requires an admin account to
|
---|
110 | * execute. (datasources.patch)
|
---|
111 | *
|
---|
112 | * @param string $name The name of the datasource resource. Format:
|
---|
113 | * datasources/{source_id}. The name is ignored when creating a datasource.
|
---|
114 | * @param DataSource $postBody
|
---|
115 | * @param array $optParams Optional parameters.
|
---|
116 | *
|
---|
117 | * @opt_param bool debugOptions.enableDebugging If you are asked by Google to
|
---|
118 | * help with debugging, set this field. Otherwise, ignore this field.
|
---|
119 | * @opt_param string updateMask Only applies to
|
---|
120 | * [`settings.datasources.patch`](https://developers.google.com/cloud-
|
---|
121 | * search/docs/reference/rest/v1/settings.datasources/patch). Update mask to
|
---|
122 | * control which fields to update. Example field paths: `name`, `displayName`. *
|
---|
123 | * If `update_mask` is non-empty, then only the fields specified in the
|
---|
124 | * `update_mask` are updated. * If you specify a field in the `update_mask`, but
|
---|
125 | * don't specify its value in the source, that field is cleared. * If the
|
---|
126 | * `update_mask` is not present or empty or has the value `*`, then all fields
|
---|
127 | * are updated.
|
---|
128 | * @return Operation
|
---|
129 | * @throws \Google\Service\Exception
|
---|
130 | */
|
---|
131 | public function patch($name, DataSource $postBody, $optParams = [])
|
---|
132 | {
|
---|
133 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
134 | $params = array_merge($params, $optParams);
|
---|
135 | return $this->call('patch', [$params], Operation::class);
|
---|
136 | }
|
---|
137 | /**
|
---|
138 | * Updates a datasource. **Note:** This API requires an admin account to
|
---|
139 | * execute. (datasources.update)
|
---|
140 | *
|
---|
141 | * @param string $name The name of the datasource resource. Format:
|
---|
142 | * datasources/{source_id}. The name is ignored when creating a datasource.
|
---|
143 | * @param UpdateDataSourceRequest $postBody
|
---|
144 | * @param array $optParams Optional parameters.
|
---|
145 | * @return Operation
|
---|
146 | * @throws \Google\Service\Exception
|
---|
147 | */
|
---|
148 | public function update($name, UpdateDataSourceRequest $postBody, $optParams = [])
|
---|
149 | {
|
---|
150 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
151 | $params = array_merge($params, $optParams);
|
---|
152 | return $this->call('update', [$params], Operation::class);
|
---|
153 | }
|
---|
154 | }
|
---|
155 |
|
---|
156 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
157 | class_alias(SettingsDatasources::class, 'Google_Service_CloudSearch_Resource_SettingsDatasources');
|
---|