/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { CancelablePromise } from '../core/CancelablePromise'; import type { BaseHttpRequest } from '../core/BaseHttpRequest'; export class Googlesheets { constructor(public readonly httpRequest: BaseHttpRequest) {} /** * Read data from a spreadsheet * @returns void * @throws ApiError */ public read({ sheetId, sheetName, }: { /** Google Sheet spreadsheet ID. Found in the URL. **/ sheetId: string, /** Google Sheet name. Leave blank to select the first sheet. **/ sheetName?: string, }): CancelablePromise { return this.httpRequest.request({ method: 'POST', url: '/googlesheets/read', formData: { 'sheetId': sheetId, 'sheetName': sheetName, }, }); } /** * Adds a row to a spreadsheet * @returns void * @throws ApiError */ public addRow({ sheetId, value, sheetName, }: { /** Google Sheet spreadsheet ID. Found in the URL. **/ sheetId: string, /** Value to add. Objects to append to the spreadsheet, e.g. { "firstColumn": "Bob", "secondColumn": "Joe" } **/ value: any, /** Google Sheet name. Leave blank to select the first sheet. **/ sheetName?: string, }): CancelablePromise { return this.httpRequest.request({ method: 'POST', url: '/googlesheets/addRow', formData: { 'sheetId': sheetId, 'sheetName': sheetName, 'value': value, }, }); } /** * Adds rows to a spreadsheet * @returns void * @throws ApiError */ public addRows({ sheetId, values, sheetName, }: { /** Google Sheet spreadsheet ID. Found in the URL. **/ sheetId: string, /** Values to add. Array of objects to append to the spreadsheet, e.g. [{ "firstColumn": "Bob", "secondColumn": "Joe" }, { "firstColumn": "Jack", "secondColumn": "Jill" }] **/ values: any[], /** Google Sheet name. Leave blank to select the first sheet. **/ sheetName?: string, }): CancelablePromise { return this.httpRequest.request({ method: 'POST', url: '/googlesheets/addRows', formData: { 'sheetId': sheetId, 'sheetName': sheetName, 'values': values, }, }); } }