/**
* OpenAPI definition
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: v0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import {ApiClient} from '../ApiClient.js';
/**
* The Content model module.
* @module model/Content
* @version v0
*/
export class Content {
/**
* Constructs a new <code>Content</code>.
* @alias Content
*/
constructor() {
/** fileName
* @type {String}
*/
this.fileName = undefined;
/** contentType
* @type {String}
*/
this.contentType = undefined;
/** length
* @type {Number}
*/
this.length = undefined;
Content.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>Content</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {Content} obj Optional instance to populate.
* @return {Content} The populated <code>Content</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new Content();
if (data.hasOwnProperty('fileName')) {
obj['fileName'] = ApiClient.convertToType(data['fileName'], 'String');
}
if (data.hasOwnProperty('contentType')) {
obj['contentType'] = ApiClient.convertToType(data['contentType'], 'String');
}
if (data.hasOwnProperty('length')) {
obj['length'] = ApiClient.convertToType(data['length'], 'Number');
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>Content</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>Content</code>.
*/
static validateJSON(data) {
// ensure the json data is a string
if (data['fileName'] && !(typeof data['fileName'] === 'string' || data['fileName'] instanceof String)) {
throw new Error("Expected the field `fileName` to be a primitive type in the JSON string but got " + data['fileName']);
}
// ensure the json data is a string
if (data['contentType'] && !(typeof data['contentType'] === 'string' || data['contentType'] instanceof String)) {
throw new Error("Expected the field `contentType` to be a primitive type in the JSON string but got " + data['contentType']);
}
return true;
}
}
export default Content;