UNPKG

@simplyhomes/sos-sdk

Version:

TypeScript SDK for Simply Homes SoS API v4

380 lines (379 loc) 20.6 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 { V4NotificationsCreateNotificationBodyDtoToJSON, V4NotificationsCreateNotificationResponseDtoFromJSON, V4NotificationsDeleteNotificationResponseDtoFromJSON, V4NotificationsGetNotificationResponseDtoFromJSON, V4NotificationsGetNotificationsFilteredByResponseDtoFromJSON, V4NotificationsGetNotificationsInViewResponseDtoFromJSON, V4NotificationsGetNotificationsResponseDtoFromJSON, V4NotificationsGetUniqueValuesResponseDtoFromJSON, V4NotificationsMarkAllNotificationsReadResponseDtoFromJSON, V4NotificationsUpdateNotificationBodyDtoToJSON, V4NotificationsUpdateNotificationResponseDtoFromJSON, } from '../models/index'; /** * */ export class NotificationsAPIV4Api extends runtime.BaseAPI { /** * Create a new notification for the authenticated user * Create a new notification */ async v4NotificationsControllerCreateNotificationV4Raw(requestParameters, initOverrides) { if (requestParameters['v4NotificationsCreateNotificationBodyDto'] == null) { throw new runtime.RequiredError('v4NotificationsCreateNotificationBodyDto', 'Required parameter "v4NotificationsCreateNotificationBodyDto" was null or undefined when calling v4NotificationsControllerCreateNotificationV4().'); } 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/notifications`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: V4NotificationsCreateNotificationBodyDtoToJSON(requestParameters['v4NotificationsCreateNotificationBodyDto']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4NotificationsCreateNotificationResponseDtoFromJSON(jsonValue)); } /** * Create a new notification for the authenticated user * Create a new notification */ async v4NotificationsControllerCreateNotificationV4(requestParameters, initOverrides) { const response = await this.v4NotificationsControllerCreateNotificationV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Permanently delete a notification for the authenticated user * Delete a specific notification by notificationId */ async v4NotificationsControllerDeleteNotificationV4Raw(requestParameters, initOverrides) { if (requestParameters['notificationId'] == null) { throw new runtime.RequiredError('notificationId', 'Required parameter "notificationId" was null or undefined when calling v4NotificationsControllerDeleteNotificationV4().'); } 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/notifications/{notificationId}`; urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId']))); const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4NotificationsDeleteNotificationResponseDtoFromJSON(jsonValue)); } /** * Permanently delete a notification for the authenticated user * Delete a specific notification by notificationId */ async v4NotificationsControllerDeleteNotificationV4(requestParameters, initOverrides) { const response = await this.v4NotificationsControllerDeleteNotificationV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Retrieve detailed information about a specific notification for the authenticated user * Get a specific notification by notificationId */ async v4NotificationsControllerGetNotificationV4Raw(requestParameters, initOverrides) { if (requestParameters['notificationId'] == null) { throw new runtime.RequiredError('notificationId', 'Required parameter "notificationId" was null or undefined when calling v4NotificationsControllerGetNotificationV4().'); } const queryParameters = {}; 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/notifications/{notificationId}`; urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4NotificationsGetNotificationResponseDtoFromJSON(jsonValue)); } /** * Retrieve detailed information about a specific notification for the authenticated user * Get a specific notification by notificationId */ async v4NotificationsControllerGetNotificationV4(requestParameters, initOverrides) { const response = await this.v4NotificationsControllerGetNotificationV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Retrieve notifications for the authenticated user filtered by column value * Get notifications filtered by a specific column and value */ async v4NotificationsControllerGetNotificationsFilteredByV4Raw(requestParameters, initOverrides) { if (requestParameters['column'] == null) { throw new runtime.RequiredError('column', 'Required parameter "column" was null or undefined when calling v4NotificationsControllerGetNotificationsFilteredByV4().'); } if (requestParameters['value'] == null) { throw new runtime.RequiredError('value', 'Required parameter "value" was null or undefined when calling v4NotificationsControllerGetNotificationsFilteredByV4().'); } const queryParameters = {}; if (requestParameters['viewId'] != null) { queryParameters['viewId'] = requestParameters['viewId']; } if (requestParameters['columns'] != null) { queryParameters['columns'] = requestParameters['columns']; } 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['filterOperation'] != null) { queryParameters['filterOperation'] = requestParameters['filterOperation']; } 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/notifications/filteredBy/{column}/{value}`; urlPath = urlPath.replace(`{${"column"}}`, encodeURIComponent(String(requestParameters['column']))); urlPath = urlPath.replace(`{${"value"}}`, encodeURIComponent(String(requestParameters['value']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4NotificationsGetNotificationsFilteredByResponseDtoFromJSON(jsonValue)); } /** * Retrieve notifications for the authenticated user filtered by column value * Get notifications filtered by a specific column and value */ async v4NotificationsControllerGetNotificationsFilteredByV4(requestParameters, initOverrides) { const response = await this.v4NotificationsControllerGetNotificationsFilteredByV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Retrieve notifications for the authenticated user filtered by a specific view * Get notifications with a specific viewId */ async v4NotificationsControllerGetNotificationsInViewV4Raw(requestParameters, initOverrides) { if (requestParameters['viewId'] == null) { throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4NotificationsControllerGetNotificationsInViewV4().'); } 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/notifications/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) => V4NotificationsGetNotificationsInViewResponseDtoFromJSON(jsonValue)); } /** * Retrieve notifications for the authenticated user filtered by a specific view * Get notifications with a specific viewId */ async v4NotificationsControllerGetNotificationsInViewV4(requestParameters, initOverrides) { const response = await this.v4NotificationsControllerGetNotificationsInViewV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Retrieve a list of notifications for the authenticated user with optional view filtering * Get notifications with optional viewId */ async v4NotificationsControllerGetNotificationsV4Raw(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/notifications`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4NotificationsGetNotificationsResponseDtoFromJSON(jsonValue)); } /** * Retrieve a list of notifications for the authenticated user with optional view filtering * Get notifications with optional viewId */ async v4NotificationsControllerGetNotificationsV4(requestParameters = {}, initOverrides) { const response = await this.v4NotificationsControllerGetNotificationsV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Retrieve unique values for the authenticated user\'s notifications with occurrence counts * Get unique values for a specific notification column with counts */ async v4NotificationsControllerGetUniqueValuesV4Raw(requestParameters, initOverrides) { if (requestParameters['column'] == null) { throw new runtime.RequiredError('column', 'Required parameter "column" was null or undefined when calling v4NotificationsControllerGetUniqueValuesV4().'); } const queryParameters = {}; if (requestParameters['limit'] != null) { queryParameters['limit'] = requestParameters['limit']; } if (requestParameters['offset'] != null) { queryParameters['offset'] = requestParameters['offset']; } 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/notifications/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) => V4NotificationsGetUniqueValuesResponseDtoFromJSON(jsonValue)); } /** * Retrieve unique values for the authenticated user\'s notifications with occurrence counts * Get unique values for a specific notification column with counts */ async v4NotificationsControllerGetUniqueValuesV4(requestParameters, initOverrides) { const response = await this.v4NotificationsControllerGetUniqueValuesV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Marks all unread notifications as read for the authenticated user * Mark all notifications as read */ async v4NotificationsControllerMarkAllNotificationsAsReadV4Raw(initOverrides) { 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/notifications/read-all`; const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4NotificationsMarkAllNotificationsReadResponseDtoFromJSON(jsonValue)); } /** * Marks all unread notifications as read for the authenticated user * Mark all notifications as read */ async v4NotificationsControllerMarkAllNotificationsAsReadV4(initOverrides) { const response = await this.v4NotificationsControllerMarkAllNotificationsAsReadV4Raw(initOverrides); return await response.value(); } /** * Update notification properties (e.g., mark as read/unread, star/unstar) * Update a specific notification by notificationId */ async v4NotificationsControllerUpdateNotificationV4Raw(requestParameters, initOverrides) { if (requestParameters['notificationId'] == null) { throw new runtime.RequiredError('notificationId', 'Required parameter "notificationId" was null or undefined when calling v4NotificationsControllerUpdateNotificationV4().'); } if (requestParameters['v4NotificationsUpdateNotificationBodyDto'] == null) { throw new runtime.RequiredError('v4NotificationsUpdateNotificationBodyDto', 'Required parameter "v4NotificationsUpdateNotificationBodyDto" was null or undefined when calling v4NotificationsControllerUpdateNotificationV4().'); } 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/notifications/{notificationId}`; urlPath = urlPath.replace(`{${"notificationId"}}`, encodeURIComponent(String(requestParameters['notificationId']))); const response = await this.request({ path: urlPath, method: 'PATCH', headers: headerParameters, query: queryParameters, body: V4NotificationsUpdateNotificationBodyDtoToJSON(requestParameters['v4NotificationsUpdateNotificationBodyDto']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4NotificationsUpdateNotificationResponseDtoFromJSON(jsonValue)); } /** * Update notification properties (e.g., mark as read/unread, star/unstar) * Update a specific notification by notificationId */ async v4NotificationsControllerUpdateNotificationV4(requestParameters, initOverrides) { const response = await this.v4NotificationsControllerUpdateNotificationV4Raw(requestParameters, initOverrides); return await response.value(); } }