@bunq-community/bunq-js-client
Version:
[ ](https://github.com/@bunq-community/bunq-js-client) [ ](https://www.npmjs.com/package/@bun
50 lines (49 loc) • 1.99 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class MonetaryAccountJoint {
/**
* @param {ApiAdapter} ApiAdapter
*/
constructor(ApiAdapter) {
this.ApiAdapter = ApiAdapter;
this.Session = ApiAdapter.Session;
}
/**
* @param {number} userId
* @param {number} monetaryAccountJointId
* @param options
* @returns {Promise<any>}
*/
async get(userId, monetaryAccountJointId, options = {}) {
const limiter = this.ApiAdapter.RequestLimitFactory.create("/monetary-account-joint", "GET");
const response = await limiter.run(async (axiosClient) => this.ApiAdapter.get(`/v1/user/${userId}/monetary-account-joint/${monetaryAccountJointId}`, {}, {}, axiosClient));
return response.Response[0];
}
/**
* @param {number} userId
* @param {PaginationOptions} options
* @returns {Promise<void>}
*/
async list(userId, options = {
count: 25,
newer_id: false,
older_id: false
}) {
const limiter = this.ApiAdapter.RequestLimitFactory.create("/monetary-account-joint", "LIST");
const response = await limiter.run(async (axiosClient) => this.ApiAdapter.get(`/v1/user/${userId}/monetary-account-joint`, {}, {}, axiosClient));
return response.Response;
}
/**
* @param {number} userId
* @param {number} accountId
* @param {monetaryAccountPutRequest} MonetaryAccountPutRequest
* @param op¶tions
* @returns {Promise<any>}
*/
async put(userId, accountId, monetaryAccountPutRequest, options = {}) {
const limiter = this.ApiAdapter.RequestLimitFactory.create("/monetary-account-joint", "PUT");
const response = await limiter.run(async (axiosClient) => this.ApiAdapter.put(`/v1/user/${userId}/monetary-account-joint/${accountId}`, monetaryAccountPutRequest, {}, {}, axiosClient));
return response.Response;
}
}
exports.default = MonetaryAccountJoint;