-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMultipleErrorsResponse.js
More file actions
124 lines (101 loc) · 3.95 KB
/
MultipleErrorsResponse.js
File metadata and controls
124 lines (101 loc) · 3.95 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
/**
* 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 MultipleErrorsResponse model module.
* @module model/MultipleErrorsResponse
* @version 3.0.0
*/
class MultipleErrorsResponse {
/**
* Constructs a new <code>MultipleErrorsResponse</code>.
* @alias module:model/MultipleErrorsResponse
* @param status {module:model/MultipleErrorsResponse.StatusEnum}
* @param errors {Array.<String>}
*/
constructor(status, errors) {
MultipleErrorsResponse.initialize(this, status, errors);
}
/**
* 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, status, errors) {
obj['status'] = status;
obj['errors'] = errors;
}
/**
* Constructs a <code>MultipleErrorsResponse</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/MultipleErrorsResponse} obj Optional instance to populate.
* @return {module:model/MultipleErrorsResponse} The populated <code>MultipleErrorsResponse</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new MultipleErrorsResponse();
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('errors')) {
obj['errors'] = ApiClient.convertToType(data['errors'], ['String']);
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>MultipleErrorsResponse</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>MultipleErrorsResponse</code>.
*/
static validateJSON(data) {
// check to make sure all required properties are present in the JSON string
for (const property of MultipleErrorsResponse.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['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
}
// ensure the json data is an array
if (!Array.isArray(data['errors'])) {
throw new Error("Expected the field `errors` to be an array in the JSON data but got " + data['errors']);
}
return true;
}
}
MultipleErrorsResponse.RequiredProperties = ["status", "errors"];
/**
* @member {module:model/MultipleErrorsResponse.StatusEnum} status
*/
MultipleErrorsResponse.prototype['status'] = undefined;
/**
* @member {Array.<String>} errors
*/
MultipleErrorsResponse.prototype['errors'] = undefined;
/**
* Allowed values for the <code>status</code> property.
* @enum {String}
* @readonly
*/
MultipleErrorsResponse['StatusEnum'] = {
/**
* value: "error"
* @const
*/
"error": "error"
};
export default MultipleErrorsResponse;