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\Area120Tables\Resource; 19 20use Google\Service\Area120Tables\Area120tablesEmpty; 21use Google\Service\Area120Tables\BatchCreateRowsRequest; 22use Google\Service\Area120Tables\BatchCreateRowsResponse; 23use Google\Service\Area120Tables\BatchDeleteRowsRequest; 24use Google\Service\Area120Tables\BatchUpdateRowsRequest; 25use Google\Service\Area120Tables\BatchUpdateRowsResponse; 26use Google\Service\Area120Tables\ListRowsResponse; 27use Google\Service\Area120Tables\Row; 28 29/** 30 * The "rows" collection of methods. 31 * Typical usage is: 32 * <code> 33 * $area120tablesService = new Google\Service\Area120Tables(...); 34 * $rows = $area120tablesService->rows; 35 * </code> 36 */ 37class TablesRows extends \Google\Service\Resource 38{ 39 /** 40 * Creates multiple rows. (rows.batchCreate) 41 * 42 * @param string $parent Required. The parent table where the rows will be 43 * created. Format: tables/{table} 44 * @param BatchCreateRowsRequest $postBody 45 * @param array $optParams Optional parameters. 46 * @return BatchCreateRowsResponse 47 */ 48 public function batchCreate($parent, BatchCreateRowsRequest $postBody, $optParams = []) 49 { 50 $params = ['parent' => $parent, 'postBody' => $postBody]; 51 $params = array_merge($params, $optParams); 52 return $this->call('batchCreate', [$params], BatchCreateRowsResponse::class); 53 } 54 /** 55 * Deletes multiple rows. (rows.batchDelete) 56 * 57 * @param string $parent Required. The parent table shared by all rows being 58 * deleted. Format: tables/{table} 59 * @param BatchDeleteRowsRequest $postBody 60 * @param array $optParams Optional parameters. 61 * @return Area120tablesEmpty 62 */ 63 public function batchDelete($parent, BatchDeleteRowsRequest $postBody, $optParams = []) 64 { 65 $params = ['parent' => $parent, 'postBody' => $postBody]; 66 $params = array_merge($params, $optParams); 67 return $this->call('batchDelete', [$params], Area120tablesEmpty::class); 68 } 69 /** 70 * Updates multiple rows. (rows.batchUpdate) 71 * 72 * @param string $parent Required. The parent table shared by all rows being 73 * updated. Format: tables/{table} 74 * @param BatchUpdateRowsRequest $postBody 75 * @param array $optParams Optional parameters. 76 * @return BatchUpdateRowsResponse 77 */ 78 public function batchUpdate($parent, BatchUpdateRowsRequest $postBody, $optParams = []) 79 { 80 $params = ['parent' => $parent, 'postBody' => $postBody]; 81 $params = array_merge($params, $optParams); 82 return $this->call('batchUpdate', [$params], BatchUpdateRowsResponse::class); 83 } 84 /** 85 * Creates a row. (rows.create) 86 * 87 * @param string $parent Required. The parent table where this row will be 88 * created. Format: tables/{table} 89 * @param Row $postBody 90 * @param array $optParams Optional parameters. 91 * 92 * @opt_param string view Optional. Column key to use for values in the row. 93 * Defaults to user entered name. 94 * @return Row 95 */ 96 public function create($parent, Row $postBody, $optParams = []) 97 { 98 $params = ['parent' => $parent, 'postBody' => $postBody]; 99 $params = array_merge($params, $optParams); 100 return $this->call('create', [$params], Row::class); 101 } 102 /** 103 * Deletes a row. (rows.delete) 104 * 105 * @param string $name Required. The name of the row to delete. Format: 106 * tables/{table}/rows/{row} 107 * @param array $optParams Optional parameters. 108 * @return Area120tablesEmpty 109 */ 110 public function delete($name, $optParams = []) 111 { 112 $params = ['name' => $name]; 113 $params = array_merge($params, $optParams); 114 return $this->call('delete', [$params], Area120tablesEmpty::class); 115 } 116 /** 117 * Gets a row. Returns NOT_FOUND if the row does not exist in the table. 118 * (rows.get) 119 * 120 * @param string $name Required. The name of the row to retrieve. Format: 121 * tables/{table}/rows/{row} 122 * @param array $optParams Optional parameters. 123 * 124 * @opt_param string view Optional. Column key to use for values in the row. 125 * Defaults to user entered name. 126 * @return Row 127 */ 128 public function get($name, $optParams = []) 129 { 130 $params = ['name' => $name]; 131 $params = array_merge($params, $optParams); 132 return $this->call('get', [$params], Row::class); 133 } 134 /** 135 * Lists rows in a table. Returns NOT_FOUND if the table does not exist. 136 * (rows.listTablesRows) 137 * 138 * @param string $parent Required. The parent table. Format: tables/{table} 139 * @param array $optParams Optional parameters. 140 * 141 * @opt_param string filter Optional. Filter to only include resources matching 142 * the requirements. For more information, see [Filtering list 143 * results](https://support.google.com/area120-tables/answer/10503371). 144 * @opt_param string orderBy Optional. Sorting order for the list of rows on 145 * createTime/updateTime. 146 * @opt_param int pageSize The maximum number of rows to return. The service may 147 * return fewer than this value. If unspecified, at most 50 rows are returned. 148 * The maximum value is 1,000; values above 1,000 are coerced to 1,000. 149 * @opt_param string pageToken A page token, received from a previous `ListRows` 150 * call. Provide this to retrieve the subsequent page. When paginating, all 151 * other parameters provided to `ListRows` must match the call that provided the 152 * page token. 153 * @opt_param string view Optional. Column key to use for values in the row. 154 * Defaults to user entered name. 155 * @return ListRowsResponse 156 */ 157 public function listTablesRows($parent, $optParams = []) 158 { 159 $params = ['parent' => $parent]; 160 $params = array_merge($params, $optParams); 161 return $this->call('list', [$params], ListRowsResponse::class); 162 } 163 /** 164 * Updates a row. (rows.patch) 165 * 166 * @param string $name The resource name of the row. Row names have the form 167 * `tables/{table}/rows/{row}`. The name is ignored when creating a row. 168 * @param Row $postBody 169 * @param array $optParams Optional parameters. 170 * 171 * @opt_param string updateMask The list of fields to update. 172 * @opt_param string view Optional. Column key to use for values in the row. 173 * Defaults to user entered name. 174 * @return Row 175 */ 176 public function patch($name, Row $postBody, $optParams = []) 177 { 178 $params = ['name' => $name, 'postBody' => $postBody]; 179 $params = array_merge($params, $optParams); 180 return $this->call('patch', [$params], Row::class); 181 } 182} 183 184// Adding a class alias for backwards compatibility with the previous class name. 185class_alias(TablesRows::class, 'Google_Service_Area120Tables_Resource_TablesRows'); 186