Source: proto/spine/validate/validation_error_pb.js

  1. // source: spine/validate/validation_error.proto
  2. /**
  3. * @fileoverview
  4. * @enhanceable
  5. * @suppress {messageConventions} JS Compiler reports an error if a variable or
  6. * field starts with 'MSG_' and isn't a translatable message.
  7. * @public
  8. */
  9. // GENERATED CODE -- DO NOT EDIT!
  10. var jspb = require('google-protobuf');
  11. var goog = jspb;
  12. var global = Function('return this')();
  13. var spine_options_pb = require('../../spine/options_pb.js');
  14. goog.object.extend(proto, spine_options_pb);
  15. var google_protobuf_any_pb = require('../../google/protobuf/any_pb.js');
  16. goog.object.extend(proto, google_protobuf_any_pb);
  17. var spine_base_field_path_pb = require('../../spine/base/field_path_pb.js');
  18. goog.object.extend(proto, spine_base_field_path_pb);
  19. goog.exportSymbol('proto.spine.validate.ConstraintViolation', null, global);
  20. goog.exportSymbol('proto.spine.validate.ValidationError', null, global);
  21. /**
  22. * Generated by JsPbCodeGenerator.
  23. * @param {Array=} opt_data Optional initial data array, typically from a
  24. * server response, or constructed directly in Javascript. The array is used
  25. * in place and becomes part of the constructed object. It is not cloned.
  26. * If no data is provided, the constructed object will be empty, but still
  27. * valid.
  28. * @extends {jspb.Message}
  29. * @constructor
  30. */
  31. proto.spine.validate.ValidationError = function(opt_data) {
  32. jspb.Message.initialize(this, opt_data, 0, -1, proto.spine.validate.ValidationError.repeatedFields_, null);
  33. };
  34. goog.inherits(proto.spine.validate.ValidationError, jspb.Message);
  35. if (goog.DEBUG && !COMPILED) {
  36. /**
  37. * @public
  38. * @override
  39. */
  40. proto.spine.validate.ValidationError.displayName = 'proto.spine.validate.ValidationError';
  41. }
  42. /**
  43. * Generated by JsPbCodeGenerator.
  44. * @param {Array=} opt_data Optional initial data array, typically from a
  45. * server response, or constructed directly in Javascript. The array is used
  46. * in place and becomes part of the constructed object. It is not cloned.
  47. * If no data is provided, the constructed object will be empty, but still
  48. * valid.
  49. * @extends {jspb.Message}
  50. * @constructor
  51. */
  52. proto.spine.validate.ConstraintViolation = function(opt_data) {
  53. jspb.Message.initialize(this, opt_data, 0, -1, proto.spine.validate.ConstraintViolation.repeatedFields_, null);
  54. };
  55. goog.inherits(proto.spine.validate.ConstraintViolation, jspb.Message);
  56. if (goog.DEBUG && !COMPILED) {
  57. /**
  58. * @public
  59. * @override
  60. */
  61. proto.spine.validate.ConstraintViolation.displayName = 'proto.spine.validate.ConstraintViolation';
  62. }
  63. /**
  64. * List of repeated fields within this message type.
  65. * @private {!Array<number>}
  66. * @const
  67. */
  68. proto.spine.validate.ValidationError.repeatedFields_ = [1];
  69. if (jspb.Message.GENERATE_TO_OBJECT) {
  70. /**
  71. * Creates an object representation of this proto.
  72. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  73. * Optional fields that are not set will be set to undefined.
  74. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  75. * For the list of reserved names please see:
  76. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  77. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  78. * JSPB instance for transitional soy proto support:
  79. * http://goto/soy-param-migration
  80. * @return {!Object}
  81. */
  82. proto.spine.validate.ValidationError.prototype.toObject = function(opt_includeInstance) {
  83. return proto.spine.validate.ValidationError.toObject(opt_includeInstance, this);
  84. };
  85. /**
  86. * Static version of the {@see toObject} method.
  87. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  88. * the JSPB instance for transitional soy proto support:
  89. * http://goto/soy-param-migration
  90. * @param {!proto.spine.validate.ValidationError} msg The msg instance to transform.
  91. * @return {!Object}
  92. * @suppress {unusedLocalVariables} f is only used for nested messages
  93. */
  94. proto.spine.validate.ValidationError.toObject = function(includeInstance, msg) {
  95. var f, obj = {
  96. constraintViolationList: jspb.Message.toObjectList(msg.getConstraintViolationList(),
  97. proto.spine.validate.ConstraintViolation.toObject, includeInstance)
  98. };
  99. if (includeInstance) {
  100. obj.$jspbMessageInstance = msg;
  101. }
  102. return obj;
  103. };
  104. }
  105. /**
  106. * Deserializes binary data (in protobuf wire format).
  107. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  108. * @return {!proto.spine.validate.ValidationError}
  109. */
  110. proto.spine.validate.ValidationError.deserializeBinary = function(bytes) {
  111. var reader = new jspb.BinaryReader(bytes);
  112. var msg = new proto.spine.validate.ValidationError;
  113. return proto.spine.validate.ValidationError.deserializeBinaryFromReader(msg, reader);
  114. };
  115. /**
  116. * Deserializes binary data (in protobuf wire format) from the
  117. * given reader into the given message object.
  118. * @param {!proto.spine.validate.ValidationError} msg The message object to deserialize into.
  119. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  120. * @return {!proto.spine.validate.ValidationError}
  121. */
  122. proto.spine.validate.ValidationError.deserializeBinaryFromReader = function(msg, reader) {
  123. while (reader.nextField()) {
  124. if (reader.isEndGroup()) {
  125. break;
  126. }
  127. var field = reader.getFieldNumber();
  128. switch (field) {
  129. case 1:
  130. var value = new proto.spine.validate.ConstraintViolation;
  131. reader.readMessage(value,proto.spine.validate.ConstraintViolation.deserializeBinaryFromReader);
  132. msg.addConstraintViolation(value);
  133. break;
  134. default:
  135. reader.skipField();
  136. break;
  137. }
  138. }
  139. return msg;
  140. };
  141. /**
  142. * Serializes the message to binary data (in protobuf wire format).
  143. * @return {!Uint8Array}
  144. */
  145. proto.spine.validate.ValidationError.prototype.serializeBinary = function() {
  146. var writer = new jspb.BinaryWriter();
  147. proto.spine.validate.ValidationError.serializeBinaryToWriter(this, writer);
  148. return writer.getResultBuffer();
  149. };
  150. /**
  151. * Serializes the given message to binary data (in protobuf wire
  152. * format), writing to the given BinaryWriter.
  153. * @param {!proto.spine.validate.ValidationError} message
  154. * @param {!jspb.BinaryWriter} writer
  155. * @suppress {unusedLocalVariables} f is only used for nested messages
  156. */
  157. proto.spine.validate.ValidationError.serializeBinaryToWriter = function(message, writer) {
  158. var f = undefined;
  159. f = message.getConstraintViolationList();
  160. if (f.length > 0) {
  161. writer.writeRepeatedMessage(
  162. 1,
  163. f,
  164. proto.spine.validate.ConstraintViolation.serializeBinaryToWriter
  165. );
  166. }
  167. };
  168. /**
  169. * repeated ConstraintViolation constraint_violation = 1;
  170. * @return {!Array<!proto.spine.validate.ConstraintViolation>}
  171. */
  172. proto.spine.validate.ValidationError.prototype.getConstraintViolationList = function() {
  173. return /** @type{!Array<!proto.spine.validate.ConstraintViolation>} */ (
  174. jspb.Message.getRepeatedWrapperField(this, proto.spine.validate.ConstraintViolation, 1));
  175. };
  176. /**
  177. * @param {!Array<!proto.spine.validate.ConstraintViolation>} value
  178. * @return {!proto.spine.validate.ValidationError} returns this
  179. */
  180. proto.spine.validate.ValidationError.prototype.setConstraintViolationList = function(value) {
  181. return jspb.Message.setRepeatedWrapperField(this, 1, value);
  182. };
  183. /**
  184. * @param {!proto.spine.validate.ConstraintViolation=} opt_value
  185. * @param {number=} opt_index
  186. * @return {!proto.spine.validate.ConstraintViolation}
  187. */
  188. proto.spine.validate.ValidationError.prototype.addConstraintViolation = function(opt_value, opt_index) {
  189. return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.spine.validate.ConstraintViolation, opt_index);
  190. };
  191. /**
  192. * Clears the list making it empty but non-null.
  193. * @return {!proto.spine.validate.ValidationError} returns this
  194. */
  195. proto.spine.validate.ValidationError.prototype.clearConstraintViolationList = function() {
  196. return this.setConstraintViolationList([]);
  197. };
  198. /**
  199. * List of repeated fields within this message type.
  200. * @private {!Array<number>}
  201. * @const
  202. */
  203. proto.spine.validate.ConstraintViolation.repeatedFields_ = [2,5];
  204. if (jspb.Message.GENERATE_TO_OBJECT) {
  205. /**
  206. * Creates an object representation of this proto.
  207. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  208. * Optional fields that are not set will be set to undefined.
  209. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  210. * For the list of reserved names please see:
  211. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  212. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  213. * JSPB instance for transitional soy proto support:
  214. * http://goto/soy-param-migration
  215. * @return {!Object}
  216. */
  217. proto.spine.validate.ConstraintViolation.prototype.toObject = function(opt_includeInstance) {
  218. return proto.spine.validate.ConstraintViolation.toObject(opt_includeInstance, this);
  219. };
  220. /**
  221. * Static version of the {@see toObject} method.
  222. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  223. * the JSPB instance for transitional soy proto support:
  224. * http://goto/soy-param-migration
  225. * @param {!proto.spine.validate.ConstraintViolation} msg The msg instance to transform.
  226. * @return {!Object}
  227. * @suppress {unusedLocalVariables} f is only used for nested messages
  228. */
  229. proto.spine.validate.ConstraintViolation.toObject = function(includeInstance, msg) {
  230. var f, obj = {
  231. msgFormat: jspb.Message.getFieldWithDefault(msg, 1, ""),
  232. paramList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f,
  233. typeName: jspb.Message.getFieldWithDefault(msg, 7, ""),
  234. fieldPath: (f = msg.getFieldPath()) && spine_base_field_path_pb.FieldPath.toObject(includeInstance, f),
  235. fieldValue: (f = msg.getFieldValue()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
  236. violationList: jspb.Message.toObjectList(msg.getViolationList(),
  237. proto.spine.validate.ConstraintViolation.toObject, includeInstance)
  238. };
  239. if (includeInstance) {
  240. obj.$jspbMessageInstance = msg;
  241. }
  242. return obj;
  243. };
  244. }
  245. /**
  246. * Deserializes binary data (in protobuf wire format).
  247. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  248. * @return {!proto.spine.validate.ConstraintViolation}
  249. */
  250. proto.spine.validate.ConstraintViolation.deserializeBinary = function(bytes) {
  251. var reader = new jspb.BinaryReader(bytes);
  252. var msg = new proto.spine.validate.ConstraintViolation;
  253. return proto.spine.validate.ConstraintViolation.deserializeBinaryFromReader(msg, reader);
  254. };
  255. /**
  256. * Deserializes binary data (in protobuf wire format) from the
  257. * given reader into the given message object.
  258. * @param {!proto.spine.validate.ConstraintViolation} msg The message object to deserialize into.
  259. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  260. * @return {!proto.spine.validate.ConstraintViolation}
  261. */
  262. proto.spine.validate.ConstraintViolation.deserializeBinaryFromReader = function(msg, reader) {
  263. while (reader.nextField()) {
  264. if (reader.isEndGroup()) {
  265. break;
  266. }
  267. var field = reader.getFieldNumber();
  268. switch (field) {
  269. case 1:
  270. var value = /** @type {string} */ (reader.readString());
  271. msg.setMsgFormat(value);
  272. break;
  273. case 2:
  274. var value = /** @type {string} */ (reader.readString());
  275. msg.addParam(value);
  276. break;
  277. case 7:
  278. var value = /** @type {string} */ (reader.readString());
  279. msg.setTypeName(value);
  280. break;
  281. case 3:
  282. var value = new spine_base_field_path_pb.FieldPath;
  283. reader.readMessage(value,spine_base_field_path_pb.FieldPath.deserializeBinaryFromReader);
  284. msg.setFieldPath(value);
  285. break;
  286. case 4:
  287. var value = new google_protobuf_any_pb.Any;
  288. reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
  289. msg.setFieldValue(value);
  290. break;
  291. case 5:
  292. var value = new proto.spine.validate.ConstraintViolation;
  293. reader.readMessage(value,proto.spine.validate.ConstraintViolation.deserializeBinaryFromReader);
  294. msg.addViolation(value);
  295. break;
  296. default:
  297. reader.skipField();
  298. break;
  299. }
  300. }
  301. return msg;
  302. };
  303. /**
  304. * Serializes the message to binary data (in protobuf wire format).
  305. * @return {!Uint8Array}
  306. */
  307. proto.spine.validate.ConstraintViolation.prototype.serializeBinary = function() {
  308. var writer = new jspb.BinaryWriter();
  309. proto.spine.validate.ConstraintViolation.serializeBinaryToWriter(this, writer);
  310. return writer.getResultBuffer();
  311. };
  312. /**
  313. * Serializes the given message to binary data (in protobuf wire
  314. * format), writing to the given BinaryWriter.
  315. * @param {!proto.spine.validate.ConstraintViolation} message
  316. * @param {!jspb.BinaryWriter} writer
  317. * @suppress {unusedLocalVariables} f is only used for nested messages
  318. */
  319. proto.spine.validate.ConstraintViolation.serializeBinaryToWriter = function(message, writer) {
  320. var f = undefined;
  321. f = message.getMsgFormat();
  322. if (f.length > 0) {
  323. writer.writeString(
  324. 1,
  325. f
  326. );
  327. }
  328. f = message.getParamList();
  329. if (f.length > 0) {
  330. writer.writeRepeatedString(
  331. 2,
  332. f
  333. );
  334. }
  335. f = message.getTypeName();
  336. if (f.length > 0) {
  337. writer.writeString(
  338. 7,
  339. f
  340. );
  341. }
  342. f = message.getFieldPath();
  343. if (f != null) {
  344. writer.writeMessage(
  345. 3,
  346. f,
  347. spine_base_field_path_pb.FieldPath.serializeBinaryToWriter
  348. );
  349. }
  350. f = message.getFieldValue();
  351. if (f != null) {
  352. writer.writeMessage(
  353. 4,
  354. f,
  355. google_protobuf_any_pb.Any.serializeBinaryToWriter
  356. );
  357. }
  358. f = message.getViolationList();
  359. if (f.length > 0) {
  360. writer.writeRepeatedMessage(
  361. 5,
  362. f,
  363. proto.spine.validate.ConstraintViolation.serializeBinaryToWriter
  364. );
  365. }
  366. };
  367. /**
  368. * optional string msg_format = 1;
  369. * @return {string}
  370. */
  371. proto.spine.validate.ConstraintViolation.prototype.getMsgFormat = function() {
  372. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  373. };
  374. /**
  375. * @param {string} value
  376. * @return {!proto.spine.validate.ConstraintViolation} returns this
  377. */
  378. proto.spine.validate.ConstraintViolation.prototype.setMsgFormat = function(value) {
  379. return jspb.Message.setProto3StringField(this, 1, value);
  380. };
  381. /**
  382. * repeated string param = 2;
  383. * @return {!Array<string>}
  384. */
  385. proto.spine.validate.ConstraintViolation.prototype.getParamList = function() {
  386. return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 2));
  387. };
  388. /**
  389. * @param {!Array<string>} value
  390. * @return {!proto.spine.validate.ConstraintViolation} returns this
  391. */
  392. proto.spine.validate.ConstraintViolation.prototype.setParamList = function(value) {
  393. return jspb.Message.setField(this, 2, value || []);
  394. };
  395. /**
  396. * @param {string} value
  397. * @param {number=} opt_index
  398. * @return {!proto.spine.validate.ConstraintViolation} returns this
  399. */
  400. proto.spine.validate.ConstraintViolation.prototype.addParam = function(value, opt_index) {
  401. return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
  402. };
  403. /**
  404. * Clears the list making it empty but non-null.
  405. * @return {!proto.spine.validate.ConstraintViolation} returns this
  406. */
  407. proto.spine.validate.ConstraintViolation.prototype.clearParamList = function() {
  408. return this.setParamList([]);
  409. };
  410. /**
  411. * optional string type_name = 7;
  412. * @return {string}
  413. */
  414. proto.spine.validate.ConstraintViolation.prototype.getTypeName = function() {
  415. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
  416. };
  417. /**
  418. * @param {string} value
  419. * @return {!proto.spine.validate.ConstraintViolation} returns this
  420. */
  421. proto.spine.validate.ConstraintViolation.prototype.setTypeName = function(value) {
  422. return jspb.Message.setProto3StringField(this, 7, value);
  423. };
  424. /**
  425. * optional spine.base.FieldPath field_path = 3;
  426. * @return {?proto.spine.base.FieldPath}
  427. */
  428. proto.spine.validate.ConstraintViolation.prototype.getFieldPath = function() {
  429. return /** @type{?proto.spine.base.FieldPath} */ (
  430. jspb.Message.getWrapperField(this, spine_base_field_path_pb.FieldPath, 3));
  431. };
  432. /**
  433. * @param {?proto.spine.base.FieldPath|undefined} value
  434. * @return {!proto.spine.validate.ConstraintViolation} returns this
  435. */
  436. proto.spine.validate.ConstraintViolation.prototype.setFieldPath = function(value) {
  437. return jspb.Message.setWrapperField(this, 3, value);
  438. };
  439. /**
  440. * Clears the message field making it undefined.
  441. * @return {!proto.spine.validate.ConstraintViolation} returns this
  442. */
  443. proto.spine.validate.ConstraintViolation.prototype.clearFieldPath = function() {
  444. return this.setFieldPath(undefined);
  445. };
  446. /**
  447. * Returns whether this field is set.
  448. * @return {boolean}
  449. */
  450. proto.spine.validate.ConstraintViolation.prototype.hasFieldPath = function() {
  451. return jspb.Message.getField(this, 3) != null;
  452. };
  453. /**
  454. * optional google.protobuf.Any field_value = 4;
  455. * @return {?proto.google.protobuf.Any}
  456. */
  457. proto.spine.validate.ConstraintViolation.prototype.getFieldValue = function() {
  458. return /** @type{?proto.google.protobuf.Any} */ (
  459. jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 4));
  460. };
  461. /**
  462. * @param {?proto.google.protobuf.Any|undefined} value
  463. * @return {!proto.spine.validate.ConstraintViolation} returns this
  464. */
  465. proto.spine.validate.ConstraintViolation.prototype.setFieldValue = function(value) {
  466. return jspb.Message.setWrapperField(this, 4, value);
  467. };
  468. /**
  469. * Clears the message field making it undefined.
  470. * @return {!proto.spine.validate.ConstraintViolation} returns this
  471. */
  472. proto.spine.validate.ConstraintViolation.prototype.clearFieldValue = function() {
  473. return this.setFieldValue(undefined);
  474. };
  475. /**
  476. * Returns whether this field is set.
  477. * @return {boolean}
  478. */
  479. proto.spine.validate.ConstraintViolation.prototype.hasFieldValue = function() {
  480. return jspb.Message.getField(this, 4) != null;
  481. };
  482. /**
  483. * repeated ConstraintViolation violation = 5;
  484. * @return {!Array<!proto.spine.validate.ConstraintViolation>}
  485. */
  486. proto.spine.validate.ConstraintViolation.prototype.getViolationList = function() {
  487. return /** @type{!Array<!proto.spine.validate.ConstraintViolation>} */ (
  488. jspb.Message.getRepeatedWrapperField(this, proto.spine.validate.ConstraintViolation, 5));
  489. };
  490. /**
  491. * @param {!Array<!proto.spine.validate.ConstraintViolation>} value
  492. * @return {!proto.spine.validate.ConstraintViolation} returns this
  493. */
  494. proto.spine.validate.ConstraintViolation.prototype.setViolationList = function(value) {
  495. return jspb.Message.setRepeatedWrapperField(this, 5, value);
  496. };
  497. /**
  498. * @param {!proto.spine.validate.ConstraintViolation=} opt_value
  499. * @param {number=} opt_index
  500. * @return {!proto.spine.validate.ConstraintViolation}
  501. */
  502. proto.spine.validate.ConstraintViolation.prototype.addViolation = function(opt_value, opt_index) {
  503. return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.spine.validate.ConstraintViolation, opt_index);
  504. };
  505. /**
  506. * Clears the list making it empty but non-null.
  507. * @return {!proto.spine.validate.ConstraintViolation} returns this
  508. */
  509. proto.spine.validate.ConstraintViolation.prototype.clearViolationList = function() {
  510. return this.setViolationList([]);
  511. };
  512. goog.object.extend(exports, proto.spine.validate);
  513. // Generated by Spine ProtoJs Plugin
  514. let ObjectParser = require('../../../client/parser/object-parser.js').default;
  515. let TypeParsers = require('../../../client/parser/type-parsers.js').default;
  516. proto.spine.validate.ConstraintViolation.Parser = function() {
  517. ObjectParser.call(this);
  518. };
  519. proto.spine.validate.ConstraintViolation.Parser.prototype = Object.create(ObjectParser.prototype);
  520. proto.spine.validate.ConstraintViolation.Parser.prototype.constructor = proto.spine.validate.ConstraintViolation.Parser;
  521. proto.spine.validate.ConstraintViolation.Parser.prototype.fromObject = function(obj) {
  522. if (obj === null) {
  523. return null;
  524. }
  525. let msg = new proto.spine.validate.ConstraintViolation();
  526. if (obj.msgFormat !== undefined) {
  527. if (obj.msgFormat !== null) {
  528. let value = obj.msgFormat;
  529. msg.setMsgFormat(value);
  530. }
  531. }
  532. if (obj.param !== undefined && obj.param !== null) {
  533. obj.param.forEach(
  534. (listItem, index, array) => {
  535. if (listItem !== null) {
  536. let value = listItem;
  537. msg.addParam(value);
  538. }
  539. }
  540. );
  541. }
  542. if (obj.typeName !== undefined) {
  543. if (obj.typeName !== null) {
  544. let value = obj.typeName;
  545. msg.setTypeName(value);
  546. }
  547. }
  548. if (obj.fieldPath !== undefined) {
  549. if (obj.fieldPath === null) {
  550. msg.setFieldPath(null);
  551. } else {
  552. let value = TypeParsers.parserFor('type.spine.io/spine.base.FieldPath').fromObject(obj.fieldPath);
  553. msg.setFieldPath(value);
  554. }
  555. }
  556. if (obj.fieldValue !== undefined) {
  557. if (obj.fieldValue === null) {
  558. msg.setFieldValue(null);
  559. } else {
  560. let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.fieldValue);
  561. msg.setFieldValue(value);
  562. }
  563. }
  564. if (obj.violation !== undefined && obj.violation !== null) {
  565. obj.violation.forEach(
  566. (listItem, index, array) => {
  567. if (listItem === null) {
  568. msg.addViolation(null);
  569. } else {
  570. let value = TypeParsers.parserFor('type.spine.io/spine.validate.ConstraintViolation').fromObject(listItem);
  571. msg.addViolation(value);
  572. }
  573. }
  574. );
  575. }
  576. return msg;
  577. };
  578. proto.spine.validate.ValidationError.Parser = function() {
  579. ObjectParser.call(this);
  580. };
  581. proto.spine.validate.ValidationError.Parser.prototype = Object.create(ObjectParser.prototype);
  582. proto.spine.validate.ValidationError.Parser.prototype.constructor = proto.spine.validate.ValidationError.Parser;
  583. proto.spine.validate.ValidationError.Parser.prototype.fromObject = function(obj) {
  584. if (obj === null) {
  585. return null;
  586. }
  587. let msg = new proto.spine.validate.ValidationError();
  588. if (obj.constraintViolation !== undefined && obj.constraintViolation !== null) {
  589. obj.constraintViolation.forEach(
  590. (listItem, index, array) => {
  591. if (listItem === null) {
  592. msg.addConstraintViolation(null);
  593. } else {
  594. let value = TypeParsers.parserFor('type.spine.io/spine.validate.ConstraintViolation').fromObject(listItem);
  595. msg.addConstraintViolation(value);
  596. }
  597. }
  598. );
  599. }
  600. return msg;
  601. };
  602. // Generated by Spine ProtoJs Plugin
  603. proto.spine.validate.ConstraintViolation.typeUrl = function() {
  604. return 'type.spine.io/spine.validate.ConstraintViolation';
  605. };
  606. // Generated by Spine ProtoJs Plugin
  607. proto.spine.validate.ValidationError.typeUrl = function() {
  608. return 'type.spine.io/spine.validate.ValidationError';
  609. };