@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
181 lines (180 loc) • 9.8 kB
JavaScript
/* 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 { V4UpdatesGetUpdateColumnsResponseDtoFromJSON, V4UpdatesGetUpdateResponseDtoFromJSON, V4UpdatesGetUpdatesInViewResponseDtoFromJSON, V4UpdatesGetUpdatesResponseDtoFromJSON, } from '../models/index';
/**
*
*/
export class V4UpdatesApi extends runtime.BaseAPI {
/**
* # GET /v4/updates/:updateId/:columns ## Overview Retrieves specific columns for a single update.
* Get specific columns for an update
*/
async v4UpdatesControllerGetUpdateColumnsV4Raw(requestParameters, initOverrides) {
if (requestParameters['updateId'] == null) {
throw new runtime.RequiredError('updateId', 'Required parameter "updateId" was null or undefined when calling v4UpdatesControllerGetUpdateColumnsV4().');
}
if (requestParameters['columns'] == null) {
throw new runtime.RequiredError('columns', 'Required parameter "columns" was null or undefined when calling v4UpdatesControllerGetUpdateColumnsV4().');
}
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/updates/{updateId}/{columns}`;
urlPath = urlPath.replace(`{${"updateId"}}`, encodeURIComponent(String(requestParameters['updateId'])));
urlPath = urlPath.replace(`{${"columns"}}`, encodeURIComponent(String(requestParameters['columns'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4UpdatesGetUpdateColumnsResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/updates/:updateId/:columns ## Overview Retrieves specific columns for a single update.
* Get specific columns for an update
*/
async v4UpdatesControllerGetUpdateColumnsV4(requestParameters, initOverrides) {
const response = await this.v4UpdatesControllerGetUpdateColumnsV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/updates/:updateId ## Overview Retrieves a single update by its unique identifier. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header
* Get a single update by ID
*/
async v4UpdatesControllerGetUpdateV4Raw(requestParameters, initOverrides) {
if (requestParameters['updateId'] == null) {
throw new runtime.RequiredError('updateId', 'Required parameter "updateId" was null or undefined when calling v4UpdatesControllerGetUpdateV4().');
}
const queryParameters = {};
if (requestParameters['columns'] != null) {
queryParameters['columns'] = requestParameters['columns'];
}
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/updates/{updateId}`;
urlPath = urlPath.replace(`{${"updateId"}}`, encodeURIComponent(String(requestParameters['updateId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4UpdatesGetUpdateResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/updates/:updateId ## Overview Retrieves a single update by its unique identifier. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header
* Get a single update by ID
*/
async v4UpdatesControllerGetUpdateV4(requestParameters, initOverrides) {
const response = await this.v4UpdatesControllerGetUpdateV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/updates/viewId/:viewId ## Overview Retrieves updates filtered by a specific view configuration.
* Get updates in a specific view
*/
async v4UpdatesControllerGetUpdatesInViewV4Raw(requestParameters, initOverrides) {
if (requestParameters['viewId'] == null) {
throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4UpdatesControllerGetUpdatesInViewV4().');
}
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/updates/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) => V4UpdatesGetUpdatesInViewResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/updates/viewId/:viewId ## Overview Retrieves updates filtered by a specific view configuration.
* Get updates in a specific view
*/
async v4UpdatesControllerGetUpdatesInViewV4(requestParameters, initOverrides) {
const response = await this.v4UpdatesControllerGetUpdatesInViewV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/updates ## Overview Retrieves a list of platform updates and announcements with optional filtering, sorting, and pagination. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Use Cases - Display \"What\'s New\" updates to users - Show recent platform improvements - Filter updates by category - Sort by timestamp or creation date
* Get platform updates
*/
async v4UpdatesControllerGetUpdatesV4Raw(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/updates`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4UpdatesGetUpdatesResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/updates ## Overview Retrieves a list of platform updates and announcements with optional filtering, sorting, and pagination. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Use Cases - Display \"What\'s New\" updates to users - Show recent platform improvements - Filter updates by category - Sort by timestamp or creation date
* Get platform updates
*/
async v4UpdatesControllerGetUpdatesV4(requestParameters = {}, initOverrides) {
const response = await this.v4UpdatesControllerGetUpdatesV4Raw(requestParameters, initOverrides);
return await response.value();
}
}