|
| 1 | +/* |
| 2 | + * -------------------------------------------------------------------------------- |
| 3 | + * <copyright company="Aspose" file="revision.dart"> |
| 4 | + * Copyright (c) 2024 Aspose.Words for Cloud |
| 5 | + * </copyright> |
| 6 | + * <summary> |
| 7 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | + * of this software and associated documentation files (the "Software"), to deal |
| 9 | + * in the Software without restriction, including without limitation the rights |
| 10 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | + * copies of the Software, and to permit persons to whom the Software is |
| 12 | + * furnished to do so, subject to the following conditions: |
| 13 | + * |
| 14 | + * The above copyright notice and this permission notice shall be included in all |
| 15 | + * copies or substantial portions of the Software. |
| 16 | + * |
| 17 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | + * SOFTWARE. |
| 24 | + * </summary> |
| 25 | + * -------------------------------------------------------------------------------- |
| 26 | + */ |
| 27 | + |
| 28 | +library aspose_words_cloud; |
| 29 | + |
| 30 | +import '../../aspose_words_cloud.dart'; |
| 31 | + |
| 32 | +/// Revision Dto. |
| 33 | +class Revision implements ModelBase { |
| 34 | + /// Gets or sets the revision author. |
| 35 | + String? _revisionAuthor; |
| 36 | + |
| 37 | + String? get revisionAuthor => _revisionAuthor; |
| 38 | + set revisionAuthor(String? val) => _revisionAuthor = val; |
| 39 | + |
| 40 | + |
| 41 | + /// Gets or sets the revision date time. |
| 42 | + DateTime? _revisionDateTime; |
| 43 | + |
| 44 | + DateTime? get revisionDateTime => _revisionDateTime; |
| 45 | + set revisionDateTime(DateTime? val) => _revisionDateTime = val; |
| 46 | + |
| 47 | + |
| 48 | + /// Gets or sets the revision text. |
| 49 | + String? _revisionText; |
| 50 | + |
| 51 | + String? get revisionText => _revisionText; |
| 52 | + set revisionText(String? val) => _revisionText = val; |
| 53 | + |
| 54 | + |
| 55 | + /// Gets or sets the revision type. |
| 56 | + String? _revisionType; |
| 57 | + |
| 58 | + String? get revisionType => _revisionType; |
| 59 | + set revisionType(String? val) => _revisionType = val; |
| 60 | + |
| 61 | + |
| 62 | + @override |
| 63 | + void deserialize(Map<String, dynamic>? json) { |
| 64 | + if (json == null) { |
| 65 | + throw ApiException(400, 'Failed to deserialize Revision data model.'); |
| 66 | + } |
| 67 | + |
| 68 | + if (json.containsKey('RevisionAuthor')) { |
| 69 | + revisionAuthor = json['RevisionAuthor'] as String; |
| 70 | + } else { |
| 71 | + revisionAuthor = null; |
| 72 | + } |
| 73 | + |
| 74 | + if (json.containsKey('RevisionDateTime')) { |
| 75 | + revisionDateTime = DateTime.parse(json['RevisionDateTime'] as String); |
| 76 | + } else { |
| 77 | + revisionDateTime = null; |
| 78 | + } |
| 79 | + |
| 80 | + if (json.containsKey('RevisionText')) { |
| 81 | + revisionText = json['RevisionText'] as String; |
| 82 | + } else { |
| 83 | + revisionText = null; |
| 84 | + } |
| 85 | + |
| 86 | + if (json.containsKey('RevisionType')) { |
| 87 | + revisionType = json['RevisionType'] as String; |
| 88 | + } else { |
| 89 | + revisionType = null; |
| 90 | + } |
| 91 | + } |
| 92 | + |
| 93 | + @override |
| 94 | + Map<String, dynamic> serialize() { |
| 95 | + var _result = <String, dynamic>{}; |
| 96 | + if (revisionAuthor != null) { |
| 97 | + _result['RevisionAuthor'] = revisionAuthor!; |
| 98 | + } |
| 99 | + |
| 100 | + if (revisionDateTime != null) { |
| 101 | + _result['RevisionDateTime'] = revisionDateTime!.toIso8601String(); |
| 102 | + } |
| 103 | + |
| 104 | + if (revisionText != null) { |
| 105 | + _result['RevisionText'] = revisionText!; |
| 106 | + } |
| 107 | + |
| 108 | + if (revisionType != null) { |
| 109 | + _result['RevisionType'] = revisionType!; |
| 110 | + } |
| 111 | + return _result; |
| 112 | + } |
| 113 | + |
| 114 | + @override |
| 115 | + void getFilesContent(List<FileReference> resultFilesContent) { |
| 116 | + } |
| 117 | + |
| 118 | + @override |
| 119 | + void validate() { |
| 120 | + if (revisionDateTime == null) |
| 121 | + { |
| 122 | + throw new ApiException(400, 'Property RevisionDateTime in Revision is required.'); |
| 123 | + } |
| 124 | + } |
| 125 | +} |
| 126 | + |
| 127 | + |
0 commit comments