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\BigQueryDataTransfer\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\BigQueryDataTransfer\BigquerydatatransferEmpty;
|
---|
21 | use Google\Service\BigQueryDataTransfer\ListTransferConfigsResponse;
|
---|
22 | use Google\Service\BigQueryDataTransfer\ScheduleTransferRunsRequest;
|
---|
23 | use Google\Service\BigQueryDataTransfer\ScheduleTransferRunsResponse;
|
---|
24 | use Google\Service\BigQueryDataTransfer\StartManualTransferRunsRequest;
|
---|
25 | use Google\Service\BigQueryDataTransfer\StartManualTransferRunsResponse;
|
---|
26 | use Google\Service\BigQueryDataTransfer\TransferConfig;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "transferConfigs" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $bigquerydatatransferService = new Google\Service\BigQueryDataTransfer(...);
|
---|
33 | * $transferConfigs = $bigquerydatatransferService->projects_locations_transferConfigs;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsTransferConfigs extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Creates a new data transfer configuration. (transferConfigs.create)
|
---|
40 | *
|
---|
41 | * @param string $parent Required. The BigQuery project id where the transfer
|
---|
42 | * configuration should be created. Must be in the format
|
---|
43 | * projects/{project_id}/locations/{location_id} or projects/{project_id}. If
|
---|
44 | * specified location and location of the destination bigquery dataset do not
|
---|
45 | * match - the request will fail.
|
---|
46 | * @param TransferConfig $postBody
|
---|
47 | * @param array $optParams Optional parameters.
|
---|
48 | *
|
---|
49 | * @opt_param string authorizationCode Deprecated: Authorization code was
|
---|
50 | * required when `transferConfig.dataSourceId` is 'youtube_channel' but it is no
|
---|
51 | * longer used in any data sources. Use `version_info` instead. Optional OAuth2
|
---|
52 | * authorization code to use with this transfer configuration. This is required
|
---|
53 | * only if `transferConfig.dataSourceId` is 'youtube_channel' and new
|
---|
54 | * credentials are needed, as indicated by `CheckValidCreds`. In order to obtain
|
---|
55 | * authorization_code, make a request to the following URL: https://bigquery.clo
|
---|
56 | * ud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob
|
---|
57 | * &response_type=authorization_code&client_id=client_id&scope=data_source_scope
|
---|
58 | * s * The client_id is the OAuth client_id of the data source as returned by
|
---|
59 | * ListDataSources method. * data_source_scopes are the scopes returned by
|
---|
60 | * ListDataSources method. Note that this should not be set when
|
---|
61 | * `service_account_name` is used to create the transfer config.
|
---|
62 | * @opt_param string serviceAccountName Optional service account email. If this
|
---|
63 | * field is set, the transfer config will be created with this service account's
|
---|
64 | * credentials. It requires that the requesting user calling this API has
|
---|
65 | * permissions to act as this service account. Note that not all data sources
|
---|
66 | * support service account credentials when creating a transfer config. For the
|
---|
67 | * latest list of data sources, read about [using service
|
---|
68 | * accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-
|
---|
69 | * accounts).
|
---|
70 | * @opt_param string versionInfo Optional version info. This parameter replaces
|
---|
71 | * `authorization_code` which is no longer used in any data sources. This is
|
---|
72 | * required only if `transferConfig.dataSourceId` is 'youtube_channel' *or* new
|
---|
73 | * credentials are needed, as indicated by `CheckValidCreds`. In order to obtain
|
---|
74 | * version info, make a request to the following URL: https://bigquery.cloud.goo
|
---|
75 | * gle.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&respo
|
---|
76 | * nse_type=version_info&client_id=client_id&scope=data_source_scopes * The
|
---|
77 | * client_id is the OAuth client_id of the data source as returned by
|
---|
78 | * ListDataSources method. * data_source_scopes are the scopes returned by
|
---|
79 | * ListDataSources method. Note that this should not be set when
|
---|
80 | * `service_account_name` is used to create the transfer config.
|
---|
81 | * @return TransferConfig
|
---|
82 | * @throws \Google\Service\Exception
|
---|
83 | */
|
---|
84 | public function create($parent, TransferConfig $postBody, $optParams = [])
|
---|
85 | {
|
---|
86 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
87 | $params = array_merge($params, $optParams);
|
---|
88 | return $this->call('create', [$params], TransferConfig::class);
|
---|
89 | }
|
---|
90 | /**
|
---|
91 | * Deletes a data transfer configuration, including any associated transfer runs
|
---|
92 | * and logs. (transferConfigs.delete)
|
---|
93 | *
|
---|
94 | * @param string $name Required. The field will contain name of the resource
|
---|
95 | * requested, for example: `projects/{project_id}/transferConfigs/{config_id}`
|
---|
96 | * or
|
---|
97 | * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
|
---|
98 | * @param array $optParams Optional parameters.
|
---|
99 | * @return BigquerydatatransferEmpty
|
---|
100 | * @throws \Google\Service\Exception
|
---|
101 | */
|
---|
102 | public function delete($name, $optParams = [])
|
---|
103 | {
|
---|
104 | $params = ['name' => $name];
|
---|
105 | $params = array_merge($params, $optParams);
|
---|
106 | return $this->call('delete', [$params], BigquerydatatransferEmpty::class);
|
---|
107 | }
|
---|
108 | /**
|
---|
109 | * Returns information about a data transfer config. (transferConfigs.get)
|
---|
110 | *
|
---|
111 | * @param string $name Required. The field will contain name of the resource
|
---|
112 | * requested, for example: `projects/{project_id}/transferConfigs/{config_id}`
|
---|
113 | * or
|
---|
114 | * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
|
---|
115 | * @param array $optParams Optional parameters.
|
---|
116 | * @return TransferConfig
|
---|
117 | * @throws \Google\Service\Exception
|
---|
118 | */
|
---|
119 | public function get($name, $optParams = [])
|
---|
120 | {
|
---|
121 | $params = ['name' => $name];
|
---|
122 | $params = array_merge($params, $optParams);
|
---|
123 | return $this->call('get', [$params], TransferConfig::class);
|
---|
124 | }
|
---|
125 | /**
|
---|
126 | * Returns information about all transfer configs owned by a project in the
|
---|
127 | * specified location. (transferConfigs.listProjectsLocationsTransferConfigs)
|
---|
128 | *
|
---|
129 | * @param string $parent Required. The BigQuery project id for which transfer
|
---|
130 | * configs should be returned: `projects/{project_id}` or
|
---|
131 | * `projects/{project_id}/locations/{location_id}`
|
---|
132 | * @param array $optParams Optional parameters.
|
---|
133 | *
|
---|
134 | * @opt_param string dataSourceIds When specified, only configurations of
|
---|
135 | * requested data sources are returned.
|
---|
136 | * @opt_param int pageSize Page size. The default page size is the maximum value
|
---|
137 | * of 1000 results.
|
---|
138 | * @opt_param string pageToken Pagination token, which can be used to request a
|
---|
139 | * specific page of `ListTransfersRequest` list results. For multiple-page
|
---|
140 | * results, `ListTransfersResponse` outputs a `next_page` token, which can be
|
---|
141 | * used as the `page_token` value to request the next page of list results.
|
---|
142 | * @return ListTransferConfigsResponse
|
---|
143 | * @throws \Google\Service\Exception
|
---|
144 | */
|
---|
145 | public function listProjectsLocationsTransferConfigs($parent, $optParams = [])
|
---|
146 | {
|
---|
147 | $params = ['parent' => $parent];
|
---|
148 | $params = array_merge($params, $optParams);
|
---|
149 | return $this->call('list', [$params], ListTransferConfigsResponse::class);
|
---|
150 | }
|
---|
151 | /**
|
---|
152 | * Updates a data transfer configuration. All fields must be set, even if they
|
---|
153 | * are not updated. (transferConfigs.patch)
|
---|
154 | *
|
---|
155 | * @param string $name Identifier. The resource name of the transfer config.
|
---|
156 | * Transfer config names have the form either
|
---|
157 | * `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or
|
---|
158 | * `projects/{project_id}/transferConfigs/{config_id}`, where `config_id` is
|
---|
159 | * usually a UUID, even though it is not guaranteed or required. The name is
|
---|
160 | * ignored when creating a transfer config.
|
---|
161 | * @param TransferConfig $postBody
|
---|
162 | * @param array $optParams Optional parameters.
|
---|
163 | *
|
---|
164 | * @opt_param string authorizationCode Deprecated: Authorization code was
|
---|
165 | * required when `transferConfig.dataSourceId` is 'youtube_channel' but it is no
|
---|
166 | * longer used in any data sources. Use `version_info` instead. Optional OAuth2
|
---|
167 | * authorization code to use with this transfer configuration. This is required
|
---|
168 | * only if `transferConfig.dataSourceId` is 'youtube_channel' and new
|
---|
169 | * credentials are needed, as indicated by `CheckValidCreds`. In order to obtain
|
---|
170 | * authorization_code, make a request to the following URL: https://bigquery.clo
|
---|
171 | * ud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob
|
---|
172 | * &response_type=authorization_code&client_id=client_id&scope=data_source_scope
|
---|
173 | * s * The client_id is the OAuth client_id of the data source as returned by
|
---|
174 | * ListDataSources method. * data_source_scopes are the scopes returned by
|
---|
175 | * ListDataSources method. Note that this should not be set when
|
---|
176 | * `service_account_name` is used to update the transfer config.
|
---|
177 | * @opt_param string serviceAccountName Optional service account email. If this
|
---|
178 | * field is set, the transfer config will be created with this service account's
|
---|
179 | * credentials. It requires that the requesting user calling this API has
|
---|
180 | * permissions to act as this service account. Note that not all data sources
|
---|
181 | * support service account credentials when creating a transfer config. For the
|
---|
182 | * latest list of data sources, read about [using service
|
---|
183 | * accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-
|
---|
184 | * accounts).
|
---|
185 | * @opt_param string updateMask Required. Required list of fields to be updated
|
---|
186 | * in this request.
|
---|
187 | * @opt_param string versionInfo Optional version info. This parameter replaces
|
---|
188 | * `authorization_code` which is no longer used in any data sources. This is
|
---|
189 | * required only if `transferConfig.dataSourceId` is 'youtube_channel' *or* new
|
---|
190 | * credentials are needed, as indicated by `CheckValidCreds`. In order to obtain
|
---|
191 | * version info, make a request to the following URL: https://bigquery.cloud.goo
|
---|
192 | * gle.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&respo
|
---|
193 | * nse_type=version_info&client_id=client_id&scope=data_source_scopes * The
|
---|
194 | * client_id is the OAuth client_id of the data source as returned by
|
---|
195 | * ListDataSources method. * data_source_scopes are the scopes returned by
|
---|
196 | * ListDataSources method. Note that this should not be set when
|
---|
197 | * `service_account_name` is used to update the transfer config.
|
---|
198 | * @return TransferConfig
|
---|
199 | * @throws \Google\Service\Exception
|
---|
200 | */
|
---|
201 | public function patch($name, TransferConfig $postBody, $optParams = [])
|
---|
202 | {
|
---|
203 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
204 | $params = array_merge($params, $optParams);
|
---|
205 | return $this->call('patch', [$params], TransferConfig::class);
|
---|
206 | }
|
---|
207 | /**
|
---|
208 | * Creates transfer runs for a time range [start_time, end_time]. For each date
|
---|
209 | * - or whatever granularity the data source supports - in the range, one
|
---|
210 | * transfer run is created. Note that runs are created per UTC time in the time
|
---|
211 | * range. DEPRECATED: use StartManualTransferRuns instead.
|
---|
212 | * (transferConfigs.scheduleRuns)
|
---|
213 | *
|
---|
214 | * @param string $parent Required. Transfer configuration name in the form:
|
---|
215 | * `projects/{project_id}/transferConfigs/{config_id}` or
|
---|
216 | * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
|
---|
217 | * @param ScheduleTransferRunsRequest $postBody
|
---|
218 | * @param array $optParams Optional parameters.
|
---|
219 | * @return ScheduleTransferRunsResponse
|
---|
220 | * @throws \Google\Service\Exception
|
---|
221 | */
|
---|
222 | public function scheduleRuns($parent, ScheduleTransferRunsRequest $postBody, $optParams = [])
|
---|
223 | {
|
---|
224 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
225 | $params = array_merge($params, $optParams);
|
---|
226 | return $this->call('scheduleRuns', [$params], ScheduleTransferRunsResponse::class);
|
---|
227 | }
|
---|
228 | /**
|
---|
229 | * Start manual transfer runs to be executed now with schedule_time equal to
|
---|
230 | * current time. The transfer runs can be created for a time range where the
|
---|
231 | * run_time is between start_time (inclusive) and end_time (exclusive), or for a
|
---|
232 | * specific run_time. (transferConfigs.startManualRuns)
|
---|
233 | *
|
---|
234 | * @param string $parent Required. Transfer configuration name in the form:
|
---|
235 | * `projects/{project_id}/transferConfigs/{config_id}` or
|
---|
236 | * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
|
---|
237 | * @param StartManualTransferRunsRequest $postBody
|
---|
238 | * @param array $optParams Optional parameters.
|
---|
239 | * @return StartManualTransferRunsResponse
|
---|
240 | * @throws \Google\Service\Exception
|
---|
241 | */
|
---|
242 | public function startManualRuns($parent, StartManualTransferRunsRequest $postBody, $optParams = [])
|
---|
243 | {
|
---|
244 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
245 | $params = array_merge($params, $optParams);
|
---|
246 | return $this->call('startManualRuns', [$params], StartManualTransferRunsResponse::class);
|
---|
247 | }
|
---|
248 | }
|
---|
249 |
|
---|
250 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
251 | class_alias(ProjectsLocationsTransferConfigs::class, 'Google_Service_BigQueryDataTransfer_Resource_ProjectsLocationsTransferConfigs');
|
---|