|
| 1 | +/* |
| 2 | + * -------------------------------------------------------------------------------- |
| 3 | + * <copyright company="Aspose" file="CommentRangeStart.swift"> |
| 4 | + * Copyright (c) 2025 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 | +import Foundation |
| 29 | + |
| 30 | +// Comment range start link. |
| 31 | +public class CommentRangeStart : NodeLink { |
| 32 | + // Field of commentLink. Comment range start link. |
| 33 | + private var _commentLink : CommentLink? = nil; |
| 34 | + |
| 35 | + public var commentLink : CommentLink? { |
| 36 | + get { |
| 37 | + return self._commentLink; |
| 38 | + } |
| 39 | + set { |
| 40 | + self._commentLink = newValue; |
| 41 | + } |
| 42 | + } |
| 43 | + |
| 44 | + private enum CodingKeys: String, CodingKey { |
| 45 | + case commentLink = "CommentLink"; |
| 46 | + case invalidCodingKey; |
| 47 | + } |
| 48 | + |
| 49 | + public override init() { |
| 50 | + super.init(); |
| 51 | + } |
| 52 | + |
| 53 | + public required init(from json: [String: Any]) throws { |
| 54 | + try super.init(from: json); |
| 55 | + if let raw_commentLink = json["CommentLink"] as? [String: Any] { |
| 56 | + self.commentLink = try ObjectSerializer.deserialize(type: CommentLink.self, from: raw_commentLink); |
| 57 | + } |
| 58 | + |
| 59 | + } |
| 60 | + |
| 61 | + public required init(from decoder: Decoder) throws { |
| 62 | + try super.init(from: decoder); |
| 63 | + let container = try decoder.container(keyedBy: CodingKeys.self); |
| 64 | + self.commentLink = try container.decodeIfPresent(CommentLink.self, forKey: .commentLink); |
| 65 | + } |
| 66 | + |
| 67 | + public override func encode(to encoder: Encoder) throws { |
| 68 | + try super.encode(to: encoder); |
| 69 | + var container = encoder.container(keyedBy: CodingKeys.self); |
| 70 | + if (self.commentLink != nil) { |
| 71 | + try container.encode(self.commentLink, forKey: .commentLink); |
| 72 | + } |
| 73 | + } |
| 74 | + |
| 75 | + public override func collectFilesContent(_ resultFilesContent : inout [FileReference]) { |
| 76 | + } |
| 77 | + |
| 78 | + public override func validate() throws { |
| 79 | + try super.validate(); |
| 80 | + try self.commentLink?.validate(); |
| 81 | + |
| 82 | + } |
| 83 | + |
| 84 | + // Sets commentLink. Gets or sets the link to comment. |
| 85 | + public func setCommentLink(commentLink : CommentLink?) -> CommentRangeStart { |
| 86 | + self.commentLink = commentLink; |
| 87 | + return self; |
| 88 | + } |
| 89 | + |
| 90 | + // Gets commentLink. Gets or sets the link to comment. |
| 91 | + public func getCommentLink() -> CommentLink? { |
| 92 | + return self.commentLink; |
| 93 | + } |
| 94 | +} |
0 commit comments