@dodi-smart/nuki-graphql-api
Version:
Nuki GraphQL API
267 lines • 7.28 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiKeyService = void 0;
class ApiKeyService {
constructor(httpRequest) {
this.httpRequest = httpRequest;
}
/**
* Get a list of api keys
* @returns ApiKey successful operation
* @throws ApiError
*/
getApiKeys() {
return this.httpRequest.request({
method: 'GET',
url: '/api/key',
errors: {
401: `Not authorized`,
},
});
}
/**
* Create an api key
* @param requestBody Api key create representation
* @returns ApiKey Ok
* @throws ApiError
*/
createApiKey(requestBody) {
return this.httpRequest.request({
method: 'PUT',
url: '/api/key',
body: requestBody,
mediaType: '*/*',
errors: {
400: `Bad Parameter`,
401: `Not authorized`,
},
});
}
/**
* Update an api key
* @param apiKeyId The api key id
* @param requestBody Api key update representation
* @returns void
* @throws ApiError
*/
updateApiKey(apiKeyId, requestBody) {
return this.httpRequest.request({
method: 'POST',
url: '/api/key/{apiKeyId}',
path: {
'apiKeyId': apiKeyId,
},
body: requestBody,
mediaType: '*/*',
errors: {
400: `Invalid parameter given`,
401: `Not authorized`,
},
});
}
/**
* Delete an api key
* @param apiKeyId The api key id
* @returns void
* @throws ApiError
*/
deleteApiKey(apiKeyId) {
return this.httpRequest.request({
method: 'DELETE',
url: '/api/key/{apiKeyId}',
path: {
'apiKeyId': apiKeyId,
},
errors: {
401: `Not authorized`,
},
});
}
/**
* Get an advanced api key
* @param apiKeyId The api key id
* @returns AdvancedApiKey successful operation
* @throws ApiError
*/
getApiKeyAdvanced(apiKeyId) {
return this.httpRequest.request({
method: 'GET',
url: '/api/key/{apiKeyId}/advanced',
path: {
'apiKeyId': apiKeyId,
},
errors: {
401: `Not authorized`,
403: `Forbidden`,
404: `Not found`,
},
});
}
/**
* Create an advanced api key
* @param apiKeyId The api key id
* @param requestBody Apply for advaced api key representation
* @returns void
* @throws ApiError
*/
createApiKeyAdvanced(apiKeyId, requestBody) {
return this.httpRequest.request({
method: 'PUT',
url: '/api/key/{apiKeyId}/advanced',
path: {
'apiKeyId': apiKeyId,
},
body: requestBody,
mediaType: '*/*',
errors: {
400: `Bad Parameter`,
401: `Not authorized`,
},
});
}
/**
* Update an advanced api key
* @param apiKeyId The api key id
* @param requestBody Update for advaced api key representation
* @returns void
* @throws ApiError
*/
updateApiKeyAdvanced(apiKeyId, requestBody) {
return this.httpRequest.request({
method: 'POST',
url: '/api/key/{apiKeyId}/advanced',
path: {
'apiKeyId': apiKeyId,
},
body: requestBody,
mediaType: '*/*',
errors: {
400: `Bad Parameter`,
401: `Not authorized`,
},
});
}
/**
* Delete an advanced api key
* @param apiKeyId The api key id
* @returns void
* @throws ApiError
*/
deleteApiKeyAdvanced(apiKeyId) {
return this.httpRequest.request({
method: 'DELETE',
url: '/api/key/{apiKeyId}/advanced',
path: {
'apiKeyId': apiKeyId,
},
errors: {
401: `Not authorized`,
},
});
}
/**
* Reactivates a deactivated advanced webhook integration
* @param apiKeyId The api key id
* @returns void
* @throws ApiError
*/
updateApiKeyAdvancedReactivate(apiKeyId) {
return this.httpRequest.request({
method: 'POST',
url: '/api/key/{apiKeyId}/advanced/reactivate',
path: {
'apiKeyId': apiKeyId,
},
errors: {
400: `Bad Parameter`,
401: `Not authorized`,
},
});
}
/**
* Get a list of api key tokens
* @param apiKeyId The api key id
* @returns ApiKeyToken successful operation
* @throws ApiError
*/
getApiKeyTokens(apiKeyId) {
return this.httpRequest.request({
method: 'GET',
url: '/api/key/{apiKeyId}/token',
path: {
'apiKeyId': apiKeyId,
},
errors: {
401: `Not authorized`,
},
});
}
/**
* Create an api key token
* @param apiKeyId The api key id
* @param requestBody Api key token create representation
* @returns ApiKeyToken Ok
* @throws ApiError
*/
createApiKeyToken(apiKeyId, requestBody) {
return this.httpRequest.request({
method: 'PUT',
url: '/api/key/{apiKeyId}/token',
path: {
'apiKeyId': apiKeyId,
},
body: requestBody,
mediaType: '*/*',
errors: {
400: `Bad Parameter`,
401: `Not authorized`,
},
});
}
/**
* Update an api key token
* @param apiKeyId The api key id
* @param id The api key token id
* @param requestBody Api key token update representation
* @returns void
* @throws ApiError
*/
updateApiKeyToken(apiKeyId, id, requestBody) {
return this.httpRequest.request({
method: 'POST',
url: '/api/key/{apiKeyId}/token/{id}',
path: {
'apiKeyId': apiKeyId,
'id': id,
},
body: requestBody,
mediaType: '*/*',
errors: {
400: `Invalid parameter given`,
401: `Not authorized`,
},
});
}
/**
* Delete an api key token
* @param apiKeyId The api key id
* @param id The api key token id
* @returns void
* @throws ApiError
*/
deleteApiKeyToken(apiKeyId, id) {
return this.httpRequest.request({
method: 'DELETE',
url: '/api/key/{apiKeyId}/token/{id}',
path: {
'apiKeyId': apiKeyId,
'id': id,
},
errors: {
401: `Not authorized`,
},
});
}
}
exports.ApiKeyService = ApiKeyService;
//# sourceMappingURL=ApiKeyService.js.map