@opra/common
Version:
Opra common package
31 lines (30 loc) • 820 B
JavaScript
import { omitUndefined } from '@jsopen/objects';
import { DocumentElement } from '../common/document-element.js';
/**
* @class HttpRequestBody
*/
export class HttpRequestBody extends DocumentElement {
description;
content = [];
required;
maxContentSize;
immediateFetch;
partial;
allowPatchOperators;
keepKeyFields;
constructor(owner) {
super(owner);
}
toJSON(options) {
return omitUndefined({
description: this.description,
required: this.required,
maxContentSize: this.maxContentSize,
content: this.content.length
? this.content.map(x => x.toJSON(options))
: [],
partial: this.partial,
allowPatchOperators: this.allowPatchOperators,
});
}
}