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/** 19 * The "table" collection of methods. 20 * Typical usage is: 21 * <code> 22 * $fusiontablesService = new Google_Service_Fusiontables(...); 23 * $table = $fusiontablesService->table; 24 * </code> 25 */ 26class Google_Service_Fusiontables_Resource_Table extends Google_Service_Resource 27{ 28 /** 29 * Copies a table. (table.copy) 30 * 31 * @param string $tableId ID of the table that is being copied. 32 * @param array $optParams Optional parameters. 33 * 34 * @opt_param bool copyPresentation Whether to also copy tabs, styles, and 35 * templates. Default is false. 36 * @return Google_Service_Fusiontables_Table 37 */ 38 public function copy($tableId, $optParams = array()) 39 { 40 $params = array('tableId' => $tableId); 41 $params = array_merge($params, $optParams); 42 return $this->call('copy', array($params), "Google_Service_Fusiontables_Table"); 43 } 44 /** 45 * Deletes a table. (table.delete) 46 * 47 * @param string $tableId ID of the table to be deleted. 48 * @param array $optParams Optional parameters. 49 */ 50 public function delete($tableId, $optParams = array()) 51 { 52 $params = array('tableId' => $tableId); 53 $params = array_merge($params, $optParams); 54 return $this->call('delete', array($params)); 55 } 56 /** 57 * Retrieves a specific table by its ID. (table.get) 58 * 59 * @param string $tableId Identifier for the table being requested. 60 * @param array $optParams Optional parameters. 61 * @return Google_Service_Fusiontables_Table 62 */ 63 public function get($tableId, $optParams = array()) 64 { 65 $params = array('tableId' => $tableId); 66 $params = array_merge($params, $optParams); 67 return $this->call('get', array($params), "Google_Service_Fusiontables_Table"); 68 } 69 /** 70 * Imports more rows into a table. (table.importRows) 71 * 72 * @param string $tableId The table into which new rows are being imported. 73 * @param array $optParams Optional parameters. 74 * 75 * @opt_param string delimiter The delimiter used to separate cell values. This 76 * can only consist of a single character. Default is ,. 77 * @opt_param string encoding The encoding of the content. Default is UTF-8. Use 78 * auto-detect if you are unsure of the encoding. 79 * @opt_param int endLine The index of the line up to which data will be 80 * imported. Default is to import the entire file. If endLine is negative, it is 81 * an offset from the end of the file; the imported content will exclude the 82 * last endLine lines. 83 * @opt_param bool isStrict Whether the imported CSV must have the same number 84 * of values for each row. If false, rows with fewer values will be padded with 85 * empty values. Default is true. 86 * @opt_param int startLine The index of the first line from which to start 87 * importing, inclusive. Default is 0. 88 * @return Google_Service_Fusiontables_Import 89 */ 90 public function importRows($tableId, $optParams = array()) 91 { 92 $params = array('tableId' => $tableId); 93 $params = array_merge($params, $optParams); 94 return $this->call('importRows', array($params), "Google_Service_Fusiontables_Import"); 95 } 96 /** 97 * Imports a new table. (table.importTable) 98 * 99 * @param string $name The name to be assigned to the new table. 100 * @param array $optParams Optional parameters. 101 * 102 * @opt_param string delimiter The delimiter used to separate cell values. This 103 * can only consist of a single character. Default is ,. 104 * @opt_param string encoding The encoding of the content. Default is UTF-8. Use 105 * auto-detect if you are unsure of the encoding. 106 * @return Google_Service_Fusiontables_Table 107 */ 108 public function importTable($name, $optParams = array()) 109 { 110 $params = array('name' => $name); 111 $params = array_merge($params, $optParams); 112 return $this->call('importTable', array($params), "Google_Service_Fusiontables_Table"); 113 } 114 /** 115 * Creates a new table. (table.insert) 116 * 117 * @param Google_Service_Fusiontables_Table $postBody 118 * @param array $optParams Optional parameters. 119 * @return Google_Service_Fusiontables_Table 120 */ 121 public function insert(Google_Service_Fusiontables_Table $postBody, $optParams = array()) 122 { 123 $params = array('postBody' => $postBody); 124 $params = array_merge($params, $optParams); 125 return $this->call('insert', array($params), "Google_Service_Fusiontables_Table"); 126 } 127 /** 128 * Retrieves a list of tables a user owns. (table.listTable) 129 * 130 * @param array $optParams Optional parameters. 131 * 132 * @opt_param string maxResults Maximum number of tables to return. Default is 133 * 5. 134 * @opt_param string pageToken Continuation token specifying which result page 135 * to return. 136 * @return Google_Service_Fusiontables_TableList 137 */ 138 public function listTable($optParams = array()) 139 { 140 $params = array(); 141 $params = array_merge($params, $optParams); 142 return $this->call('list', array($params), "Google_Service_Fusiontables_TableList"); 143 } 144 /** 145 * Updates an existing table. Unless explicitly requested, only the name, 146 * description, and attribution will be updated. This method supports patch 147 * semantics. (table.patch) 148 * 149 * @param string $tableId ID of the table that is being updated. 150 * @param Google_Service_Fusiontables_Table $postBody 151 * @param array $optParams Optional parameters. 152 * 153 * @opt_param bool replaceViewDefinition Whether the view definition is also 154 * updated. The specified view definition replaces the existing one. Only a view 155 * can be updated with a new definition. 156 * @return Google_Service_Fusiontables_Table 157 */ 158 public function patch($tableId, Google_Service_Fusiontables_Table $postBody, $optParams = array()) 159 { 160 $params = array('tableId' => $tableId, 'postBody' => $postBody); 161 $params = array_merge($params, $optParams); 162 return $this->call('patch', array($params), "Google_Service_Fusiontables_Table"); 163 } 164 /** 165 * Replaces rows of the table with the rows of the spreadsheet that is first 166 * imported from. Current rows remain visible until all replacement rows are 167 * ready. (table.refetchSheet) 168 * 169 * @param string $tableId Table whose rows will be replaced from the 170 * spreadsheet. 171 * @param array $optParams Optional parameters. 172 * @return Google_Service_Fusiontables_Task 173 */ 174 public function refetchSheet($tableId, $optParams = array()) 175 { 176 $params = array('tableId' => $tableId); 177 $params = array_merge($params, $optParams); 178 return $this->call('refetchSheet', array($params), "Google_Service_Fusiontables_Task"); 179 } 180 /** 181 * Replaces rows of an existing table. Current rows remain visible until all 182 * replacement rows are ready. (table.replaceRows) 183 * 184 * @param string $tableId Table whose rows will be replaced. 185 * @param array $optParams Optional parameters. 186 * 187 * @opt_param string delimiter The delimiter used to separate cell values. This 188 * can only consist of a single character. Default is ,. 189 * @opt_param string encoding The encoding of the content. Default is UTF-8. Use 190 * 'auto-detect' if you are unsure of the encoding. 191 * @opt_param int endLine The index of the line up to which data will be 192 * imported. Default is to import the entire file. If endLine is negative, it is 193 * an offset from the end of the file; the imported content will exclude the 194 * last endLine lines. 195 * @opt_param bool isStrict Whether the imported CSV must have the same number 196 * of column values for each row. If true, throws an exception if the CSV does 197 * not have the same number of columns. If false, rows with fewer column values 198 * will be padded with empty values. Default is true. 199 * @opt_param int startLine The index of the first line from which to start 200 * importing, inclusive. Default is 0. 201 * @return Google_Service_Fusiontables_Task 202 */ 203 public function replaceRows($tableId, $optParams = array()) 204 { 205 $params = array('tableId' => $tableId); 206 $params = array_merge($params, $optParams); 207 return $this->call('replaceRows', array($params), "Google_Service_Fusiontables_Task"); 208 } 209 /** 210 * Updates an existing table. Unless explicitly requested, only the name, 211 * description, and attribution will be updated. (table.update) 212 * 213 * @param string $tableId ID of the table that is being updated. 214 * @param Google_Service_Fusiontables_Table $postBody 215 * @param array $optParams Optional parameters. 216 * 217 * @opt_param bool replaceViewDefinition Whether the view definition is also 218 * updated. The specified view definition replaces the existing one. Only a view 219 * can be updated with a new definition. 220 * @return Google_Service_Fusiontables_Table 221 */ 222 public function update($tableId, Google_Service_Fusiontables_Table $postBody, $optParams = array()) 223 { 224 $params = array('tableId' => $tableId, 'postBody' => $postBody); 225 $params = array_merge($params, $optParams); 226 return $this->call('update', array($params), "Google_Service_Fusiontables_Table"); 227 } 228} 229