UNPKG

@dodi-smart/nuki-graphql-api

Version:
171 lines 5.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AdvancedApiService = void 0; class AdvancedApiService { constructor(httpRequest) { this.httpRequest = httpRequest; } /** * Get all registered decentral webhooks * @returns DecentralWebhook successful operation * @throws ApiError */ getDecentralWebhooks() { return this.httpRequest.request({ method: 'GET', url: '/api/decentralWebhook', errors: { 401: `Not authorized`, 403: `Forbidden`, }, }); } /** * Create decentral webhook * @param requestBody Decentral webhook representation * @returns DecentralWebhook successful operation * @throws ApiError */ createDecentralWebhook(requestBody) { return this.httpRequest.request({ method: 'PUT', url: '/api/decentralWebhook', body: requestBody, mediaType: '*/*', errors: { 400: `Bad Parameter`, 401: `Not authorized`, 403: `Forbidden`, }, }); } /** * Unregister a decentral webhook * @param id The ID of the decentral webhook * @returns void * @throws ApiError */ deleteDecentralWebhook(id) { return this.httpRequest.request({ method: 'DELETE', url: '/api/decentralWebhook/{id}', path: { 'id': id, }, errors: { 401: `Not authorized`, 403: `Forbidden`, }, }); } /** * Get a list of webhook logs (descending) * @param apiKeyId The api key id * @param id Optionally filter for older logs * @param limit Amount of logs (max: 100) * @returns WebhookLog successful operation * @throws ApiError */ getWebhookLogs(apiKeyId, id, limit = 50) { return this.httpRequest.request({ method: 'GET', url: '/api/key/{apiKeyId}/webhook/logs', path: { 'apiKeyId': apiKeyId, }, query: { 'id': id, 'limit': limit, }, errors: { 401: `Not authorized`, }, }); } /** * Creates asynchronous smartlock authorizations * @param requestBody Smartlock authorization create representation * @returns AdvancedConfirmationResponse Ok * @throws ApiError */ createSmartlockAuthsAdvanced(requestBody) { return this.httpRequest.request({ method: 'PUT', url: '/smartlock/auth/advanced', body: requestBody, mediaType: '*/*', errors: { 400: `Bad parameter`, 402: `Account not payed`, 409: `Parameter conflicts`, 426: `Account upgrade required`, }, }); } /** * Smartlock Action with Callback * @param smartlockId The smartlock id * @param requestBody Smartlock action representation * @returns AdvancedConfirmationResponse Ok * @throws ApiError */ operateSmartlockAdvanced(smartlockId, requestBody) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/action/advanced', path: { 'smartlockId': smartlockId, }, body: requestBody, mediaType: '*/*', errors: { 400: `Bad parameter`, 402: `Account not payed`, 409: `Parameter conflicts`, 426: `Account upgrade required`, }, }); } /** * Lock a smartlock * @param smartlockId The smartlock id * @returns AdvancedConfirmationResponse Ok * @throws ApiError */ lockSmartlockAdvanced(smartlockId) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/action/lock/advanced', path: { 'smartlockId': smartlockId, }, errors: { 400: `Bad Parameter`, 401: `Not authorized`, 405: `Not allowed`, }, }); } /** * Unlock a smartlock * @param smartlockId The smartlock id * @returns AdvancedConfirmationResponse Ok * @throws ApiError */ unlockSmartlockAdvanced(smartlockId) { return this.httpRequest.request({ method: 'POST', url: '/smartlock/{smartlockId}/action/unlock/advanced', path: { 'smartlockId': smartlockId, }, errors: { 400: `Bad Parameter`, 401: `Not authorized`, 405: `Not allowed`, }, }); } } exports.AdvancedApiService = AdvancedApiService; //# sourceMappingURL=AdvancedApiService.js.map