UNPKG

@dodi-smart/nuki-graphql-api

Version:
345 lines 9.99 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SmartlockService = void 0; class SmartlockService { constructor(httpRequest) { this.httpRequest = httpRequest; } /** * Updates the web config for a group of smartlocks * @param requestBody Smartlocks web config update representation * @returns void * @throws ApiError */ updateSmartlockBulkWebConfig(requestBody) { return this.httpRequest.request({ method: 'POST', url: '/bulk-web-config', body: requestBody, mediaType: '*/*', errors: { 400: `Bad parameter`, 401: `Not authorized`, }, }); } /** * Get a list of smartlocks * @param authId Filter for authId * @param type Filter for type * @returns Smartlock successful operation * @throws ApiError */ getSmartlocks(authId, type) { return this.httpRequest.request({ method: 'GET', url: '/smartlock', query: { 'authId': authId, 'type': type, }, errors: { 401: `Not authorized`, }, }); } /** * Create a smartlock * @param requestBody Smartlock create representation * @returns Smartlock successful operation * @throws ApiError */ createSmartlock(requestBody) { return this.httpRequest.request({ method: 'PUT', url: '/smartlock', body: requestBody, mediaType: '*/*', errors: { 400: `Bad Parameter`, 401: `Not authorized`, 403: `Forbidden`, 409: `Smartlock already exists`, }, }); } /** * Get a smartlock * @param smartlockId The smartlock id * @returns Smartlock successful operation * @throws ApiError */ getSmartlock(smartlockId) { return this.httpRequest.request({ method: 'GET', url: '/smartlock/{smartlockId}', path: { 'smartlockId': smartlockId, }, errors: { 401: `Not authorized`, 403: `Forbidden`, 404: `Not found`, }, }); } /** * Update a smartlock * @param smartlockId The smartlock id * @param requestBody Smartlock update representation * @returns void * @throws ApiError */ updateSmartlock(smartlockId, requestBody) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}', path: { 'smartlockId': smartlockId, }, body: requestBody, mediaType: '*/*', errors: { 400: `Invalid parameter given`, 401: `Not authorized`, 403: `Forbidden`, }, }); } /** * Delete a smartlock * @param smartlockId The smartlock id * @returns void * @throws ApiError */ deleteSmartlock(smartlockId) { return this.httpRequest.request({ method: 'DELETE', url: '/smartlock/{smartlockId}', path: { 'smartlockId': smartlockId, }, errors: { 400: `Bad parameter`, 401: `Not authorized`, 403: `Forbidden`, }, }); } /** * Lock & unlock a smartlock with options * @param smartlockId The smartlock id * @param requestBody Smartlock action representation * @returns void * @throws ApiError */ operateSmartlock(smartlockId, requestBody) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/action', path: { 'smartlockId': smartlockId, }, body: requestBody, mediaType: '*/*', errors: { 400: `Bad Parameter`, 401: `Not authorized`, 402: `Account not payed`, }, }); } /** * Lock a smartlock * @param smartlockId The smartlock id * @returns void * @throws ApiError */ lockSmartlock(smartlockId) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/action/lock', path: { 'smartlockId': smartlockId, }, errors: { 400: `Bad Parameter`, 401: `Not authorized`, 405: `Not allowed`, }, }); } /** * Unlock a smartlock * @param smartlockId The smartlock id * @returns void * @throws ApiError */ unlockSmartlock(smartlockId) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/action/unlock', path: { 'smartlockId': smartlockId, }, errors: { 400: `Bad Parameter`, 401: `Not authorized`, 405: `Not allowed`, }, }); } /** * Updates a smartlock admin pin * @param smartlockId The smartlock id * @param requestBody Smartlock admin pin update representation * @returns void * @throws ApiError */ updateSmartlockAdminPin(smartlockId, requestBody) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/admin/pin', path: { 'smartlockId': smartlockId, }, body: requestBody, mediaType: '*/*', errors: { 400: `Bad parameter`, 401: `Not authorized`, }, }); } /** * Updates a smartlock advanced config * @param smartlockId The smartlock id * @param requestBody Smartlock config update representation * @returns void * @throws ApiError */ updateSmartlockAdvancedConfig(smartlockId, requestBody) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/advanced/config', path: { 'smartlockId': smartlockId, }, body: requestBody, mediaType: '*/*', errors: { 400: `Bad parameter`, 401: `Not authorized`, }, }); } /** * Updates an opener advanced config * @param smartlockId The smartlock (opener) id * @param requestBody Opener advanced config update representation * @returns void * @throws ApiError */ updateSmartlockOpenerAdvancedConfig(smartlockId, requestBody) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/advanced/openerconfig', path: { 'smartlockId': smartlockId, }, body: requestBody, mediaType: '*/*', errors: { 400: `Bad parameter`, 401: `Not authorized`, }, }); } /** * Updates a smartdoor advanced config * @param smartlockId The smartdoor id * @param requestBody Smartdoor advanced config update representation * @returns void * @throws ApiError */ updateSmartdoorAdvancedConfig(smartlockId, requestBody) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/advanced/smartdoorconfig', path: { 'smartlockId': smartlockId, }, body: requestBody, mediaType: '*/*', errors: { 400: `Bad parameter`, 401: `Not authorized`, }, }); } /** * Updates a smartlock config * @param smartlockId The smartlock id * @param requestBody Smartlock config update representation * @returns void * @throws ApiError */ updateSmartlockConfig(smartlockId, requestBody) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/config', path: { 'smartlockId': smartlockId, }, body: requestBody, mediaType: '*/*', errors: { 400: `Bad parameter`, 401: `Not authorized`, }, }); } /** * Syncs a smartlock * @param smartlockId The smartlock id * @returns void * @throws ApiError */ syncSmartlock(smartlockId) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/sync', path: { 'smartlockId': smartlockId, }, errors: { 400: `Bad Parameter`, 401: `Not authorized`, }, }); } /** * Updates a smartlock web config * @param smartlockId The smartlock id * @param requestBody Smartlock web config update representation * @returns void * @throws ApiError */ updateSmartlockWebConfig(smartlockId, requestBody) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/web/config', path: { 'smartlockId': smartlockId, }, body: requestBody, mediaType: '*/*', errors: { 400: `Bad parameter`, 401: `Not authorized`, }, }); } } exports.SmartlockService = SmartlockService; //# sourceMappingURL=SmartlockService.js.map