box-node-sdk
Version:
Official SDK for Box Platform APIs
87 lines • 2.48 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FetchOptions = void 0;
class FetchOptions {
/**
* URL of the request */
url;
/**
* HTTP verb of the request */
method;
/**
* HTTP query parameters */
params;
/**
* HTTP headers */
headers;
/**
* Request body of the request */
data;
/**
* Stream data of the request */
fileStream;
/**
* Multipart data of the request */
multipartData;
/**
* Content type of the request body */
contentType = 'application/json';
/**
* Expected response format */
responseFormat = 'json';
/**
* Authentication object */
auth;
/**
* Network session object */
networkSession;
/**
* Cancellation token */
cancellationToken;
/**
* A boolean value indicate if the request should follow redirects. Defaults to True. Not supported in Browser environment. */
followRedirects = true;
constructor(fields) {
if (fields.url !== undefined) {
this.url = fields.url;
}
if (fields.method !== undefined) {
this.method = fields.method;
}
if (fields.params !== undefined) {
this.params = fields.params;
}
if (fields.headers !== undefined) {
this.headers = fields.headers;
}
if (fields.data !== undefined) {
this.data = fields.data;
}
if (fields.fileStream !== undefined) {
this.fileStream = fields.fileStream;
}
if (fields.multipartData !== undefined) {
this.multipartData = fields.multipartData;
}
if (fields.contentType !== undefined) {
this.contentType = fields.contentType;
}
if (fields.responseFormat !== undefined) {
this.responseFormat = fields.responseFormat;
}
if (fields.auth !== undefined) {
this.auth = fields.auth;
}
if (fields.networkSession !== undefined) {
this.networkSession = fields.networkSession;
}
if (fields.cancellationToken !== undefined) {
this.cancellationToken = fields.cancellationToken;
}
if (fields.followRedirects !== undefined) {
this.followRedirects = fields.followRedirects;
}
}
}
exports.FetchOptions = FetchOptions;
//# sourceMappingURL=fetchOptions.js.map