-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFolder.js
More file actions
137 lines (115 loc) · 4.65 KB
/
Folder.js
File metadata and controls
137 lines (115 loc) · 4.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/**
* DocSpring API
* Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
*
* The version of the OpenAPI document: v1
*
*
* 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';
/**
* The Folder model module.
* @module model/Folder
* @version 3.0.0
*/
class Folder {
/**
* Constructs a new <code>Folder</code>.
* @alias module:model/Folder
* @param id {String}
* @param name {String}
* @param path {String}
* @param parent_folder_id {String}
*/
constructor(id, name, path, parent_folder_id) {
Folder.initialize(this, id, name, path, parent_folder_id);
}
/**
* 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, id, name, path, parent_folder_id) {
obj['id'] = id;
obj['name'] = name;
obj['path'] = path;
obj['parent_folder_id'] = parent_folder_id;
}
/**
* Constructs a <code>Folder</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 {module:model/Folder} obj Optional instance to populate.
* @return {module:model/Folder} The populated <code>Folder</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new Folder();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'String');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('path')) {
obj['path'] = ApiClient.convertToType(data['path'], 'String');
}
if (data.hasOwnProperty('parent_folder_id')) {
obj['parent_folder_id'] = ApiClient.convertToType(data['parent_folder_id'], 'String');
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>Folder</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>Folder</code>.
*/
static validateJSON(data) {
// check to make sure all required properties are present in the JSON string
for (const property of Folder.RequiredProperties) {
if (!data.hasOwnProperty(property)) {
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
}
}
// ensure the json data is a string
if (data['id'] && !(typeof data['id'] === 'string' || data['id'] instanceof String)) {
throw new Error("Expected the field `id` to be a primitive type in the JSON string but got " + data['id']);
}
// ensure the json data is a string
if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
}
// ensure the json data is a string
if (data['path'] && !(typeof data['path'] === 'string' || data['path'] instanceof String)) {
throw new Error("Expected the field `path` to be a primitive type in the JSON string but got " + data['path']);
}
// ensure the json data is a string
if (data['parent_folder_id'] && !(typeof data['parent_folder_id'] === 'string' || data['parent_folder_id'] instanceof String)) {
throw new Error("Expected the field `parent_folder_id` to be a primitive type in the JSON string but got " + data['parent_folder_id']);
}
return true;
}
}
Folder.RequiredProperties = ["id", "name", "path", "parent_folder_id"];
/**
* @member {String} id
*/
Folder.prototype['id'] = undefined;
/**
* @member {String} name
*/
Folder.prototype['name'] = undefined;
/**
* @member {String} path
*/
Folder.prototype['path'] = undefined;
/**
* @member {String} parent_folder_id
*/
Folder.prototype['parent_folder_id'] = undefined;
export default Folder;