UNPKG

@simplyhomes/sos-sdk

Version:

TypeScript SDK for Simply Homes SoS API v4

303 lines (302 loc) 15.7 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 { V4RenovationsCreateRenovationBodyDtoToJSON, V4RenovationsCreateRenovationResponseDtoFromJSON, V4RenovationsDeleteRenovationResponseDtoFromJSON, V4RenovationsGetRenovationResponseDtoFromJSON, V4RenovationsGetRenovationsInViewResponseDtoFromJSON, V4RenovationsGetRenovationsResponseDtoFromJSON, V4RenovationsGetUniqueValuesResponseDtoFromJSON, V4RenovationsUpdateRenovationBodyDtoToJSON, V4RenovationsUpdateRenovationResponseDtoFromJSON, } from '../models/index'; /** * */ export class RenovationsAPIV4Api extends runtime.BaseAPI { /** * Create a new renovation record in the system * Create a new renovation */ async v4RenovationsControllerCreateRenovationV4Raw(requestParameters, initOverrides) { if (requestParameters['v4RenovationsCreateRenovationBodyDto'] == null) { throw new runtime.RequiredError('v4RenovationsCreateRenovationBodyDto', 'Required parameter "v4RenovationsCreateRenovationBodyDto" was null or undefined when calling v4RenovationsControllerCreateRenovationV4().'); } const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; 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/renovations`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: V4RenovationsCreateRenovationBodyDtoToJSON(requestParameters['v4RenovationsCreateRenovationBodyDto']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4RenovationsCreateRenovationResponseDtoFromJSON(jsonValue)); } /** * Create a new renovation record in the system * Create a new renovation */ async v4RenovationsControllerCreateRenovationV4(requestParameters, initOverrides) { const response = await this.v4RenovationsControllerCreateRenovationV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Remove a renovation record from the system * Delete a specific renovation by renovationId */ async v4RenovationsControllerDeleteRenovationV4Raw(requestParameters, initOverrides) { if (requestParameters['renovationId'] == null) { throw new runtime.RequiredError('renovationId', 'Required parameter "renovationId" was null or undefined when calling v4RenovationsControllerDeleteRenovationV4().'); } 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/renovations/{renovationId}`; urlPath = urlPath.replace(`{${"renovationId"}}`, encodeURIComponent(String(requestParameters['renovationId']))); const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4RenovationsDeleteRenovationResponseDtoFromJSON(jsonValue)); } /** * Remove a renovation record from the system * Delete a specific renovation by renovationId */ async v4RenovationsControllerDeleteRenovationV4(requestParameters, initOverrides) { const response = await this.v4RenovationsControllerDeleteRenovationV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Retrieve detailed information about a specific renovation * Get a specific renovation by renovationId */ async v4RenovationsControllerGetRenovationV4Raw(requestParameters, initOverrides) { if (requestParameters['renovationId'] == null) { throw new runtime.RequiredError('renovationId', 'Required parameter "renovationId" was null or undefined when calling v4RenovationsControllerGetRenovationV4().'); } const queryParameters = {}; if (requestParameters['viewId'] != null) { queryParameters['viewId'] = requestParameters['viewId']; } if (requestParameters['limit'] != null) { queryParameters['limit'] = requestParameters['limit']; } if (requestParameters['offset'] != null) { queryParameters['offset'] = requestParameters['offset']; } if (requestParameters['countOnly'] != null) { queryParameters['countOnly'] = requestParameters['countOnly']; } 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/renovations/{renovationId}`; urlPath = urlPath.replace(`{${"renovationId"}}`, encodeURIComponent(String(requestParameters['renovationId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4RenovationsGetRenovationResponseDtoFromJSON(jsonValue)); } /** * Retrieve detailed information about a specific renovation * Get a specific renovation by renovationId */ async v4RenovationsControllerGetRenovationV4(requestParameters, initOverrides) { const response = await this.v4RenovationsControllerGetRenovationV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Retrieve renovations filtered by a specific view configuration * Get renovations with a specific viewId */ async v4RenovationsControllerGetRenovationsInViewV4Raw(requestParameters, initOverrides) { if (requestParameters['viewId'] == null) { throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4RenovationsControllerGetRenovationsInViewV4().'); } 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']; } 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/renovations/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) => V4RenovationsGetRenovationsInViewResponseDtoFromJSON(jsonValue)); } /** * Retrieve renovations filtered by a specific view configuration * Get renovations with a specific viewId */ async v4RenovationsControllerGetRenovationsInViewV4(requestParameters, initOverrides) { const response = await this.v4RenovationsControllerGetRenovationsInViewV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Retrieve a list of renovations with optional view filtering * Get renovations with optional viewId */ async v4RenovationsControllerGetRenovationsV4Raw(requestParameters, initOverrides) { const queryParameters = {}; if (requestParameters['viewId'] != null) { queryParameters['viewId'] = requestParameters['viewId']; } if (requestParameters['limit'] != null) { queryParameters['limit'] = requestParameters['limit']; } if (requestParameters['offset'] != null) { queryParameters['offset'] = requestParameters['offset']; } if (requestParameters['countOnly'] != null) { queryParameters['countOnly'] = requestParameters['countOnly']; } 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/renovations`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4RenovationsGetRenovationsResponseDtoFromJSON(jsonValue)); } /** * Retrieve a list of renovations with optional view filtering * Get renovations with optional viewId */ async v4RenovationsControllerGetRenovationsV4(requestParameters = {}, initOverrides) { const response = await this.v4RenovationsControllerGetRenovationsV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Retrieve unique values from a renovation column along with their occurrence counts * Get unique values for a specific renovation column with counts */ async v4RenovationsControllerGetUniqueValuesV4Raw(requestParameters, initOverrides) { if (requestParameters['column'] == null) { throw new runtime.RequiredError('column', 'Required parameter "column" was null or undefined when calling v4RenovationsControllerGetUniqueValuesV4().'); } const queryParameters = {}; if (requestParameters['viewId'] != null) { queryParameters['viewId'] = requestParameters['viewId']; } if (requestParameters['offset'] != null) { queryParameters['offset'] = requestParameters['offset']; } if (requestParameters['limit'] != null) { queryParameters['limit'] = requestParameters['limit']; } 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/renovations/unique/{column}`; urlPath = urlPath.replace(`{${"column"}}`, encodeURIComponent(String(requestParameters['column']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4RenovationsGetUniqueValuesResponseDtoFromJSON(jsonValue)); } /** * Retrieve unique values from a renovation column along with their occurrence counts * Get unique values for a specific renovation column with counts */ async v4RenovationsControllerGetUniqueValuesV4(requestParameters, initOverrides) { const response = await this.v4RenovationsControllerGetUniqueValuesV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Update an existing renovation record with new data * Update a specific renovation by renovationId */ async v4RenovationsControllerUpdateRenovationV4Raw(requestParameters, initOverrides) { if (requestParameters['renovationId'] == null) { throw new runtime.RequiredError('renovationId', 'Required parameter "renovationId" was null or undefined when calling v4RenovationsControllerUpdateRenovationV4().'); } if (requestParameters['v4RenovationsUpdateRenovationBodyDto'] == null) { throw new runtime.RequiredError('v4RenovationsUpdateRenovationBodyDto', 'Required parameter "v4RenovationsUpdateRenovationBodyDto" was null or undefined when calling v4RenovationsControllerUpdateRenovationV4().'); } const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; 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/renovations/{renovationId}`; urlPath = urlPath.replace(`{${"renovationId"}}`, encodeURIComponent(String(requestParameters['renovationId']))); const response = await this.request({ path: urlPath, method: 'PATCH', headers: headerParameters, query: queryParameters, body: V4RenovationsUpdateRenovationBodyDtoToJSON(requestParameters['v4RenovationsUpdateRenovationBodyDto']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4RenovationsUpdateRenovationResponseDtoFromJSON(jsonValue)); } /** * Update an existing renovation record with new data * Update a specific renovation by renovationId */ async v4RenovationsControllerUpdateRenovationV4(requestParameters, initOverrides) { const response = await this.v4RenovationsControllerUpdateRenovationV4Raw(requestParameters, initOverrides); return await response.value(); } }