UNPKG

@simplyhomes/sos-sdk

Version:

TypeScript SDK for Simply Homes SoS API v4

130 lines (129 loc) 5.79 kB
/* tslint:disable */ /* eslint-disable */ /** * API v4 * Swagger documentation for API v4 * * The version of the OpenAPI document: 4.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import { V4AirtableCommentsGetCommentsResponseDtoFromJSON, } from '../models/index'; /** * */ export class AirtableCommentsAPIV4Api extends runtime.BaseAPI { /** * Delete a comment */ async v4AirtableCommentsControllerDeleteCommentV4Raw(requestParameters, initOverrides) { if (requestParameters['id'] == null) { throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling v4AirtableCommentsControllerDeleteCommentV4().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication } let urlPath = `/v4/airtable-comments/{id}`; urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Delete a comment */ async v4AirtableCommentsControllerDeleteCommentV4(requestParameters, initOverrides) { await this.v4AirtableCommentsControllerDeleteCommentV4Raw(requestParameters, initOverrides); } /** * Get comments with a specific viewId */ async v4AirtableCommentsControllerGetCommentsInViewV4Raw(requestParameters, initOverrides) { if (requestParameters['viewId'] == null) { throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4AirtableCommentsControllerGetCommentsInViewV4().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication } let urlPath = `/v4/airtable-comments/viewId/{viewId}`; urlPath = urlPath.replace(`{${"viewId"}}`, encodeURIComponent(String(requestParameters['viewId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4AirtableCommentsGetCommentsResponseDtoFromJSON(jsonValue)); } /** * Get comments with a specific viewId */ async v4AirtableCommentsControllerGetCommentsInViewV4(requestParameters, initOverrides) { const response = await this.v4AirtableCommentsControllerGetCommentsInViewV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Get comments with optional viewId */ async v4AirtableCommentsControllerGetCommentsV4Raw(requestParameters, initOverrides) { const queryParameters = {}; if (requestParameters['limit'] != null) { queryParameters['limit'] = requestParameters['limit']; } if (requestParameters['offset'] != null) { queryParameters['offset'] = requestParameters['offset']; } if (requestParameters['countOnly'] != null) { queryParameters['countOnly'] = requestParameters['countOnly']; } if (requestParameters['tableId'] != null) { queryParameters['tableId'] = requestParameters['tableId']; } if (requestParameters['recordId'] != null) { queryParameters['recordId'] = requestParameters['recordId']; } if (requestParameters['viewId'] != null) { queryParameters['viewId'] = requestParameters['viewId']; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication } let urlPath = `/v4/airtable-comments`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4AirtableCommentsGetCommentsResponseDtoFromJSON(jsonValue)); } /** * Get comments with optional viewId */ async v4AirtableCommentsControllerGetCommentsV4(requestParameters = {}, initOverrides) { const response = await this.v4AirtableCommentsControllerGetCommentsV4Raw(requestParameters, initOverrides); return await response.value(); } }