[e3d4e0a] | 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\Bigquery\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Bigquery\TableDataInsertAllRequest;
|
---|
| 21 | use Google\Service\Bigquery\TableDataInsertAllResponse;
|
---|
| 22 | use Google\Service\Bigquery\TableDataList;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "tabledata" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $bigqueryService = new Google\Service\Bigquery(...);
|
---|
| 29 | * $tabledata = $bigqueryService->tabledata;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class Tabledata extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Streams data into BigQuery one record at a time without needing to run a load
|
---|
| 36 | * job. (tabledata.insertAll)
|
---|
| 37 | *
|
---|
| 38 | * @param string $projectId Required. Project ID of the destination.
|
---|
| 39 | * @param string $datasetId Required. Dataset ID of the destination.
|
---|
| 40 | * @param string $tableId Required. Table ID of the destination.
|
---|
| 41 | * @param TableDataInsertAllRequest $postBody
|
---|
| 42 | * @param array $optParams Optional parameters.
|
---|
| 43 | * @return TableDataInsertAllResponse
|
---|
| 44 | * @throws \Google\Service\Exception
|
---|
| 45 | */
|
---|
| 46 | public function insertAll($projectId, $datasetId, $tableId, TableDataInsertAllRequest $postBody, $optParams = [])
|
---|
| 47 | {
|
---|
| 48 | $params = ['projectId' => $projectId, 'datasetId' => $datasetId, 'tableId' => $tableId, 'postBody' => $postBody];
|
---|
| 49 | $params = array_merge($params, $optParams);
|
---|
| 50 | return $this->call('insertAll', [$params], TableDataInsertAllResponse::class);
|
---|
| 51 | }
|
---|
| 52 | /**
|
---|
| 53 | * List the content of a table in rows. (tabledata.listTabledata)
|
---|
| 54 | *
|
---|
| 55 | * @param string $projectId Required. Project id of the table to list.
|
---|
| 56 | * @param string $datasetId Required. Dataset id of the table to list.
|
---|
| 57 | * @param string $tableId Required. Table id of the table to list.
|
---|
| 58 | * @param array $optParams Optional parameters.
|
---|
| 59 | *
|
---|
| 60 | * @opt_param bool formatOptions.useInt64Timestamp Optional. Output timestamp as
|
---|
| 61 | * usec int64. Default is false.
|
---|
| 62 | * @opt_param string maxResults Row limit of the table.
|
---|
| 63 | * @opt_param string pageToken To retrieve the next page of table data, set this
|
---|
| 64 | * field to the string provided in the pageToken field of the response body from
|
---|
| 65 | * your previous call to tabledata.list.
|
---|
| 66 | * @opt_param string selectedFields Subset of fields to return, supports select
|
---|
| 67 | * into sub fields. Example: selected_fields = "a,e.d.f";
|
---|
| 68 | * @opt_param string startIndex Start row index of the table.
|
---|
| 69 | * @return TableDataList
|
---|
| 70 | * @throws \Google\Service\Exception
|
---|
| 71 | */
|
---|
| 72 | public function listTabledata($projectId, $datasetId, $tableId, $optParams = [])
|
---|
| 73 | {
|
---|
| 74 | $params = ['projectId' => $projectId, 'datasetId' => $datasetId, 'tableId' => $tableId];
|
---|
| 75 | $params = array_merge($params, $optParams);
|
---|
| 76 | return $this->call('list', [$params], TableDataList::class);
|
---|
| 77 | }
|
---|
| 78 | }
|
---|
| 79 |
|
---|
| 80 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 81 | class_alias(Tabledata::class, 'Google_Service_Bigquery_Resource_Tabledata');
|
---|