box-node-sdk
Version:
Official SDK for Box Plaform APIs
111 lines • 6.49 kB
JavaScript
;
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var url_path_1 = __importDefault(require("../util/url-path"));
/**
*/
var ShieldInformationBarrierSegmentsManager = /** @class */ (function () {
/**
* @param {BoxClient} client The Box API Client that is responsible for making calls to the API
*/
function ShieldInformationBarrierSegmentsManager(client) {
this.client = client;
}
/**
* Get shield information barrier segment with specified ID
*
* Retrieves shield information barrier segment based on provided ID..
* @param {object} options Options for the request
* @param {string} options.shield_information_barrier_segment_id The ID of the shield information barrier segment.
* @param {Function} [callback] Passed the result if successful, error otherwise
* @returns {Promise<schemas.ShieldInformationBarrierSegment>} A promise resolving to the result or rejecting with an error
*/
ShieldInformationBarrierSegmentsManager.prototype.getById = function (options, callback) {
var shieldInformationBarrierSegmentId = options.shield_information_barrier_segment_id, queryParams = __rest(options, ["shield_information_barrier_segment_id"]), apiPath = (0, url_path_1.default)('shield_information_barrier_segments', shieldInformationBarrierSegmentId), params = {
qs: queryParams,
};
return this.client.wrapWithDefaultHandler(this.client.get)(apiPath, params, callback);
};
/**
* List shield information barrier segments
*
* Retrieves a list of shield information barrier segment objects
* for the specified Information Barrier ID.
* @param {object} options Options for the request
* @param {string} options.shield_information_barrier_id The ID of the shield information barrier.
* @param {string} [options.marker] Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`.
* @param {number} [options.limit] The maximum number of items to return per page.
* @param {Function} [callback] Passed the result if successful, error otherwise
* @returns {Promise<schemas.ShieldInformationBarrierSegments>} A promise resolving to the result or rejecting with an error
*/
ShieldInformationBarrierSegmentsManager.prototype.getAll = function (options, callback) {
var queryParams = __rest(options, []), apiPath = (0, url_path_1.default)('shield_information_barrier_segments'), params = {
qs: queryParams,
};
return this.client.wrapWithDefaultHandler(this.client.get)(apiPath, params, callback);
};
/**
* Create shield information barrier segment
*
* Creates a shield information barrier segment.
* @param {object} body
* @param {object} [options] Options for the request
* @param {Function} [callback] Passed the result if successful, error otherwise
* @returns {Promise<schemas.ShieldInformationBarrierSegment>} A promise resolving to the result or rejecting with an error
*/
ShieldInformationBarrierSegmentsManager.prototype.create = function (body, options, callback) {
var queryParams = __rest(options, []), apiPath = (0, url_path_1.default)('shield_information_barrier_segments'), params = {
qs: queryParams,
body: body,
};
return this.client.wrapWithDefaultHandler(this.client.post)(apiPath, params, callback);
};
/**
* Update shield information barrier segment with specified ID
*
* Updates the shield information barrier segment based on provided ID..
* @param {object} body
* @param {object} options Options for the request
* @param {string} options.shield_information_barrier_segment_id The ID of the shield information barrier segment.
* @param {Function} [callback] Passed the result if successful, error otherwise
* @returns {Promise<schemas.ShieldInformationBarrierSegment>} A promise resolving to the result or rejecting with an error
*/
ShieldInformationBarrierSegmentsManager.prototype.update = function (body, options, callback) {
var shieldInformationBarrierSegmentId = options.shield_information_barrier_segment_id, queryParams = __rest(options, ["shield_information_barrier_segment_id"]), apiPath = (0, url_path_1.default)('shield_information_barrier_segments', shieldInformationBarrierSegmentId), params = {
qs: queryParams,
body: body,
};
return this.client.wrapWithDefaultHandler(this.client.put)(apiPath, params, callback);
};
/**
* Delete shield information barrier segment
*
* Deletes the shield information barrier segment
* based on provided ID.
* @param {object} options Options for the request
* @param {string} options.shield_information_barrier_segment_id The ID of the shield information barrier segment.
* @param {Function} [callback] Passed the result if successful, error otherwise
* @returns {Promise<void>} A promise resolving to the result or rejecting with an error
*/
ShieldInformationBarrierSegmentsManager.prototype.deleteById = function (options, callback) {
var shieldInformationBarrierSegmentId = options.shield_information_barrier_segment_id, queryParams = __rest(options, ["shield_information_barrier_segment_id"]), apiPath = (0, url_path_1.default)('shield_information_barrier_segments', shieldInformationBarrierSegmentId), params = {
qs: queryParams,
};
return this.client.wrapWithDefaultHandler(this.client.del)(apiPath, params, callback);
};
return ShieldInformationBarrierSegmentsManager;
}());
module.exports = ShieldInformationBarrierSegmentsManager;
//# sourceMappingURL=shield-information-barrier-segments.generated.js.map