@dodi-smart/nuki-graphql-api
Version:
Nuki GraphQL API
109 lines • 3.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccountUserService = void 0;
class AccountUserService {
constructor(httpRequest) {
this.httpRequest = httpRequest;
}
/**
* Get an list of account users
* @param email Filter for email
* @param offset The offset of the first user in the collection to return
* @param limit The maximum number of users to return. If the value exceeds the maximum, then the maximum value will be used.
* @returns AccountUser successful operation
* @throws ApiError
*/
getAccountUsers(email, offset, limit) {
return this.httpRequest.request({
method: 'GET',
url: '/account/user',
query: {
'email': email,
'offset': offset,
'limit': limit,
},
errors: {
401: `Not authorized`,
},
});
}
/**
* Create an account user
* @param requestBody Account sub create representation
* @returns AccountUser Ok
* @throws ApiError
*/
createAccountUser(requestBody) {
return this.httpRequest.request({
method: 'PUT',
url: '/account/user',
body: requestBody,
mediaType: '*/*',
errors: {
400: `Invalid E-Mail address or name supplied`,
},
});
}
/**
* Get an account user
* @param accountUserId The account user id
* @returns AccountUser successful operation
* @throws ApiError
*/
getAccountUser(accountUserId) {
return this.httpRequest.request({
method: 'GET',
url: '/account/user/{accountUserId}',
path: {
'accountUserId': accountUserId,
},
errors: {
401: `Not authorized`,
},
});
}
/**
* Update an account user
* @param accountUserId The account user id
* @param requestBody Account update representation
* @returns AccountUser successful operation
* @throws ApiError
*/
updateAccountUser(accountUserId, requestBody) {
return this.httpRequest.request({
method: 'POST',
url: '/account/user/{accountUserId}',
path: {
'accountUserId': accountUserId,
},
body: requestBody,
mediaType: '*/*',
errors: {
400: `Invalid E-Mail address or name supplied`,
401: `Not authorized`,
409: `E-Mail address already exists`,
},
});
}
/**
* Deletes asynchronous an account user
* @param accountUserId The account user id
* @returns void
* @throws ApiError
*/
deleteAccountUser(accountUserId) {
return this.httpRequest.request({
method: 'DELETE',
url: '/account/user/{accountUserId}',
path: {
'accountUserId': accountUserId,
},
errors: {
401: `Not authorized`,
423: `Locked`,
},
});
}
}
exports.AccountUserService = AccountUserService;
//# sourceMappingURL=AccountUserService.js.map